Add dual-license information.
[bertos.git] / drv / buzzerled.h
1 /*!
2  * \file
3  * <!--
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.
7  * -->
8  *
9  * \brief Generic library to handle buzzers and leds
10  *
11  * \version $Id$
12  *
13  * \author Giovanni Bajo <rasky@develer.com>
14  */
15
16 /*
17  * $Log$
18  * Revision 1.2  2004/06/03 11:27:09  bernie
19  * Add dual-license information.
20  *
21  * Revision 1.1  2004/05/23 18:36:05  bernie
22  * Import buzzerled driver.
23  *
24  */
25
26 #ifndef DRV_BUZZERLED_H
27 #define DRV_BUZZERLED_H
28
29 /*! Include hw.h. We expect hw.h to define enum BLD_DEVICE, which must contain
30  *  an enumarator for each device, plus a special symbol NUM_BLDS containing the
31  *  number of devices.
32  */
33 #include <hw.h>
34
35 /*! Initialize the buzzerled library.
36  *
37  * \note This function must be called before any other function in the library.
38  */
39 void bld_init(void);
40
41 /*! Set or reset a device.
42  *
43  * \param device Device to be set
44  * \param enable Enable/disable status
45  */
46 void bld_set(enum BLD_DEVICE device, bool enable);
47
48 /*! Enable a device for a certain interval of time
49  *
50  * \param device Device to be enabled
51  * \param duration Number of milliseconds the device must be enabled
52  *
53  * \note This function is non-blocking, so it will return immediately.
54  */
55 void bld_beep(enum BLD_DEVICE device, uint16_t duration);
56
57
58 /*! Enable a device for a certain interval of time and wait.
59  *
60  * \param device Device to be enabled
61  * \param duration Number of milliseconds the device must be enabled
62  *
63  * \note This function is blocking, so it will return after the specified period of time.
64  */
65 void bld_beep_and_wait(enum BLD_DEVICE device, uint16_t duration);
66
67 #endif /* DRV_BUZZERLED_H */