39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
73#define BUZZ2_DEF_FREQ 5000
86#define BUZZ2_NOTE_C2 65
87#define BUZZ2_NOTE_Db2 69
88#define BUZZ2_NOTE_D2 73
89#define BUZZ2_NOTE_Eb2 78
90#define BUZZ2_NOTE_E2 82
91#define BUZZ2_NOTE_F2 87
92#define BUZZ2_NOTE_Gb2 93
93#define BUZZ2_NOTE_G2 98
94#define BUZZ2_NOTE_Ab2 104
95#define BUZZ2_NOTE_A2 110
96#define BUZZ2_NOTE_Bb2 117
97#define BUZZ2_NOTE_B2 123
98#define BUZZ2_NOTE_C3 131
99#define BUZZ2_NOTE_Db3 139
100#define BUZZ2_NOTE_D3 147
101#define BUZZ2_NOTE_Eb3 156
102#define BUZZ2_NOTE_E3 165
103#define BUZZ2_NOTE_F3 175
104#define BUZZ2_NOTE_Gb3 185
105#define BUZZ2_NOTE_G3 196
106#define BUZZ2_NOTE_Ab3 208
107#define BUZZ2_NOTE_A3 220
108#define BUZZ2_NOTE_AS3 233
109#define BUZZ2_NOTE_B3 247
110#define BUZZ2_NOTE_C4 262
111#define BUZZ2_NOTE_Db4 277
112#define BUZZ2_NOTE_D4 294
113#define BUZZ2_NOTE_Eb4 311
114#define BUZZ2_NOTE_E4 330
115#define BUZZ2_NOTE_F4 349
116#define BUZZ2_NOTE_Gb4 370
117#define BUZZ2_NOTE_G4 392
118#define BUZZ2_NOTE_Ab4 415
119#define BUZZ2_NOTE_A4 440
120#define BUZZ2_NOTE_Bb4 466
121#define BUZZ2_NOTE_B4 494
122#define BUZZ2_NOTE_C5 523
123#define BUZZ2_NOTE_Db5 554
124#define BUZZ2_NOTE_D5 587
125#define BUZZ2_NOTE_Eb5 622
126#define BUZZ2_NOTE_E5 659
127#define BUZZ2_NOTE_F5 698
128#define BUZZ2_NOTE_Gb5 740
129#define BUZZ2_NOTE_G5 784
130#define BUZZ2_NOTE_Ab5 831
131#define BUZZ2_NOTE_A5 880
132#define BUZZ2_NOTE_Bb5 932
133#define BUZZ2_NOTE_B5 988
134#define BUZZ2_NOTE_C6 1047
135#define BUZZ2_NOTE_Db6 1109
136#define BUZZ2_NOTE_D6 1175
137#define BUZZ2_NOTE_Eb6 1245
138#define BUZZ2_NOTE_E6 1319
139#define BUZZ2_NOTE_F6 1397
140#define BUZZ2_NOTE_Gb6 1480
141#define BUZZ2_NOTE_G6 1568
142#define BUZZ2_NOTE_Ab6 1661
143#define BUZZ2_NOTE_A6 1760
144#define BUZZ2_NOTE_Bb6 1865
145#define BUZZ2_NOTE_B6 1976
146#define BUZZ2_NOTE_C7 2093
147#define BUZZ2_NOTE_Db7 2217
148#define BUZZ2_NOTE_D7 2349
149#define BUZZ2_NOTE_Eb7 2489
150#define BUZZ2_NOTE_E7 2637
151#define BUZZ2_NOTE_F7 2794
152#define BUZZ2_NOTE_Gb7 2960
153#define BUZZ2_NOTE_G7 3136
154#define BUZZ2_NOTE_Ab7 3322
155#define BUZZ2_NOTE_A7 3520
156#define BUZZ2_NOTE_Bb7 3729
157#define BUZZ2_NOTE_B7 3951
158#define BUZZ2_NOTE_C8 4186
159#define BUZZ2_NOTE_Db8 4435
160#define BUZZ2_NOTE_D8 4699
161#define BUZZ2_NOTE_Eb8 4978
178#define BUZZ2_MAP_MIKROBUS( cfg, mikrobus ) \
179 cfg.pwm = MIKROBUS( mikrobus, MIKROBUS_PWM )
buzz2_return_value_t
BUZZ 2 Click return value data.
Definition buzz2.h:226
@ BUZZ2_ERROR
Definition buzz2.h:228
@ BUZZ2_OK
Definition buzz2.h:227
err_t buzz2_init(buzz2_t *ctx, buzz2_cfg_t *cfg)
BUZZ 2 initialization function.
err_t buzz2_set_duty_cycle(buzz2_t *ctx, float duty_cycle)
BUZZ 2 sets PWM duty cycle.
err_t buzz2_pwm_stop(buzz2_t *ctx)
BUZZ 2 stop PWM module.
void buzz2_cfg_setup(buzz2_cfg_t *cfg)
BUZZ 2 configuration object setup function.
void buzz2_play_sound(buzz2_t *ctx, uint16_t freq, uint16_t level, uint16_t duration)
Play sound function.
err_t buzz2_pwm_start(buzz2_t *ctx)
BUZZ 2 start PWM module.
BUZZ 2 Click configuration object.
Definition buzz2.h:210
uint32_t dev_pwm_freq
Definition buzz2.h:217
pin_name_t pwm
Definition buzz2.h:213
BUZZ 2 Click driver selector.
Definition buzz2.h:194
uint32_t pwm_freq
Definition buzz2.h:201
pwm_t pwm
Definition buzz2.h:197