ev3_light.h
Go to the documentation of this file.
1 
2 /* ev3_light.h was generated by yup.py (yupp) 1.0c3
3  out of ev3_light.yu-h
4  */
11 #ifndef EV3_LIGHT_H
12 #define EV3_LIGHT_H
13 
14 #ifdef EV3_LIGHT_IMPLEMENT
15 #define EV3_LIGHT_VAR( decl ) \
16  decl
17 #define EV3_LIGHT_VAR_INIT( decl, ... ) \
18  decl = __VA_ARGS__
19 
20 #define EV3_LIGHT_INL
21 
22 #else /* EV3_LIGHT_IMPLEMENT */
23 #define EV3_LIGHT_VAR( decl ) \
24  extern decl
25 #define EV3_LIGHT_VAR_INIT( decl, ... ) \
26  extern decl
27 
28 #if __GNUC__ && !__GNUC_STDC_INLINE__
29 #define EV3_LIGHT_INL \
30  extern inline
31 #else
32 #define EV3_LIGHT_INL \
33  inline
34 #endif
35 
36 #endif /* EV3_LIGHT_IMPLEMENT */
37 
38 #include <stddef.h>
39 #include <stdint.h>
40 #include <stdbool.h>
41 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
55 enum {
56  LIT_LEFT,
57  LIT_RIGHT,
58 
59  LIT__LOC__
60 };
61 
65 enum {
66  LIT_OFF,
67  LIT_GREEN,
68  LIT_RED,
69  LIT_AMBER,
70 
71  LIT__COL__
72 };
73 
77 EV3_LIGHT_VAR_INIT( const char *const LIT_COLOR[], { "OFF", "GREEN", "RED", "AMBER", STR_unknown_ } );
78 
84 extern const char *light_color( uint8_t col );
85 
91 extern void set_light( uint8_t loc, uint8_t col );
92 
98 extern uint8_t get_light( uint8_t loc );
99 
106 extern void set_light_trigger( uint8_t loc, uint8_t col, uint8_t trigger );
107 
114 extern uint8_t get_light_trigger( uint8_t loc, uint8_t col );
115 
123 extern void set_light_blink( uint8_t loc, uint8_t col, int delay_on, int delay_off );
124 
131 extern bool get_light_blink( uint8_t loc, uint8_t col );
132 
133 #ifdef __cplusplus
134 }
135 #endif
136 
139 #undef EV3_LIGHT_VAR
140 #undef EV3_LIGHT_VAR_INIT
141 #undef EV3_LIGHT_INL
142 #endif
143 
void set_light_blink(uint8_t loc, uint8_t col, int delay_on, int delay_off)
Set the light blink.
Definition: ev3_light.c:85
const char * light_color(uint8_t col)
Get the light color name.
Definition: ev3_light.c:27
EV3_LIGHT_VAR_INIT(const char *const LIT_COLOR[],{"OFF","GREEN","RED","AMBER", STR_unknown_})
Light colors.
void set_light_trigger(uint8_t loc, uint8_t col, uint8_t trigger)
Set the light trigger.
Definition: ev3_light.c:60
bool get_light_blink(uint8_t loc, uint8_t col)
Check the light is blinking.
Definition: ev3_light.c:101
void set_light(uint8_t loc, uint8_t col)
Set the light color.
Definition: ev3_light.c:34
uint8_t get_light(uint8_t loc)
Get the light color.
Definition: ev3_light.c:43
uint8_t get_light_trigger(uint8_t loc, uint8_t col)
Get the light trigger.
Definition: ev3_light.c:68