blob: 998feb5f8d5da52a38726ecd32a6e81bdd1f590d [file] [log] [blame]
Vishwanatha Subbannaed490732016-12-20 15:59:29 +05301#pragma once
2
3#include <map>
4#include <set>
5namespace phosphor
6{
7namespace led
8{
9/** @namespace Layout
10 * @brief Depicts the LED and their mappings and group actions
11 */
12namespace Layout
13{
14 /** @brief Define possible actions on a given LED.
15 * For the BLINK operation, follow 50-50 duty cycle
16 */
17 enum Action
18 {
19 Off,
20 On,
21 Blink,
22 };
23
24 /** @brief Name of the LED and it's proposed action.
25 * This structure is supplied as configuration at build time
26 */
27 struct LedAction
28 {
29 std::string name;
30 Action action;
Vishwanatha Subbanna8a50a502017-01-20 18:42:21 +053031 uint8_t dutyOn;
32 uint16_t period;
Vishwanatha Subbannaed490732016-12-20 15:59:29 +053033
34 // Needed for inserting elements into sets
35 bool operator<(const LedAction& right) const
36 {
37 if (name == right.name)
38 {
39 return action < right.action;
40 }
41 return name < right.name;
42 }
43 };
44} // namespace Layout
45} // namespace led
46} // namespace phosphor