Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
buzz2_click.h
Go to the documentation of this file.
1 
5 /*
6  * Copyright (c) 2023, Cascoda Ltd.
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions are met:
11  * 1. Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright
14  * notice, this list of conditions and the following disclaimer in the
15  * documentation and/or other materials provided with the distribution.
16  * 3. Neither the name of the copyright holder nor the
17  * names of its contributors may be used to endorse or promote products
18  * derived from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  */
32 /*
33  * Example click interface driver
34 */
35 
36 #ifndef BUZZ2_CLICK_H
37 #define BUZZ2_CLICK_H
38 
39 #include <stdint.h>
40 
45 #define BUZZ2_NOTE_C2 65
46 #define BUZZ2_NOTE_Db2 69
47 #define BUZZ2_NOTE_D2 73
48 #define BUZZ2_NOTE_Eb2 78
49 #define BUZZ2_NOTE_E2 82
50 #define BUZZ2_NOTE_F2 87
51 #define BUZZ2_NOTE_Gb2 93
52 #define BUZZ2_NOTE_G2 98
53 #define BUZZ2_NOTE_Ab2 104
54 #define BUZZ2_NOTE_A2 110
55 #define BUZZ2_NOTE_Bb2 117
56 #define BUZZ2_NOTE_B2 123
57 #define BUZZ2_NOTE_C3 131
58 #define BUZZ2_NOTE_Db3 139
59 #define BUZZ2_NOTE_D3 147
60 #define BUZZ2_NOTE_Eb3 156
61 #define BUZZ2_NOTE_E3 165
62 #define BUZZ2_NOTE_F3 175
63 #define BUZZ2_NOTE_Gb3 185
64 #define BUZZ2_NOTE_G3 196
65 #define BUZZ2_NOTE_Ab3 208
66 #define BUZZ2_NOTE_A3 220
67 #define BUZZ2_NOTE_Bb3 233
68 #define BUZZ2_NOTE_B3 247
69 #define BUZZ2_NOTE_C4 262
70 #define BUZZ2_NOTE_Db4 277
71 #define BUZZ2_NOTE_D4 294
72 #define BUZZ2_NOTE_Eb4 311
73 #define BUZZ2_NOTE_E4 330
74 #define BUZZ2_NOTE_F4 349
75 #define BUZZ2_NOTE_Gb4 370
76 #define BUZZ2_NOTE_G4 392
77 #define BUZZ2_NOTE_Ab4 415
78 #define BUZZ2_NOTE_A4 440
79 #define BUZZ2_NOTE_Bb4 466
80 #define BUZZ2_NOTE_B4 494
81 #define BUZZ2_NOTE_C5 523
82 #define BUZZ2_NOTE_Db5 554
83 #define BUZZ2_NOTE_D5 587
84 #define BUZZ2_NOTE_Eb5 622
85 #define BUZZ2_NOTE_E5 659
86 #define BUZZ2_NOTE_F5 698
87 #define BUZZ2_NOTE_Gb5 740
88 #define BUZZ2_NOTE_G5 784
89 #define BUZZ2_NOTE_Ab5 831
90 #define BUZZ2_NOTE_A5 880
91 #define BUZZ2_NOTE_Bb5 932
92 #define BUZZ2_NOTE_B5 988
93 #define BUZZ2_NOTE_C6 1047
94 #define BUZZ2_NOTE_Db6 1109
95 #define BUZZ2_NOTE_D6 1175
96 #define BUZZ2_NOTE_Eb6 1245
97 #define BUZZ2_NOTE_E6 1319
98 #define BUZZ2_NOTE_F6 1397
99 #define BUZZ2_NOTE_Gb6 1480
100 #define BUZZ2_NOTE_G6 1568
101 #define BUZZ2_NOTE_Ab6 1661
102 #define BUZZ2_NOTE_A6 1760
103 #define BUZZ2_NOTE_Bb6 1865
104 #define BUZZ2_NOTE_B6 1976
105 #define BUZZ2_NOTE_C7 2093
106 #define BUZZ2_NOTE_Db7 2217
107 #define BUZZ2_NOTE_D7 2349
108 #define BUZZ2_NOTE_Eb7 2489
109 #define BUZZ2_NOTE_E7 2637
110 #define BUZZ2_NOTE_F7 2794
111 #define BUZZ2_NOTE_Gb7 2960
112 #define BUZZ2_NOTE_G7 3136
113 #define BUZZ2_NOTE_Ab7 3322
114 #define BUZZ2_NOTE_A7 3520
115 #define BUZZ2_NOTE_Bb7 3729
116 #define BUZZ2_NOTE_B7 3951
117 #define BUZZ2_NOTE_C8 4186
118 #define BUZZ2_NOTE_Db8 4435
119 #define BUZZ2_NOTE_D8 4699
120 #define BUZZ2_NOTE_Eb8 4978
121 #define BUZZ2_NOTE_E8 5274
122 #define BUZZ2_NOTE_F8 5588
123 #define BUZZ2_NOTE_Gb8 5920
124 #define BUZZ2_NOTE_Ab8 6645
125 #define BUZZ2_NOTE_A8 7040
126 #define BUZZ2_NOTE_Bb8 7459
127 #define BUZZ2_NOTE_B8 7902
128 
133 #define BUZZ2_PWM_PIN 35
134 
140 {
143 };
144 
150 {
151  BLOCKING = 0,
153 };
154 
155 typedef void (*NoteFinishedCallback)(void *context);
156 
157 /* new functions */
173 uint8_t MIKROSDK_BUZZ2_play_note(uint32_t freq,
174  uint32_t volume,
175  uint16_t duration,
176  uint8_t mode,
183 uint8_t MIKROSDK_BUZZ2_Initialise(void);
184 
185 #endif // BUZZ2_CLICK_H
void(* NoteFinishedCallback)(void *context)
Definition: buzz2_click.h:155
play_note_mode
Enum (mode for play note function)
Definition: buzz2_click.h:150
@ NON_BLOCKING
Definition: buzz2_click.h:152
@ BLOCKING
Definition: buzz2_click.h:151
uint8_t MIKROSDK_BUZZ2_play_note(uint32_t freq, uint32_t volume, uint16_t duration, uint8_t mode, NoteFinishedCallback nfc)
Function that plays a note.
Definition: buzz2.c:70
uint8_t MIKROSDK_BUZZ2_Initialise(void)
Buzz2 Initialisation function.
Definition: buzz2.c:97
buzz2_status
Enum (buzz2 status)
Definition: buzz2_click.h:140
@ BUZZ2_ST_OK
Definition: buzz2_click.h:141
@ BUZZ2_ST_FAIL
Definition: buzz2_click.h:142