Revision 891
Moved comments to headers. That was painful.
buzzer.h | ||
---|---|---|
38 | 38 |
#define _BUZZER_H_ |
39 | 39 |
|
40 | 40 |
/** |
41 |
* @addtogroup buzzer |
|
41 |
* @defgroup buzzer Buzzer |
|
42 |
* @brief Functions for controlling the buzzer. |
|
43 |
* Functions for controlling the buzzer. Include |
|
44 |
* buzzer.h to access these functions. |
|
42 | 45 |
* @{ |
43 | 46 |
**/ |
44 | 47 |
|
... | ... | |
71 | 74 |
/** @brief C **/ |
72 | 75 |
#define C5 523 |
73 | 76 |
|
74 |
/** @brief Initialize the buzzer. **/ |
|
77 |
/** |
|
78 |
* @brief Initialize the buzzer. |
|
79 |
* |
|
80 |
* Initializes the buzzer. Must be called before any other buzzer |
|
81 |
* function may be used. |
|
82 |
**/ |
|
75 | 83 |
void buzzer_init(void); |
76 |
/** @brief Set the value the buzzer plays. **/ |
|
84 |
/** |
|
85 |
* @brief Set the value the buzzer plays. |
|
86 |
* |
|
87 |
* Sets the value of the buzzer's pitch. |
|
88 |
* Higher values are lower frequencies. |
|
89 |
* |
|
90 |
* @param buzz_value the value to set the buzzer's frequency too, |
|
91 |
* in the range 0-255 |
|
92 |
* |
|
93 |
* @see buzzer_init, buzzer_set_freq, buzzer_off |
|
94 |
**/ |
|
77 | 95 |
void buzzer_set_val(unsigned int buzz_value); |
78 |
/** @brief Set the frequency the buzzer plays. **/ |
|
96 |
/** |
|
97 |
* @brief Set the frequency the buzzer plays. |
|
98 |
* |
|
99 |
* Sets the buzzer frequency. Usage of constants such as C4 |
|
100 |
* is highly recommended as input to this function. |
|
101 |
* buzzer_init must be called before this function may |
|
102 |
* be used. |
|
103 |
* |
|
104 |
* @param buzz_freq the frequency to set the buzzer to |
|
105 |
* |
|
106 |
* @see buzzer_init, buzzer_set_val, buzzer_off |
|
107 |
**/ |
|
79 | 108 |
void buzzer_set_freq(unsigned int buzz_freq); |
80 |
/** @brief Play a frequency for a specified time. **/ |
|
109 |
/** |
|
110 |
* @brief Play a frequency for a specified time. |
|
111 |
* |
|
112 |
* Plays the specified frequency for the specified |
|
113 |
* amount of time. This function blocks execution |
|
114 |
* until the time is completed. buzzer_init must be |
|
115 |
* called before this function can be used. |
|
116 |
* |
|
117 |
* @param ms the time in milliseconds to play the frequency |
|
118 |
* @param buzz_freq the frequency to play |
|
119 |
* |
|
120 |
* @see buzzer_init, buzzer_set_freq |
|
121 |
**/ |
|
81 | 122 |
void buzzer_chirp(unsigned int ms, unsigned int buzz_freq); |
82 |
/** @brief Turn the buzzer off. **/ |
|
123 |
/** @brief Turn the buzzer off. |
|
124 |
* |
|
125 |
* Turns off the buzzer by disabling the timer0 clock. |
|
126 |
* |
|
127 |
* @see buzzer_init |
|
128 |
**/ |
|
83 | 129 |
void buzzer_off(void); |
84 | 130 |
|
85 | 131 |
/** @} **/ //end addtogroup |
Also available in: Unified diff