ADuCM302x Device Drivers API Reference Manual  Release 3.1.2.0
adi_beep_def.h
1 
46 #ifndef _ADI_BEEP_DEF_H_
47 #define _ADI_BEEP_DEF_H_
48 
50 #include <drivers/beep/adi_beep.h>
51 
56 #define ADI_BEEP_ALL_INTERRUPTS ( BITM_BEEP_CFG_SEQATENDIRQ \
57  | BITM_BEEP_CFG_SEQNEARENDIRQ \
58  | BITM_BEEP_CFG_BENDIRQ \
59  | BITM_BEEP_CFG_BSTARTIRQ \
60  | BITM_BEEP_CFG_AENDIRQ \
61  | BITM_BEEP_CFG_ASTARTIRQ)
62 
63 #define ADI_BEEP_TONE_DISABLE (BITM_BEEP_TONEA_DIS)
65 #define ADI_BEEP_TONE_FREQ_BITPOS (BITP_BEEP_TONEA_FREQ)
66 #define ADI_BEEP_TONE_DUR_BITPOS (BITP_BEEP_TONEA_DUR)
68 #define ADI_BEEP_TONE_FREQ_MASK (BITM_BEEP_TONEA_FREQ)
69 #define ADI_BEEP_TONE_DUR_MASK (BITM_BEEP_TONEA_DUR)
80 typedef uint8_t ADI_BEEP_STATE;
81 #define ADI_BEEP_STATE_UNINITIALIZED 0u
82 #define ADI_BEEP_STATE_INITIALIZED (1u << 1u)
83 #define ADI_BEEP_STATE_PLAYING (1u << 2u)
84 #define ADI_BEEP_STATE_BLOCKED (1u << 3u)
90 typedef struct _ADI_BEEP_DEV_DATA
91 {
92  volatile ADI_BEEP_STATE state;
93  ADI_CALLBACK cbFunc;
94  void *cbParam;
95 #if ADI_BEEP_INCLUDE_PLAY_SEQUENCE == 1
96  ADI_BEEP_NOTE (*pSeqArray)[];
97  volatile uint8_t nSeqIndex;
98  uint8_t nSeqMax;
99 #endif
100  SEM_VAR_DECLR
101 } ADI_BEEP_DEV_DATA;
102 
103 
107 typedef struct _ADI_BEEP_DRIVER_STRUCT
108 {
109  ADI_BEEP_TypeDef *pReg;
110  ADI_BEEP_DEV_DATA *pData;
111 } ADI_BEEP_DRIVER_STRUCT;
112 
116 typedef struct {
117  uint16_t BEEP_CFG;
118  uint16_t BEEP_STAT;
119  uint16_t BEEP_TONEA;
120  uint16_t BEEP_TONEB;
121 } ADI_BEEP_STATIC_INIT;
122 
123 /* alias for the actual device structure */
124 typedef ADI_BEEP_DRIVER_STRUCT ADI_BEEP_DRIVER;
125 
128 #endif /* _ADI_BEEP_DEF_H_ */
Beeper note structure.
Definition: adi_beep.h:234