ev3_led.h
Go to the documentation of this file.
1 
2 /* ev3_led.h was generated by yup.py (yupp) 1.0c3
3  out of ev3_led.yu-h
4  */
11 #ifndef EV3_LED_H
12 #define EV3_LED_H
13 
14 #ifdef EV3_LED_IMPLEMENT
15 #define EV3_LED_VAR( decl ) \
16  decl
17 #define EV3_LED_VAR_INIT( decl, ... ) \
18  decl = __VA_ARGS__
19 
20 #define EV3_LED_INL
21 
22 #else /* EV3_LED_IMPLEMENT */
23 #define EV3_LED_VAR( decl ) \
24  extern decl
25 #define EV3_LED_VAR_INIT( decl, ... ) \
26  extern decl
27 
28 #if __GNUC__ && !__GNUC_STDC_INLINE__
29 #define EV3_LED_INL \
30  extern inline
31 #else
32 #define EV3_LED_INL \
33  inline
34 #endif
35 
36 #endif /* EV3_LED_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  EV3_LEFT_GREEN,
57  EV3_RIGHT_GREEN,
58  EV3_LEFT_RED,
59  EV3_RIGHT_RED,
60  LED_OUTA,
61  LED_OUTB,
62  LED_OUTC,
63  LED_OUTD,
64 
66 };
67 
71 enum {
72  TRIGGER_NONE,
73  TRIGGER_MMC0,
74  TRIGGER_TIMER,
75  TRIGGER_HEARTBEAT,
76  TRIGGER_DEFAULT_ON,
77  TRIGGER_TRANSIENT,
78  TRIGGER_LEGOEV3_BATTERY_CHARGING_OR_FULL,
79  TRIGGER_LEGOEV3_BATTERY_CHARGING,
80  TRIGGER_LEGOEV3_BATTERY_FULL,
81  TRIGGER_LEGOEV3_BATTERY_CHARGING_BLINK_FULL_SOLID,
82  TRIGGER_RFKILL0,
83  TRIGGER_PHY0RX,
84  TRIGGER_PHY0TX,
85  TRIGGER_PHY0ASSOC,
86  TRIGGER_PHY0RADIO,
87  TRIGGER_RFKILL1,
88 
90 };
91 
92 #define LED_ATTR__COUNT_ 5
93 
101 extern size_t get_led_brightness( uint8_t inx, byte *buf );
102 
109 extern size_t set_led_brightness( uint8_t inx, byte value );
110 
118 extern size_t get_led_delay_off( uint8_t inx, int *buf );
119 
126 extern size_t set_led_delay_off( uint8_t inx, int value );
127 
135 extern size_t get_led_delay_on( uint8_t inx, int *buf );
136 
143 extern size_t set_led_delay_on( uint8_t inx, int value );
144 
152 extern size_t get_led_max_brightness( uint8_t inx, byte *buf );
153 
161 extern size_t get_led_trigger( uint8_t inx, char *buf, size_t sz );
162 
169 extern size_t set_led_trigger( uint8_t inx, char *value );
170 
176 extern INX_T get_led_trigger_inx( uint8_t inx );
177 
184 extern size_t set_led_trigger_inx( uint8_t inx, INX_T trigger_inx );
185 
191 extern const char *ev3_led_trigger( INX_T trigger_inx );
192 
193 #ifdef __cplusplus
194 }
195 #endif
196 
199 #undef EV3_LED_VAR
200 #undef EV3_LED_VAR_INIT
201 #undef EV3_LED_INL
202 #endif
203 
Definition: ev3_led.h:65
size_t set_led_brightness(uint8_t inx, byte value)
Write "brightness" attribute of the LED.
Definition: ev3_led.c:85
size_t get_led_brightness(uint8_t inx, byte *buf)
Read "brightness" attribute of the LED.
Definition: ev3_led.c:78
size_t get_led_delay_on(uint8_t inx, int *buf)
Read "delay_on" attribute of the LED.
Definition: ev3_led.c:106
size_t get_led_trigger(uint8_t inx, char *buf, size_t sz)
Read "trigger" attribute of the LED.
Definition: ev3_led.c:127
const char * ev3_led_trigger(INX_T trigger_inx)
Get name of the specified LED trigger.
Definition: ev3_led.c:141
INX_T get_led_trigger_inx(uint8_t inx)
Read "trigger" attribute of the LED and get the index.
Definition: ev3_led.c:181
size_t get_led_delay_off(uint8_t inx, int *buf)
Read "delay_off" attribute of the LED.
Definition: ev3_led.c:92
size_t set_led_trigger_inx(uint8_t inx, INX_T trigger_inx)
Write "trigger" attribute of the LED by the index.
Definition: ev3_led.c:198
Definition: ev3_led.h:89
size_t get_led_max_brightness(uint8_t inx, byte *buf)
Read "max_brightness" attribute of the LED.
Definition: ev3_led.c:120
size_t set_led_delay_on(uint8_t inx, int value)
Write "delay_on" attribute of the LED.
Definition: ev3_led.c:113
size_t set_led_delay_off(uint8_t inx, int value)
Write "delay_off" attribute of the LED.
Definition: ev3_led.c:99
size_t set_led_trigger(uint8_t inx, char *value)
Write "trigger" attribute of the LED.
Definition: ev3_led.c:134