4 * Copyright 2004 Develer S.r.l. (http://www.develer.com/)
5 * Copyright 2004 Giovanni Bajo
6 * This file is part of DevLib - See devlib/README for information.
9 * \brief Generic library to handle buzzers and leds
13 * \author Giovanni Bajo <rasky@develer.com>
18 *#* Revision 1.5 2004/08/25 14:12:08 rasky
19 *#* Aggiornato il comment block dei log RCS
21 *#* Revision 1.4 2004/07/30 14:15:53 rasky
22 *#* Nuovo supporto unificato per detect della CPU
24 *#* Revision 1.3 2004/07/14 14:04:29 rasky
25 *#* Merge da SC: spostata bld_set inline perché si ottimizza parecchio tramite propagazione di costanti
27 *#* Revision 1.2 2004/06/03 11:27:09 bernie
28 *#* Add dual-license information.
30 *#* Revision 1.1 2004/05/23 18:36:05 bernie
31 *#* Import buzzerled driver.
35 #ifndef DRV_BUZZERLED_H
36 #define DRV_BUZZERLED_H
40 /*! Include hw.h. We expect hw.h to define enum BLD_DEVICE, which must contain
41 * an enumarator for each device, plus a special symbol NUM_BLDS containing the
47 /* Include hw-level implementation. This allows inlining of bld_set, which in turns
48 * should allow fast constant propagation for the common case (where the parameter
49 * device is a constant).
51 #include CPU_HEADER(buzzerled)
54 /*! Initialize the buzzerled library.
56 * \note This function must be called before any other function in the library.
61 /*! Set or reset a device.
63 * \param device Device to be set
64 * \param enable Enable/disable status
66 #define bld_set(device, enable) bld_hw_set(device, enable)
69 /*! Enable a device for a certain interval of time
71 * \param device Device to be enabled
72 * \param duration Number of milliseconds the device must be enabled
74 * \note This function is non-blocking, so it will return immediately.
76 void bld_beep(enum BLD_DEVICE device, uint16_t duration);
79 /*! Enable a device for a certain interval of time and wait.
81 * \param device Device to be enabled
82 * \param duration Number of milliseconds the device must be enabled
84 * \note This function is blocking, so it will return after the specified period of time.
86 void bld_beep_and_wait(enum BLD_DEVICE device, uint16_t duration);
88 #endif /* DRV_BUZZERLED_H */