1# phosphor-buttons 2 3Phosphor-buttons has a collection of IO event handler interfaces 4for physical inputs which are part of OCP front panel. 5 6It defines an individual dbus interface object for each physical 7button/switch inputs such as power button, reset button etc. 8Each of this button interfaces monitors it's associated io for event changes and calls 9the respective event handlers. 10 11## Gpio defs config 12 In order to monitor a button/input interface the 13respective gpio config details should be mentioned in the 14gpio defs json file - "/etc/default/obmc/gpio/gpio_defs.json" 15 16 1. The button interface type name. 17 2. An array consists of single or multiple 18 gpio configs associated with the specific button interface. 19 20## example gpio def Json config 21 22{ 23 "gpio_definitions": [ 24 { 25 "name": "POWER_BUTTON", 26 "gpio_config" :[ 27 { 28 "pin": "D0", 29 "direction": "both" 30 } 31 ] 32 }, 33 { 34 "name": "RESET_BUTTON", 35 "gpio_config" :[ 36 { 37 "pin": "AB0", 38 "direction": "both" 39 } 40 ] 41 }, 42 { 43 "name" : "HOST_SELECTOR", 44 45 "gpio_config" : [ 46 { 47 "pin": "AA4", 48 "direction": "both" 49 }, 50 { 51 "pin": "AA5", 52 "direction": "both" 53 }, 54 { 55 "pin": "AA6", 56 "direction": "both" 57 }, 58 { 59 "pin": "AA7", 60 "direction": "both" 61 } 62 ] 63 }, 64 65} 66