TMPM4G9  V1.0.0.0
bsp_led.h
Go to the documentation of this file.
1 
13 /*------------------------------------------------------------------------------*/
14 /* Define to prevent recursive inclusion */
15 /*------------------------------------------------------------------------------*/
16 #ifndef __BSP_LED_H
17 #define __BSP_LED_H
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 /*------------------------------------------------------------------------------*/
24 /* Includes */
25 /*------------------------------------------------------------------------------*/
26 #include "txz_sample_def.h"
27 
37 /*------------------------------------------------------------------------------*/
38 /* Macro Function */
39 /*------------------------------------------------------------------------------*/
45 /* no define */
46  /* End of group BSP_UTILITIES_Exported_macro */
50 
51 
52 /*------------------------------------------------------------------------------*/
53 /* Configuration */
54 /*------------------------------------------------------------------------------*/
60 /* no define */
61  /* End of group BSP_UTILITIES_Exported_define */
65 
66 
67 /*------------------------------------------------------------------------------*/
68 /* Macro Definition */
69 /*------------------------------------------------------------------------------*/
75 /* no define */
76 
77  /* End of group BSP_UTILITIES_Exported_define */
81 
82 
83 /*------------------------------------------------------------------------------*/
84 /* Enumerated Type Definition */
85 /*------------------------------------------------------------------------------*/
91 /*----------------------------------*/
95 /*----------------------------------*/
96 typedef enum
97 {
100 } LEDState;
101  /* End of group BSP_UTILITIES_Exported_define */
105 
106 
107 /*------------------------------------------------------------------------------*/
108 /* Structure Definition */
109 /*------------------------------------------------------------------------------*/
114 /*----------------------------------*/
119 /*----------------------------------*/
120 typedef struct
121 {
122  uint32_t id;
123  gpio_t *p_gpio;
124  LEDState state;
125  struct
126  {
127  uint32_t group;
129  uint32_t num;
131  } port;
132  struct
133  {
136  struct
137  {
138  uint32_t on;
139  uint32_t off;
140  } interval;
141  } blink;
143 
144 /*----------------------------------*/
148 /*----------------------------------*/
149 typedef struct
150 {
153  LEDState state;
154  uint32_t counter;
156 
157 /*----------------------------------*/
161 /*----------------------------------*/
162 typedef struct
163 {
166 } led_t; /* End of group BSP_UTILITIES_Exported_define */
170 
171 
172 /*------------------------------------------------------------------------------*/
173 /* Functions */
174 /*------------------------------------------------------------------------------*/
179 void led_initialize(led_t *p_instance);
180 void led_finalize(led_t *p_instance);
181 void led_task(led_t *p_instance);
182 void led_1ms_timer_handler(led_t *p_instance);
183 void led_turn_on(led_t *p_instance);
184 void led_turn_off(led_t *p_instance); /* End of group BSP_UTILITIES_Exported_functions */
188  /* End of group BSP_UTILITIES */
192  /* End of group Example */
196 
197 #ifdef __cplusplus
198 }
199 #endif /* __cplusplus */
200 #endif /* __BSP_LED_H */
201 
void led_turn_on(led_t *p_instance)
Turn on.
Definition: bsp_led.c:329
uint32_t group
Definition: bsp_led.h:127
void led_1ms_timer_handler(led_t *p_instance)
1ms Timer Handler
Definition: bsp_led.c:415
void led_finalize(led_t *p_instance)
Finalize.
Definition: bsp_led.c:228
uint32_t counter
Definition: bsp_led.h:154
TXZ_FunctionalState timer
Definition: bsp_led.h:151
uint32_t id
Definition: bsp_led.h:122
LED Class.
Definition: bsp_led.h:162
Definition: bsp_led.h:99
uint32_t num
Definition: bsp_led.h:129
TXZ_FunctionalState
Definition: txz_driver_def.h:53
LEDState state
Definition: bsp_led.h:124
void led_initialize(led_t *p_instance)
Initialize.
Definition: bsp_led.c:173
void led_task(led_t *p_instance)
Task Processing.
Definition: bsp_led.c:260
Definition: bsp_led.h:98
TXZ_FunctionalState func
Definition: bsp_led.h:134
LEDState state
Definition: bsp_led.h:153
void led_turn_off(led_t *p_instance)
Turn off.
Definition: bsp_led.c:372
Initial setting. User must be set.
Definition: bsp_led.h:120
gpio_t * p_gpio
Definition: bsp_led.h:123
uint32_t on
Definition: bsp_led.h:138
led_initial_setting_t init
Definition: bsp_led.h:164
LEDState
LED state.
Definition: bsp_led.h:96
Private Information.
Definition: bsp_led.h:149
uint32_t off
Definition: bsp_led.h:139
led_private_info_t info
Definition: bsp_led.h:165