TMPM4G9  V1.0.0.0
bsp_sw.h
Go to the documentation of this file.
1 
13 /*------------------------------------------------------------------------------*/
14 /* Define to prevent recursive inclusion */
15 /*------------------------------------------------------------------------------*/
16 #ifndef __BSP_SW_H
17 #define __BSP_SW_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 /* no define */
92  /* End of group BSP_UTILITIES_Exported_define */
96 
97 
98 /*------------------------------------------------------------------------------*/
99 /* Structure Definition */
100 /*------------------------------------------------------------------------------*/
105 /*----------------------------------*/
110 /*----------------------------------*/
111 typedef struct
112 {
113  uint32_t id;
114  gpio_t *p_gpio;
115  struct
116  {
117  uint32_t group;
119  uint32_t num;
121  } port;
122  struct
123  {
126  uint32_t interval;
127  } polling;
128  struct
129  {
130  TXZ_FunctionalState func;
132  uint32_t count;
133  } chattering;
134  void (*handler)(uint32_t id, gpio_pinstate_t state);
136 
137 /*----------------------------------*/
141 /*----------------------------------*/
142 typedef struct
143 {
146  uint32_t counter;
147  struct
148  {
151  uint32_t state;
152  } polling;
153  struct
154  {
155  uint32_t count;
156  } chattering;
158 
159 /*----------------------------------*/
163 /*----------------------------------*/
164 typedef struct
165 {
168 } sw_t; /* End of group BSP_UTILITIES_Exported_define */
172 
173 
174 /*------------------------------------------------------------------------------*/
175 /* Functions */
176 /*------------------------------------------------------------------------------*/
181 void sw_initialize(sw_t *p_instance);
182 void sw_finalize(sw_t *p_instance);
183 void sw_task(sw_t *p_instance);
184 void sw_1ms_timer_handler(sw_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_SW_H */
201 
sw_private_info_t info
Definition: bsp_sw.h:167
void sw_finalize(sw_t *p_instance)
Finalize.
Definition: bsp_sw.c:229
void sw_initialize(sw_t *p_instance)
Initialize.
Definition: bsp_sw.c:197
uint32_t count
Definition: bsp_sw.h:132
uint32_t num
Definition: bsp_sw.h:119
TXZ_FunctionalState
Definition: txz_driver_def.h:53
gpio_pinstate_t
Pin State Reset/Set Enumerated Type Definition.
Definition: txz_gpio.h:75
SW Class.
Definition: bsp_sw.h:164
uint32_t count
Definition: bsp_sw.h:155
Initial setting. User must be set.
Definition: bsp_sw.h:111
uint32_t interval
Definition: bsp_sw.h:126
TXZ_FunctionalState check
Definition: bsp_sw.h:149
TXZ_FunctionalState func
Definition: bsp_sw.h:124
Private Information.
Definition: bsp_sw.h:142
void sw_task(sw_t *p_instance)
Task Processing.
Definition: bsp_sw.c:252
void sw_1ms_timer_handler(sw_t *p_instance)
1ms Timer Handler
Definition: bsp_sw.c:338
uint32_t group
Definition: bsp_sw.h:117
uint32_t state
Definition: bsp_sw.h:151
uint32_t counter
Definition: bsp_sw.h:146
sw_initial_setting_t init
Definition: bsp_sw.h:166
uint32_t id
Definition: bsp_sw.h:113
gpio_t * p_gpio
Definition: bsp_sw.h:114
TXZ_FunctionalState timer
Definition: bsp_sw.h:144