1ccd7db05SDelphine CC Chiu #pragma once 2*15c60e2fSDelphine CC Chiu #include "config.hpp" 3ccd7db05SDelphine CC Chiu #include "cpld.hpp" 4ccd7db05SDelphine CC Chiu #include "gpio.hpp" 5ccd7db05SDelphine CC Chiu 6ccd7db05SDelphine CC Chiu #include <nlohmann/json.hpp> 7ccd7db05SDelphine CC Chiu 8ccd7db05SDelphine CC Chiu #include <iostream> 9ccd7db05SDelphine CC Chiu 10ccd7db05SDelphine CC Chiu enum class ConfigType 11ccd7db05SDelphine CC Chiu { 12ccd7db05SDelphine CC Chiu gpio, 13ccd7db05SDelphine CC Chiu cpld 14ccd7db05SDelphine CC Chiu }; 15ccd7db05SDelphine CC Chiu 16ccd7db05SDelphine CC Chiu // this struct represents button interface 17ccd7db05SDelphine CC Chiu struct ButtonConfig 18ccd7db05SDelphine CC Chiu { 19ccd7db05SDelphine CC Chiu ConfigType type; 20ccd7db05SDelphine CC Chiu std::string formFactorName; // name of the button interface 21ccd7db05SDelphine CC Chiu std::vector<GpioInfo> gpios; // holds single or group gpio config 22ccd7db05SDelphine CC Chiu CpldInfo cpld; // holds single cpld config 23ccd7db05SDelphine CC Chiu std::vector<int> fds; // store all the fds listen io event which 24ccd7db05SDelphine CC Chiu // mapped with the gpio or cpld 25ccd7db05SDelphine CC Chiu nlohmann::json extraJsonInfo; // corresponding to button interface 26ccd7db05SDelphine CC Chiu }; 27