Delphine CC Chiu | ccd7db0 | 2023-02-09 14:48:53 +0800 | [diff] [blame] | 1 | #pragma once |
Delphine CC Chiu | 15c60e2 | 2024-04-12 13:01:32 -0500 | [diff] [blame] | 2 | #include "config.hpp" |
Delphine CC Chiu | ccd7db0 | 2023-02-09 14:48:53 +0800 | [diff] [blame] | 3 | #include "cpld.hpp" |
| 4 | #include "gpio.hpp" |
| 5 | |
| 6 | #include <nlohmann/json.hpp> |
| 7 | |
| 8 | #include <iostream> |
| 9 | |
| 10 | enum class ConfigType |
| 11 | { |
| 12 | gpio, |
| 13 | cpld |
| 14 | }; |
| 15 | |
| 16 | // this struct represents button interface |
| 17 | struct ButtonConfig |
| 18 | { |
| 19 | ConfigType type; |
| 20 | std::string formFactorName; // name of the button interface |
| 21 | std::vector<GpioInfo> gpios; // holds single or group gpio config |
| 22 | CpldInfo cpld; // holds single cpld config |
| 23 | std::vector<int> fds; // store all the fds listen io event which |
| 24 | // mapped with the gpio or cpld |
| 25 | nlohmann::json extraJsonInfo; // corresponding to button interface |
| 26 | }; |