AceUtils  0.6.0
Useful Arduino utilties which are too small as separate libraries, but complex enough to be shared among multiple projects, and often have external dependencies to other libraries.
ModeGroup.h
1 #ifndef ACE_UTILS_MODE_GROUP_MODE_GROUP_H
2 #define ACE_UTILS_MODE_GROUP_MODE_GROUP_H
3 
4 namespace ace_utils {
5 namespace mode_group {
6 
8 const uint8_t kModeUnknown = 0;
9 
10 struct ModeGroup;
11 
13 struct ModeRecord {
15  uint8_t const modeId;
16 
18  const ModeGroup* const childGroup;
19 };
20 
31 struct ModeGroup {
33  const ModeGroup* const parentGroup;
34 
36  uint8_t const numModes;
37 
39  const ModeRecord* const children;
40 };
41 
43 struct ModeIterator {
44  const ModeGroup* group;
45  uint8_t recordIndex;
46 };
47 
48 } // mode_group
49 } // ace_utils
50 
51 #endif
A data structure that captures the group of sibliing clock modes which can be cycled through using th...
Definition: ModeGroup.h:31
const ModeRecord *const children
Array of children mode groups.
Definition: ModeGroup.h:39
uint8_t const numModes
Number of modes.
Definition: ModeGroup.h:36
const ModeGroup *const parentGroup
Pointer to the parent ModeGroup.
Definition: ModeGroup.h:33
Point to the current Mode.
Definition: ModeGroup.h:43
A record of a child of a ModeGroup.
Definition: ModeGroup.h:13
uint8_t const modeId
Unique integer identifier of the mode.
Definition: ModeGroup.h:15
const ModeGroup *const childGroup
ModeGroup containing children ModeRecords.
Definition: ModeGroup.h:18