Go to the documentation of this file.
35 #include "drv_digital_out.h"
36 #include "drv_digital_in.h"
59 #define BUZZ_DEF_FREQ 5000
72 #define BUZZ_NOTE_C2 65
73 #define BUZZ_NOTE_Db2 69
74 #define BUZZ_NOTE_D2 73
75 #define BUZZ_NOTE_Eb2 78
76 #define BUZZ_NOTE_E2 82
77 #define BUZZ_NOTE_F2 87
78 #define BUZZ_NOTE_Gb2 93
79 #define BUZZ_NOTE_G2 98
80 #define BUZZ_NOTE_Ab2 104
81 #define BUZZ_NOTE_A2 110
82 #define BUZZ_NOTE_Bb2 117
83 #define BUZZ_NOTE_B2 123
84 #define BUZZ_NOTE_C3 131
85 #define BUZZ_NOTE_Db3 139
86 #define BUZZ_NOTE_D3 147
87 #define BUZZ_NOTE_Eb3 156
88 #define BUZZ_NOTE_E3 165
89 #define BUZZ_NOTE_F3 175
90 #define BUZZ_NOTE_Gb3 185
91 #define BUZZ_NOTE_G3 196
92 #define BUZZ_NOTE_Ab3 208
93 #define BUZZ_NOTE_A3 220
94 #define BUZZ_NOTE_AS3 233
95 #define BUZZ_NOTE_B3 247
96 #define BUZZ_NOTE_C4 262
97 #define BUZZ_NOTE_Db4 277
98 #define BUZZ_NOTE_D4 294
99 #define BUZZ_NOTE_Eb4 311
100 #define BUZZ_NOTE_E4 330
101 #define BUZZ_NOTE_F4 349
102 #define BUZZ_NOTE_Gb4 370
103 #define BUZZ_NOTE_G4 392
104 #define BUZZ_NOTE_Ab4 415
105 #define BUZZ_NOTE_A4 440
106 #define BUZZ_NOTE_Bb4 466
107 #define BUZZ_NOTE_B4 494
108 #define BUZZ_NOTE_C5 523
109 #define BUZZ_NOTE_Db5 554
110 #define BUZZ_NOTE_D5 587
111 #define BUZZ_NOTE_Eb5 622
112 #define BUZZ_NOTE_E5 659
113 #define BUZZ_NOTE_F5 698
114 #define BUZZ_NOTE_Gb5 740
115 #define BUZZ_NOTE_G5 784
116 #define BUZZ_NOTE_Ab5 831
117 #define BUZZ_NOTE_A5 880
118 #define BUZZ_NOTE_Bb5 932
119 #define BUZZ_NOTE_B5 988
120 #define BUZZ_NOTE_C6 1047
121 #define BUZZ_NOTE_Db6 1109
122 #define BUZZ_NOTE_D6 1175
123 #define BUZZ_NOTE_Eb6 1245
124 #define BUZZ_NOTE_E6 1319
125 #define BUZZ_NOTE_F6 1397
126 #define BUZZ_NOTE_Gb6 1480
127 #define BUZZ_NOTE_G6 1568
128 #define BUZZ_NOTE_Ab6 1661
129 #define BUZZ_NOTE_A6 1760
130 #define BUZZ_NOTE_Bb6 1865
131 #define BUZZ_NOTE_B6 1976
132 #define BUZZ_NOTE_C7 2093
133 #define BUZZ_NOTE_Db7 2217
134 #define BUZZ_NOTE_D7 2349
135 #define BUZZ_NOTE_Eb7 2489
136 #define BUZZ_NOTE_E7 2637
137 #define BUZZ_NOTE_F7 2794
138 #define BUZZ_NOTE_Gb7 2960
139 #define BUZZ_NOTE_G7 3136
140 #define BUZZ_NOTE_Ab7 3322
141 #define BUZZ_NOTE_A7 3520
142 #define BUZZ_NOTE_Bb7 3729
143 #define BUZZ_NOTE_B7 3951
144 #define BUZZ_NOTE_C8 4186
145 #define BUZZ_NOTE_Db8 4435
146 #define BUZZ_NOTE_D8 4699
147 #define BUZZ_NOTE_Eb8 4978
167 #define BUZZ_MAP_MIKROBUS( cfg, mikrobus ) \
168 cfg.pwm = MIKROBUS( mikrobus, MIKROBUS_PWM )
BUZZ Click configuration object.
Definition: buzz.h:199
void buzz_cfg_setup(buzz_cfg_t *cfg)
BUZZ configuration object setup function.
buzz_return_value_t
BUZZ Click return value data.
Definition: buzz.h:215
BUZZ Click driver selector.
Definition: buzz.h:183
uint32_t pwm_freq
Definition: buzz.h:190
err_t buzz_pwm_start(buzz_t *ctx)
BUZZ start PWM module.
void buzz_play_sound(buzz_t *ctx, uint16_t freq, uint16_t level, uint16_t duration)
BUZZ Play sound function.
@ BUZZ_OK
Definition: buzz.h:216
err_t buzz_pwm_stop(buzz_t *ctx)
BUZZ stop PWM module.
err_t buzz_set_duty_cycle(buzz_t *ctx, float duty_cycle)
BUZZ sets PWM duty cycle.
pwm_t pwm
Definition: buzz.h:186
err_t buzz_init(buzz_t *ctx, buzz_cfg_t *cfg)
BUZZ initialization function.
@ BUZZ_ERROR
Definition: buzz.h:217
uint32_t dev_pwm_freq
Definition: buzz.h:206
pin_name_t pwm
Definition: buzz.h:202