ADuCM302x Device Drivers API Reference Manual  Release 3.1.2.0
adi_beep.c
1 
46 #include <adi_processor.h>
47 
48 #include <stddef.h>
49 #include <assert.h>
50 
51 #include <drivers/beep/adi_beep.h>
52 #include <rtos_map/adi_rtos_map.h>
53 #include "adi_beep_def.h"
54 
63 #ifdef __ICCARM__
64 /*
65 * IAR MISRA C 2004 error suppressions.
66 *
67 * Pm123 (rule 8.5): there shall be no definition of objects or functions in a header file
68 * This isn't a header as such.
69 *
70 * Pm073 (rule 14.7): a function should have a single point of exit.
71 * Pm143 (rule 14.7): a function should have a single point of exit at the end of the function.
72 * Multiple returns are used for error handling.
73 *
74 * Pm050 (rule 14.2): a null statement shall only occur on a line by itself
75 * Needed for null expansion of ADI_INSTALL_HANDLER and others.
76 *
77 * Pm140 (rule 11.3): a cast should not be performed between a pointer type and an integral type
78 * Required for MMR addresses and callback parameters.
79 *
80 * Pm031: (MISRA C 2004 rule 12.7) bitwise operations shall not be performed on signed integer types
81 * Required for MMR manipulations.
82 *
83 * Pm152: (MISRA C 2004 rule 17.4) array indexing shall only be applied to objects defined as an array type
84 * Required for adi_beep_PlaySequence() to access the user-supplied array of notes.
85 *
86 * Pm141: (MISRA C 2004 rule 11.4) a cast should not be performed between a pointer to object type and a
87 * different pointer to object type, this casts from type.
88 * Required to store a an array of varying size in a device structure.
89 *
90 * Required for adi_beep_PlaySequence() to access the user-supplied array of notes.
91 */
92 #pragma diag_suppress=Pm123,Pm073,Pm143,Pm050,Pm140,Pm031,Pm152,Pm141
93 #endif /* __ICCARM__ */
94 
95 /*========== D A T A ==========*/
96 static ADI_BEEP_DRIVER adi_beep_Device[1];
97 
99 /* Handler for the BEEP interrupt */
100 void Beep_Int_Handler(void);
101 
102 /* debug handle checker */
103 #ifdef ADI_DEBUG
104 #define ADI_BEEP_INVALID_HANDLE(h) (&adi_beep_Device[0] != (h))
105 #endif
106 
107 /* definition for the BEEP IRQ - there is only ever one instance of the
108  * BEEP driver, so reducing space by using a #define rather than including
109  * it in the device structure. */
110 #define BEEP_IRQ (BEEP_EVT_IRQn)
111 
112 #if ADI_BEEP_CFG_SEQUENCE_REPEAT_VALUE == 0
113 /* A single note is requested. Only enable the AEND int. */
114 #define INTERRUPT_ON_SEQEND (0)
115 #define INTERRUPT_ON_AEND (1)
116 #else
117 /* A two-tone sequence is requested. Only enable the SEQEND int. */
118 #define INTERRUPT_ON_SEQEND (1)
119 #define INTERRUPT_ON_AEND (0)
120 #endif
121 
124 static const ADI_BEEP_STATIC_INIT gBeeperStaticConfigData[ADI_BEEP_MAX_DEVID] = {
125  /* single instance of Beeper device */
126  {
127  /* configuration register */
128  ( (INTERRUPT_ON_SEQEND << BITP_BEEP_CFG_SEQATENDIRQ)
129  | (INTERRUPT_ON_AEND << BITP_BEEP_CFG_AENDIRQ)
130  | (ADI_BEEP_CFG_SEQUENCE_REPEAT_VALUE << BITP_BEEP_CFG_SEQREPEAT)
131  ),
132 
133  /* Status register (interrupt clears) */
134  (ADI_BEEP_ALL_INTERRUPTS),
135 
136  /* ToneA control register */
137  ( ((uint32_t)ADI_BEEP_TONEA_DISABLE << BITP_BEEP_TONEA_DIS)
138  | ((uint32_t)ADI_BEEP_TONEA_FREQUENCY << BITP_BEEP_TONEA_FREQ)
139  | ((uint32_t)ADI_BEEP_TONEA_DURATION << BITP_BEEP_TONEA_DUR)
140  ),
141 
142  /* ToneB control register */
143  ( ((uint32_t)ADI_BEEP_TONEB_DISABLE << BITP_BEEP_TONEB_DIS)
144  | ((uint32_t)ADI_BEEP_TONEB_FREQUENCY << BITP_BEEP_TONEB_FREQ)
145  | ((uint32_t)ADI_BEEP_TONEB_DURATION << BITP_BEEP_TONEB_DUR)
146  )
147  }
148 };
149 
192  void* const pMemory,
193  uint32_t const MemorySize,
194  ADI_BEEP_HANDLE* const phDevice)
195 {
196  ADI_BEEP_DRIVER *pDevice;
197  ADI_BEEP_DEV_DATA *pData;
198  /* store a bad handle in case of failure */
199  *phDevice = (ADI_BEEP_HANDLE) NULL;
200 
201 #ifdef ADI_DEBUG
202  if (DeviceNum >= ADI_BEEP_MAX_DEVID)
203  {
204  return ADI_BEEP_BAD_DEV_ID;
205  }
206 
207  if (pMemory == NULL)
208  {
209  return ADI_BEEP_NULL_PTR;
210  }
211 
212  assert (MemorySize >= sizeof(ADI_BEEP_DRIVER));
213 #endif
214 
215  /* local pointer to instance data */
216  pDevice = &adi_beep_Device[DeviceNum];
217  pDevice->pReg = pADI_BEEP0;
218  pDevice->pData = (ADI_BEEP_DEV_DATA*)pMemory;
219  pData = pDevice->pData;
220 
221 #ifdef ADI_DEBUG
222  if (ADI_BEEP_STATE_UNINITIALIZED != adi_beep_Device[DeviceNum].pData->state)
223  {
225  }
226 #endif
227 
228  pData->cbFunc = NULL;
229  pData->cbParam = NULL;
230  SEM_CREATE(pDevice->pData, "BEEP_SEM", ADI_BEEP_SEMAPHORE_FAILED);
231 
232  /* set statically configured initialization data */
233  ADI_BEEP_STATIC_INIT const* pInitData = &gBeeperStaticConfigData[DeviceNum];
234  ADI_BEEP_TypeDef *pReg = pDevice->pReg;
235 
236  pReg->CFG = pInitData->BEEP_CFG;
237  pReg->STAT = pInitData->BEEP_STAT;
238  pReg->TONEA = pInitData->BEEP_TONEA;
239  pReg->TONEB = pInitData->BEEP_TONEB;
240 
241  /* enable beeper interrupts in NVIC */
242  NVIC_EnableIRQ(BEEP_IRQ);
243 
244  /* mark driver initialized */
245  pData->state = ADI_BEEP_STATE_INITIALIZED;
246 
247  /* store handle at application handle pointer */
248  *phDevice = (ADI_BEEP_HANDLE)pDevice;
249 
250  return ADI_BEEP_SUCCESS; /* initialized */
251 }
252 
253 
269 {
270 
271  ADI_BEEP_DRIVER *pDevice;
272  ADI_BEEP_DEV_DATA *pData;
273  ADI_BEEP_TypeDef *pReg;
274 
275  pDevice = (ADI_BEEP_DRIVER*)hDevice;
276  pData = pDevice->pData;
277  pReg = pDevice->pReg;
278 
279 #ifdef ADI_DEBUG
280  if (ADI_BEEP_INVALID_HANDLE(hDevice))
281  {
283  }
284  if (ADI_BEEP_STATE_UNINITIALIZED == pData->state)
285  {
287  }
288 #endif
289 
290  /* uninitialize */
291  NVIC_DisableIRQ(BEEP_IRQ);
292 
293  pData->state = ADI_BEEP_STATE_UNINITIALIZED;
294  pData->cbFunc = NULL;
295  pReg->CFG = 0u;
296  pReg->STAT = 0u;
297  pReg->TONEA = 0u;
298  pReg->TONEB = 0u;
299  SEM_DELETE(pDevice->pData, ADI_BEEP_SEMAPHORE_FAILED);
300  return ADI_BEEP_SUCCESS;
301 }
302 
324  ADI_CALLBACK pfCallback,
325  void* const pCBParam)
326 {
327  ADI_BEEP_DRIVER *pDevice = (ADI_BEEP_DRIVER*)hDevice;
328 
329  ADI_INT_STATUS_ALLOC();
330 
331 #ifdef ADI_DEBUG
332  if (ADI_BEEP_INVALID_HANDLE(hDevice)) {
334  }
335 
336  if (ADI_BEEP_STATE_UNINITIALIZED == pDevice->pData->state) {
338  }
339 #endif
340  /* Assign the callback within a critical region. */
341  ADI_ENTER_CRITICAL_REGION();
342  pDevice->pData->cbFunc = pfCallback;
343  pDevice->pData->cbParam = pCBParam;
344  ADI_EXIT_CRITICAL_REGION();
345 
346  return ADI_BEEP_SUCCESS;
347 }
348 
349 
350 #if ADI_BEEP_INCLUDE_PLAY_SEQUENCE == 1
351 
376  ADI_BEEP_NOTE aSequence[],
377  uint8_t count)
378 {
379  ADI_BEEP_DRIVER *pDevice = (ADI_BEEP_DRIVER*)hDevice;
380  ADI_BEEP_TypeDef *pReg = pDevice->pReg;
381  uint16_t nSeqCnt = 0u;
382 
383  ADI_INT_STATUS_ALLOC();
384 
385 #ifdef ADI_DEBUG
386  if (ADI_BEEP_INVALID_HANDLE(hDevice)) {
388  }
389 
390  if (ADI_BEEP_STATE_UNINITIALIZED == pDevice->pData->state) {
392  }
393 
394  if (NULL == aSequence) {
395  return ADI_BEEP_NULL_PTR;
396  }
397 
398  /* The sequence count must be a multiple of two, be greater than 1
399  * and must be a maximum of (127 * 2) notes in length. The hardware supports a
400  * sequence of up to 127, and there are two notes associated with that. */
401  if (((127u * 2u) < count) ||
402  ((count % 2u) != 0u) ||
403  (count < 2u)) {
404  return ADI_BEEP_INVALID_COUNT;
405  }
406 #endif
407 
408  /* Two notes are loaded at a time, and the sequence count refers to
409  * the number of times that both tone registers should be played. */
410  nSeqCnt = ((uint16_t)count) >> 1u;
411 
412  ADI_ENTER_CRITICAL_REGION();
413 
414  /* make a hole, and disable the beeper */
415  pReg->CFG &= (uint16_t)~(BITM_BEEP_CFG_SEQREPEAT | BITM_BEEP_CFG_AENDIRQ | BITM_BEEP_CFG_EN);
416 
417  pReg->TONEA = ( (uint16_t)((uint16_t)aSequence[0].frequency << ADI_BEEP_TONE_FREQ_BITPOS)
418  |(uint16_t)((uint16_t)aSequence[0].duration << ADI_BEEP_TONE_DUR_BITPOS) );
419 
420  pReg->TONEB = ( (uint16_t)((uint16_t)aSequence[1].frequency << ADI_BEEP_TONE_FREQ_BITPOS)
421  |(uint16_t)((uint16_t)aSequence[1].duration << ADI_BEEP_TONE_DUR_BITPOS) );
422 
423 
424  /* program new sequence count, while preserving everything else */
425  pReg->CFG |= (BITM_BEEP_CFG_EN |
426  BITM_BEEP_CFG_BSTARTIRQ |
427  BITM_BEEP_CFG_SEQATENDIRQ |
428  (uint16_t)((uint16_t)(nSeqCnt) << BITP_BEEP_CFG_SEQREPEAT));
429 
430  pDevice->pData->pSeqArray = (ADI_BEEP_NOTE(*)[])aSequence;
431  pDevice->pData->nSeqMax = count;
432  pDevice->pData->nSeqIndex = 2u;
433 
434  /* We're now playing, but not blocked */
435  pDevice->pData->state |= (ADI_BEEP_STATE_PLAYING);
436 
437  ADI_EXIT_CRITICAL_REGION();
438 
439  return ADI_BEEP_SUCCESS;
440 }
441 #endif
442 
459  ADI_BEEP_NOTE note)
460 {
461  ADI_BEEP_DRIVER *pDevice;
462  ADI_BEEP_TypeDef *pReg;
463  ADI_INT_STATUS_ALLOC();
464 
465  pDevice = (ADI_BEEP_DRIVER*)hDevice;
466  pReg = pDevice->pReg;
467 
468 #ifdef ADI_DEBUG
469  if (ADI_BEEP_INVALID_HANDLE(hDevice)) {
471  }
472 
473  if (ADI_BEEP_STATE_UNINITIALIZED == pDevice->pData->state) {
475  }
476 #endif
477 
478  ADI_ENTER_CRITICAL_REGION();
479 
480  /* Clear any previous sequence setup, and disable the beeper */
481  pReg->CFG &= (uint16_t)~(BITM_BEEP_CFG_SEQREPEAT | BITM_BEEP_CFG_EN);
482 
483  /* Set Tone A */
484  pReg->TONEA = ( (uint16_t)((uint16_t)note.frequency << ADI_BEEP_TONE_FREQ_BITPOS)
485  |(uint16_t)((uint16_t)note.duration << ADI_BEEP_TONE_DUR_BITPOS) );
486 
487  /* program new sequence count, while preserving everything else */
488  pReg->CFG |= (BITM_BEEP_CFG_EN | BITM_BEEP_CFG_AENDIRQ);
489 
490  /* We're now playing but not blocked */
491  pDevice->pData->state |= (ADI_BEEP_STATE_PLAYING);
492  ADI_EXIT_CRITICAL_REGION();
493 
494  return ADI_BEEP_SUCCESS;
495 }
496 
497 
522  ADI_BEEP_NOTE noteA,
523  ADI_BEEP_NOTE noteB,
524  uint8_t count)
525 {
526  ADI_BEEP_DRIVER *pDevice;
527  ADI_BEEP_TypeDef *pReg;
528  ADI_INT_STATUS_ALLOC();
529 
530  pDevice = (ADI_BEEP_DRIVER*)hDevice;
531  pReg = pDevice->pReg;
532 
533 #ifdef ADI_DEBUG
534  if (ADI_BEEP_INVALID_HANDLE(hDevice)) {
536  }
537 
538  if (ADI_BEEP_STATE_UNINITIALIZED == pDevice->pData->state) {
540  }
541 #endif
542 
543  ADI_ENTER_CRITICAL_REGION();
544 
545  /* make a hole, and disable the beeper */
546  pReg->CFG &= (uint16_t)~(BITM_BEEP_CFG_SEQREPEAT | BITM_BEEP_CFG_AENDIRQ |BITM_BEEP_CFG_EN);
547 
548  pReg->TONEA = ( (uint16_t)((uint16_t)noteA.frequency << ADI_BEEP_TONE_FREQ_BITPOS)
549  |(uint16_t)((uint16_t)noteA.duration << ADI_BEEP_TONE_DUR_BITPOS) );
550 
551  pReg->TONEB = ( (uint16_t)((uint16_t)noteB.frequency << ADI_BEEP_TONE_FREQ_BITPOS)
552  |(uint16_t)((uint16_t)noteB.duration << ADI_BEEP_TONE_DUR_BITPOS) );
553 
554  /* program new sequence count, while preserving everything else */
555  pReg->CFG |= (BITM_BEEP_CFG_EN | BITM_BEEP_CFG_SEQATENDIRQ |(uint16_t)((uint16_t)count << BITP_BEEP_CFG_SEQREPEAT));
556 
557  /* We're now playing but not blocked */
558  pDevice->pData->state |= (ADI_BEEP_STATE_PLAYING);
559  ADI_EXIT_CRITICAL_REGION();
560 
561  return ADI_BEEP_SUCCESS;
562 }
563 
582 ADI_BEEP_RESULT adi_beep_Enable(ADI_BEEP_HANDLE const hDevice, bool const bFlag)
583 {
584  ADI_BEEP_DRIVER *pDevice;
585  ADI_BEEP_TypeDef *pReg;
586  ADI_INT_STATUS_ALLOC();
587 
588  pDevice = (ADI_BEEP_DRIVER*)hDevice;
589  pReg = pDevice->pReg;
590 
591 #ifdef ADI_DEBUG
592  if (ADI_BEEP_INVALID_HANDLE(hDevice)) {
594  }
595 
596  if (ADI_BEEP_STATE_UNINITIALIZED == pDevice->pData->state) {
598  }
599 #endif
600 
601  ADI_ENTER_CRITICAL_REGION();
602 
603  if (bFlag == true) {
604  /* All the registers should already be set - just enable the beep */
605  pReg->CFG |= BITM_BEEP_CFG_EN;
606  pDevice->pData->state |= (ADI_BEEP_STATE_PLAYING);
607  }
608  else {
609  pReg->CFG &= (uint16_t)~(BITM_BEEP_CFG_EN);
610  pDevice->pData->state &= ~(ADI_BEEP_STATE_PLAYING);
611  }
612 
613  ADI_EXIT_CRITICAL_REGION();
614 
615  return ADI_BEEP_SUCCESS;
616 }
617 
634 {
635  ADI_BEEP_DRIVER *pDevice;
636  bool wait = false;
637  ADI_INT_STATUS_ALLOC();
638 
639  pDevice = (ADI_BEEP_DRIVER*)hDevice;
640 
641 #ifdef ADI_DEBUG
642  if (ADI_BEEP_INVALID_HANDLE(hDevice)) {
644  }
645 
646  if (ADI_BEEP_STATE_UNINITIALIZED == pDevice->pData->state) {
648  }
649 #endif
650 
651  ADI_ENTER_CRITICAL_REGION();
652 
653  if((pDevice->pData->state | ADI_BEEP_STATE_PLAYING) > 0u) {
654  /* We are going to pend on the semaphore, no matter what. */
655  pDevice->pData->state |= ADI_BEEP_STATE_BLOCKED;
656  wait = true;
657  }
658 
659  ADI_EXIT_CRITICAL_REGION();
660 
661  if(wait == true) {
662  /* Wait for the completion interrupt to post */
663  SEM_PEND(pDevice->pData, ADI_BEEP_SEMAPHORE_FAILED);
664  }
665 
666  return ADI_BEEP_SUCCESS;
667 }
668 
673 void Beep_Int_Handler(void)
674 {
675  ISR_PROLOG();
676 #if ADI_BEEP_INCLUDE_PLAY_SEQUENCE == 1
677  ADI_BEEP_DEV_DATA *pData;
678  ADI_BEEP_NOTE noteA, noteB;
679 #endif
680  ADI_BEEP_DRIVER *pDevice = &adi_beep_Device[ADI_BEEP_DEVID_0]; /* so far, there is only one BEEP, so this is safe */
681  ADI_BEEP_TypeDef *pReg = pDevice->pReg;
682  uint16_t fired = ADI_BEEP_ALL_INTERRUPTS;
683  register uint16_t candidate;
684 
685  /* Make sure our driver is up and running. */
686  if (ADI_BEEP_STATE_UNINITIALIZED != pDevice->pData->state) {
687 
688  /* read both status and mask registers */
689  candidate = pReg->CFG & ADI_BEEP_ALL_INTERRUPTS; /* Take the fired interrupts */
690  fired = candidate; /* ...and a copy. */
691  candidate = candidate & pReg->STAT; /* ...and remove the unused set interrupt bits */
692 
693  /* From this driver's perspective, there are only two states
694  * to watch for - finished playing, or continuing the playing sequence.
695  * Finished will be handled here. */
696  if((candidate & (BITM_BEEP_CFG_SEQATENDIRQ | BITM_BEEP_CFG_AENDIRQ)) > 0u) {
697 
698  /* If we are blocked, unblock by posting the semaphore */
699  if((pDevice->pData->state | ADI_BEEP_STATE_BLOCKED) > 0u) {
700  SEM_POST(pDevice->pData);
701  }
702 
703  /* Reset the device playing status. */
704  pDevice->pData->state &= ~(ADI_BEEP_STATE_PLAYING | ADI_BEEP_STATE_BLOCKED);
705 
706  /* ...and disable the device. */
707  pReg->CFG &= (uint16_t)(~(BITM_BEEP_CFG_EN));
708 
709  /* forward the interrupt to the user if they are watching it and it has fired */
710  /* pass the interrupt as the event. */
711  if (pDevice->pData->cbFunc != NULL) {
712  pDevice->pData->cbFunc (pDevice->pData->cbParam, (uint32_t)candidate, NULL);
713  }
714  }
715 
716  #if ADI_BEEP_INCLUDE_PLAY_SEQUENCE == 1
717  /* The second state is if we are playing a longer sequence, so this
718  * interrupt may be to move the sequence along. */
719  if ((BITM_BEEP_CFG_BSTARTIRQ & candidate) != 0u) {
720 
721  /* Get a local copy of data, to shorten the following code. */
722  pData = pDevice->pData;
723 
724  /* If there's still data to play */
725  if(pData->nSeqIndex < pData->nSeqMax) {
726  /* Move the sequence along.*/
727  noteA = (*pData->pSeqArray)[pData->nSeqIndex];
728  pData->nSeqIndex++;
729  noteB = (*pData->pSeqArray)[pData->nSeqIndex];
730  pData->nSeqIndex++;
731 
732  /* Any values written will not impact the current tones,
733  * they will take effect after the current tone is completed */
734  pReg->TONEA = ( (uint16_t)((uint16_t)noteA.frequency << ADI_BEEP_TONE_FREQ_BITPOS)
735  | (uint16_t)((uint16_t)noteA.duration << ADI_BEEP_TONE_DUR_BITPOS) );
736 
737  pReg->TONEB = ( (uint16_t)((uint16_t)noteB.frequency << ADI_BEEP_TONE_FREQ_BITPOS)
738  | (uint16_t)((uint16_t)noteB.duration << ADI_BEEP_TONE_DUR_BITPOS) );
739  }
740  }
741 #endif
742  }
743 
744  /* clear the watched interrupt(s) that fired */
745  pReg->STAT |= (uint16_t)(fired & ADI_BEEP_ALL_INTERRUPTS); /* only write allowed interrupt bits */
746  ISR_EPILOG();
747 }
751 
752 
753 
ADI_BEEP_RESULT adi_beep_PlayNote(ADI_BEEP_HANDLE const hDevice, ADI_BEEP_NOTE note)
Play a single note/beep.
Definition: adi_beep.c:458
ADI_BEEP_RESULT
Definition: adi_beep.h:76
ADI_BEEP_RESULT adi_beep_Open(ADI_BEEP_DEV_ID const DeviceNum, void *const pMemory, uint32_t const MemorySize, ADI_BEEP_HANDLE *const phDevice)
BEEP Initialization.
Definition: adi_beep.c:191
ADI_BEEP_NOTE_FREQUENCY frequency
Definition: adi_beep.h:235
#define ADI_BEEP_TONEB_FREQUENCY
ADI_BEEP_NOTE_DURATION duration
Definition: adi_beep.h:236
#define ADI_BEEP_TONEA_DURATION
ADI_BEEP_RESULT adi_beep_PlaySequence(ADI_BEEP_HANDLE const hDevice, ADI_BEEP_NOTE aSequence[], uint8_t count)
Play a beeper tone sequence.
Definition: adi_beep.c:375
#define ADI_BEEP_TONEB_DURATION
ADI_BEEP_RESULT adi_beep_PlayTwoTone(ADI_BEEP_HANDLE const hDevice, ADI_BEEP_NOTE noteA, ADI_BEEP_NOTE noteB, uint8_t count)
Play a a repeating two-tone beep. Similar to an alarm.
Definition: adi_beep.c:521
#define ADI_BEEP_CFG_SEQUENCE_REPEAT_VALUE
ADI_BEEP_RESULT adi_beep_Wait(ADI_BEEP_HANDLE const hDevice)
Wait for the current playback to finish. This is a blocking call, that will not return until the curr...
Definition: adi_beep.c:633
void * ADI_BEEP_HANDLE
Definition: adi_beep.h:205
ADI_BEEP_RESULT adi_beep_Close(ADI_BEEP_HANDLE const hDevice)
Uninitialize and deallocate a BEEP device.
Definition: adi_beep.c:268
ADI_BEEP_RESULT adi_beep_RegisterCallback(ADI_BEEP_HANDLE const hDevice, ADI_CALLBACK pfCallback, void *const pCBParam)
Register a callback for the beeper driver.
Definition: adi_beep.c:323
ADI_BEEP_DEV_ID
Beeper Device IDs.
Definition: adi_beep.h:97
#define ADI_BEEP_TONEA_FREQUENCY
#define ADI_BEEP_TONEA_DISABLE
ADI_BEEP_RESULT adi_beep_Enable(ADI_BEEP_HANDLE const hDevice, bool const bFlag)
Enable or disable the beeper. Other APIs will automatically enable the beeper if required, so this function is best used in the following situations:
Definition: adi_beep.c:582
Beeper note structure.
Definition: adi_beep.h:234
#define ADI_BEEP_TONEB_DISABLE