firmware-nucleo/App/Inc/task_buzzer_attribute.h (1336B)
1 /* 2 * Copyright (c) 2026 Martin Javier Klöckner <mklockner@fi.uba.ar> 3 * 4 * See file `LICENSE` for full details 5 */ 6 7 #ifndef TASK_INC_TASK_BUZZER_ATTRIBUTE_H_ 8 #define TASK_INC_TASK_BUZZER_ATTRIBUTE_H_ 9 10 #ifdef __cplusplus 11 extern "C" { 12 #endif 13 14 /* Buzzer Statechart - State Transition Table 15 * 16 * +---------+--------------+---------+-------+---------+ 17 * | Current | Event | | Next | | 18 * | State | (Parameters) | [Guard] | State | Actions | 19 * |=========+==============+=========+=======+=========| 20 * | INICIAL | | | | | 21 * +---------+--------------+---------+-------+---------+ 22 * 23 */ 24 25 typedef enum { 26 EV_BUZ_XX_OFF, 27 EV_BUZ_XX_SHORT_BEEP, 28 EV_BUZ_XX_LONG_BEEP 29 } task_buzzer_ev_t; 30 31 typedef enum { 32 ST_BUZ_XX_OFF, 33 ST_BUZ_XX_ON 34 } task_buzzer_st_t; 35 36 typedef enum { 37 ID_BUZ_A 38 } task_buzzer_id_t; 39 40 typedef struct { 41 task_buzzer_id_t identifier; 42 TIM_HandleTypeDef *htim; 43 uint32_t tim_channel; 44 uint16_t freq; 45 uint32_t short_beep_ms; 46 uint32_t long_beep_ms; 47 } task_buzzer_cfg_t; 48 49 typedef struct { 50 uint32_t tick; 51 task_buzzer_st_t state; 52 task_buzzer_ev_t event; 53 bool event_flag; 54 } task_buzzer_dta_t; 55 56 extern task_buzzer_dta_t task_buzzer_dta_list[]; 57 58 #ifdef __cplusplus 59 } 60 #endif 61 62 #endif /* TASK_INC_TASK_BUZZER_ATTRIBUTE_H_ */
