Add abstract factory to create button iface objects

A abstract factory class is implemented  to return
the instance of button interface class based on the
button iface formfactor name provided as
parameter to the abstract factory createInstance
 method.

Signed-off-by: Naveen Moses <naveen.mosess@hcl.com>
Change-Id: Ia791a2b6f52d09dd87da0e50a709fc72ac9d1bd7
11 files changed
tree: c181ecbccc0f87400b815a2c2d8f347f68a44ae4
  1. inc/
  2. service_files/
  3. src/
  4. .clang-format
  5. .gitignore
  6. CMakeLists.txt
  7. LICENSE
  8. MAINTAINERS
  9. OWNERS
  10. README.md
  11. settings.hpp.in
README.md

phosphor-buttons

Phosphor-buttons has a collection of IO event handler interfaces for physical inputs which are part of OCP front panel.

It defines an individual dbus interface object for each physical button/switch inputs such as power button, reset button etc. Each of this button interfaces monitors it's associated io for event changes and calls the respective event handlers.

Gpio defs config

In order to monitor a button/input interface the

respective gpio config details should be mentioned in the gpio defs json file - "/etc/default/obmc/gpio/gpio_defs.json"

  1. The button interface type name.
  2. An array consists of single or multiple gpio configs associated with the specific button interface.

example gpio def Json config

{ "gpio_definitions": [ { "name": "POWER_BUTTON", "gpio_config" :[ { "pin": "D0", "direction": "both" } ] }, { "name": "RESET_BUTTON", "gpio_config" :[ { "pin": "AB0", "direction": "both" } ] }, { "name" : "HOST_SELECTOR",

        "gpio_config" : [
        {
            "pin": "AA4",
            "direction": "both"
        },
        {
            "pin": "AA5",
            "direction": "both"
        },
        {
            "pin": "AA6",
            "direction": "both"
        },
        {
            "pin": "AA7",
            "direction": "both"
        }
        ]
    },

}