EVE 1.0
beeper.h
Go to the documentation of this file.
1 #ifndef DRIVER_BEEPER_H
2 #define DRIVER_BEEPER_H
3 /**********************************************************************/
4 /*
5  * Copyright (c) 2015, Jetro AS
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without modification,
9  * are permitted provided that the following conditions are met:
10  *
11  * 1. Redistributions of source code must retain the above copyright notice,
12  * this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright notice,
14  * this list of conditions and the following disclaimer in the documentation
15  * and/or other materials provided with the distribution.
16  * 3. The name of the author may not be used to endorse or promote products
17  * derived from this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONRIBUTORS ``AS IS'' AND ANY EXPRESS
20  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
22  * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
24  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
27  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
28  * OF SUCH DAMAGE.
29  *
30  * This file is part of the EVE platform.
31  */
32 
33 /**
34  * \file
35  * @brief Driver for Beeper
36  *
37  * @author AMO, Jetro AS
38  */ /******************************************************************/
39 
40 /**
41  * \defgroup beeper Beeper
42  * \ingroup extdrv
43  * \{
44  *
45  * This driver supports beeper generation/timing.
46  * Functionality included if BEEPER_ENABLED is set true:
47  * - Generates one beeper pulse with a given time
48  * - Generates repeated beeper pulses with given on and off times
49  * - Stops beeper
50  * - Generates one short beeper pulse (beeper click)
51  *
52  * If beeper click functions is wanted, BEEPER_CLICK_ENABLED must be set true.
53  * Beeper click pulse time is set by BEEPER_CLICK_TIME.
54  * Output code or output function for beeper is based on the inline code BeepeOn().
55  *
56  */
57 
58 /**
59  * @name Functions called from application programs
60  * @{
61  */
62 
63 /**********************************************************************/
64 /**
65  * @brief Name: BeeperPulse\n
66  * Start generation of one beeper pulse.
67  *
68  * @param OnTime Pulse time. Resolution 1/1.024 ms, use MWORK_MSEC()
69  ***********************************************************************/
70 extern void BeeperPulse(uint16_t OnTime);
71 
72 /**********************************************************************/
73 /**
74  * @brief Name: BeeperRepeat\n
75  * Start generation of repeated beeper pulses.
76  *
77  * @param OnTime Pulse time. Resolution 1/1.024 ms, use MWORK_MSEC()
78  * @param OffTime Pause time. Resolution 1/1.024 ms, use MWORK_MSEC()
79  ***********************************************************************/
80 extern void BeeperRepeat(uint16_t OnTime, uint32_t OffTime);
81 
82 /**********************************************************************/
83 /**
84  * @brief Name: BeeperStop\n
85  * Stop generation of beeper pulse or repeated beeper pulses.
86  * This function will not stop beeper click.
87  ***********************************************************************/
88 extern void BeeperStop(void);
89 
90 /**********************************************************************/
91 /**
92  * @brief Name: BeeperClick\n
93  * Start generation of a short beeper click of duration BEEPER_CLICK_TIME.
94  * This function will not stop ongoing beeper pulse or repeated beeper pulses.
95  * This sound can be used as a response of a key pressed action.
96  ***********************************************************************/
97 extern void BeeperClick(void);
98 
99 /** \} */
100 
101 /** \} */
102 
103 #endif // DRIVER_BEEPER_H
void BeeperRepeat(uint16_t OnTime, uint32_t OffTime)
Name: BeeperRepeat Start generation of repeated beeper pulses.
void BeeperClick(void)
Name: BeeperClick Start generation of a short beeper click of duration BEEPER_CLICK_TIME. This function will not stop ongoing beeper pulse or repeated beeper pulses. This sound can be used as a response of a key pressed action.
void BeeperStop(void)
Name: BeeperStop Stop generation of beeper pulse or repeated beeper pulses. This function will not st...
void BeeperPulse(uint16_t OnTime)
Name: BeeperPulse Start generation of one beeper pulse.