ADuCM4x50 Device Drivers API Reference Manual  Release 4.0.0.0
adi_beep_def.h
1 
13 #ifndef _ADI_BEEP_DEF_H_
14 #define _ADI_BEEP_DEF_H_
15 
17 #include <drivers/beep/adi_beep.h>
18 
23 #define ADI_BEEP_ALL_INTERRUPTS ( BITM_BEEP_CFG_SEQATENDIRQ \
24  | BITM_BEEP_CFG_SEQNEARENDIRQ \
25  | BITM_BEEP_CFG_BENDIRQ \
26  | BITM_BEEP_CFG_BSTARTIRQ \
27  | BITM_BEEP_CFG_AENDIRQ \
28  | BITM_BEEP_CFG_ASTARTIRQ)
29 
30 #define ADI_BEEP_TONE_DISABLE (BITM_BEEP_TONEA_DIS)
32 #define ADI_BEEP_TONE_FREQ_BITPOS (BITP_BEEP_TONEA_FREQ)
33 #define ADI_BEEP_TONE_DUR_BITPOS (BITP_BEEP_TONEA_DUR)
35 #define ADI_BEEP_TONE_FREQ_MASK (BITM_BEEP_TONEA_FREQ)
36 #define ADI_BEEP_TONE_DUR_MASK (BITM_BEEP_TONEA_DUR)
47 typedef uint8_t ADI_BEEP_STATE;
48 #define ADI_BEEP_STATE_UNINITIALIZED 0u
49 #define ADI_BEEP_STATE_INITIALIZED (1u << 1u)
50 #define ADI_BEEP_STATE_PLAYING (1u << 2u)
51 #define ADI_BEEP_STATE_BLOCKED (1u << 3u)
57 typedef struct _ADI_BEEP_DEV_DATA
58 {
59  volatile ADI_BEEP_STATE state;
60  ADI_CALLBACK cbFunc;
61  void *cbParam;
62 #if ADI_BEEP_INCLUDE_PLAY_SEQUENCE == 1
63  ADI_BEEP_NOTE (*pSeqArray)[];
64  volatile uint8_t nSeqIndex;
65  uint8_t nSeqMax;
66 #endif
67  SEM_VAR_DECLR
68 } ADI_BEEP_DEV_DATA;
69 
70 
74 typedef struct _ADI_BEEP_DRIVER_STRUCT
75 {
76  ADI_BEEP_TypeDef *pReg;
77  ADI_BEEP_DEV_DATA *pData;
78 } ADI_BEEP_DRIVER_STRUCT;
79 
83 typedef struct {
84  uint16_t BEEP_CFG;
85  uint16_t BEEP_STAT;
86  uint16_t BEEP_TONEA;
87  uint16_t BEEP_TONEB;
88 } ADI_BEEP_STATIC_INIT;
89 
90 /* alias for the actual device structure */
91 typedef ADI_BEEP_DRIVER_STRUCT ADI_BEEP_DRIVER;
92 
95 #endif /* _ADI_BEEP_DEF_H_ */
Beeper note structure.
Definition: adi_beep.h:203