Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
buzz2_click.h File Reference

mikrosdk interface More...

#include <stdint.h>
Include dependency graph for buzz2_click.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define BUZZ2_NOTE_C2   65
 Defines for music note frequencies, from Octave 2 to Octave 8. More...
 
#define BUZZ2_NOTE_Db2   69
 
#define BUZZ2_NOTE_D2   73
 
#define BUZZ2_NOTE_Eb2   78
 
#define BUZZ2_NOTE_E2   82
 
#define BUZZ2_NOTE_F2   87
 
#define BUZZ2_NOTE_Gb2   93
 
#define BUZZ2_NOTE_G2   98
 
#define BUZZ2_NOTE_Ab2   104
 
#define BUZZ2_NOTE_A2   110
 
#define BUZZ2_NOTE_Bb2   117
 
#define BUZZ2_NOTE_B2   123
 
#define BUZZ2_NOTE_C3   131
 
#define BUZZ2_NOTE_Db3   139
 
#define BUZZ2_NOTE_D3   147
 
#define BUZZ2_NOTE_Eb3   156
 
#define BUZZ2_NOTE_E3   165
 
#define BUZZ2_NOTE_F3   175
 
#define BUZZ2_NOTE_Gb3   185
 
#define BUZZ2_NOTE_G3   196
 
#define BUZZ2_NOTE_Ab3   208
 
#define BUZZ2_NOTE_A3   220
 
#define BUZZ2_NOTE_Bb3   233
 
#define BUZZ2_NOTE_B3   247
 
#define BUZZ2_NOTE_C4   262
 
#define BUZZ2_NOTE_Db4   277
 
#define BUZZ2_NOTE_D4   294
 
#define BUZZ2_NOTE_Eb4   311
 
#define BUZZ2_NOTE_E4   330
 
#define BUZZ2_NOTE_F4   349
 
#define BUZZ2_NOTE_Gb4   370
 
#define BUZZ2_NOTE_G4   392
 
#define BUZZ2_NOTE_Ab4   415
 
#define BUZZ2_NOTE_A4   440
 
#define BUZZ2_NOTE_Bb4   466
 
#define BUZZ2_NOTE_B4   494
 
#define BUZZ2_NOTE_C5   523
 
#define BUZZ2_NOTE_Db5   554
 
#define BUZZ2_NOTE_D5   587
 
#define BUZZ2_NOTE_Eb5   622
 
#define BUZZ2_NOTE_E5   659
 
#define BUZZ2_NOTE_F5   698
 
#define BUZZ2_NOTE_Gb5   740
 
#define BUZZ2_NOTE_G5   784
 
#define BUZZ2_NOTE_Ab5   831
 
#define BUZZ2_NOTE_A5   880
 
#define BUZZ2_NOTE_Bb5   932
 
#define BUZZ2_NOTE_B5   988
 
#define BUZZ2_NOTE_C6   1047
 
#define BUZZ2_NOTE_Db6   1109
 
#define BUZZ2_NOTE_D6   1175
 
#define BUZZ2_NOTE_Eb6   1245
 
#define BUZZ2_NOTE_E6   1319
 
#define BUZZ2_NOTE_F6   1397
 
#define BUZZ2_NOTE_Gb6   1480
 
#define BUZZ2_NOTE_G6   1568
 
#define BUZZ2_NOTE_Ab6   1661
 
#define BUZZ2_NOTE_A6   1760
 
#define BUZZ2_NOTE_Bb6   1865
 
#define BUZZ2_NOTE_B6   1976
 
#define BUZZ2_NOTE_C7   2093
 
#define BUZZ2_NOTE_Db7   2217
 
#define BUZZ2_NOTE_D7   2349
 
#define BUZZ2_NOTE_Eb7   2489
 
#define BUZZ2_NOTE_E7   2637
 
#define BUZZ2_NOTE_F7   2794
 
#define BUZZ2_NOTE_Gb7   2960
 
#define BUZZ2_NOTE_G7   3136
 
#define BUZZ2_NOTE_Ab7   3322
 
#define BUZZ2_NOTE_A7   3520
 
#define BUZZ2_NOTE_Bb7   3729
 
#define BUZZ2_NOTE_B7   3951
 
#define BUZZ2_NOTE_C8   4186
 
#define BUZZ2_NOTE_Db8   4435
 
#define BUZZ2_NOTE_D8   4699
 
#define BUZZ2_NOTE_Eb8   4978
 
#define BUZZ2_NOTE_E8   5274
 
#define BUZZ2_NOTE_F8   5588
 
#define BUZZ2_NOTE_Gb8   5920
 
#define BUZZ2_NOTE_Ab8   6645
 
#define BUZZ2_NOTE_A8   7040
 
#define BUZZ2_NOTE_Bb8   7459
 
#define BUZZ2_NOTE_B8   7902
 
#define BUZZ2_PWM_PIN   35
 PWM pin define on the devboard. More...
 

Typedefs

typedef void(* NoteFinishedCallback) (void *context)
 

Enumerations

enum  buzz2_status { BUZZ2_ST_OK = 0 , BUZZ2_ST_FAIL = 1 }
 Enum (buzz2 status) More...
 
enum  play_note_mode { BLOCKING = 0 , NON_BLOCKING = 1 }
 Enum (mode for play note function) More...
 

Functions

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. More...
 
uint8_t MIKROSDK_BUZZ2_Initialise (void)
 Buzz2 Initialisation function. More...
 

Detailed Description

mikrosdk interface

Macro Definition Documentation

◆ BUZZ2_NOTE_A2

#define BUZZ2_NOTE_A2   110

◆ BUZZ2_NOTE_A3

#define BUZZ2_NOTE_A3   220

◆ BUZZ2_NOTE_A4

#define BUZZ2_NOTE_A4   440

◆ BUZZ2_NOTE_A5

#define BUZZ2_NOTE_A5   880

◆ BUZZ2_NOTE_A6

#define BUZZ2_NOTE_A6   1760

◆ BUZZ2_NOTE_A7

#define BUZZ2_NOTE_A7   3520

◆ BUZZ2_NOTE_A8

#define BUZZ2_NOTE_A8   7040

◆ BUZZ2_NOTE_Ab2

#define BUZZ2_NOTE_Ab2   104

◆ BUZZ2_NOTE_Ab3

#define BUZZ2_NOTE_Ab3   208

◆ BUZZ2_NOTE_Ab4

#define BUZZ2_NOTE_Ab4   415

◆ BUZZ2_NOTE_Ab5

#define BUZZ2_NOTE_Ab5   831

◆ BUZZ2_NOTE_Ab6

#define BUZZ2_NOTE_Ab6   1661

◆ BUZZ2_NOTE_Ab7

#define BUZZ2_NOTE_Ab7   3322

◆ BUZZ2_NOTE_Ab8

#define BUZZ2_NOTE_Ab8   6645

◆ BUZZ2_NOTE_B2

#define BUZZ2_NOTE_B2   123

◆ BUZZ2_NOTE_B3

#define BUZZ2_NOTE_B3   247

◆ BUZZ2_NOTE_B4

#define BUZZ2_NOTE_B4   494

◆ BUZZ2_NOTE_B5

#define BUZZ2_NOTE_B5   988

◆ BUZZ2_NOTE_B6

#define BUZZ2_NOTE_B6   1976

◆ BUZZ2_NOTE_B7

#define BUZZ2_NOTE_B7   3951

◆ BUZZ2_NOTE_B8

#define BUZZ2_NOTE_B8   7902

◆ BUZZ2_NOTE_Bb2

#define BUZZ2_NOTE_Bb2   117

◆ BUZZ2_NOTE_Bb3

#define BUZZ2_NOTE_Bb3   233

◆ BUZZ2_NOTE_Bb4

#define BUZZ2_NOTE_Bb4   466

◆ BUZZ2_NOTE_Bb5

#define BUZZ2_NOTE_Bb5   932

◆ BUZZ2_NOTE_Bb6

#define BUZZ2_NOTE_Bb6   1865

◆ BUZZ2_NOTE_Bb7

#define BUZZ2_NOTE_Bb7   3729

◆ BUZZ2_NOTE_Bb8

#define BUZZ2_NOTE_Bb8   7459

◆ BUZZ2_NOTE_C2

#define BUZZ2_NOTE_C2   65

Defines for music note frequencies, from Octave 2 to Octave 8.

◆ BUZZ2_NOTE_C3

#define BUZZ2_NOTE_C3   131

◆ BUZZ2_NOTE_C4

#define BUZZ2_NOTE_C4   262

◆ BUZZ2_NOTE_C5

#define BUZZ2_NOTE_C5   523

◆ BUZZ2_NOTE_C6

#define BUZZ2_NOTE_C6   1047

◆ BUZZ2_NOTE_C7

#define BUZZ2_NOTE_C7   2093

◆ BUZZ2_NOTE_C8

#define BUZZ2_NOTE_C8   4186

◆ BUZZ2_NOTE_D2

#define BUZZ2_NOTE_D2   73

◆ BUZZ2_NOTE_D3

#define BUZZ2_NOTE_D3   147

◆ BUZZ2_NOTE_D4

#define BUZZ2_NOTE_D4   294

◆ BUZZ2_NOTE_D5

#define BUZZ2_NOTE_D5   587

◆ BUZZ2_NOTE_D6

#define BUZZ2_NOTE_D6   1175

◆ BUZZ2_NOTE_D7

#define BUZZ2_NOTE_D7   2349

◆ BUZZ2_NOTE_D8

#define BUZZ2_NOTE_D8   4699

◆ BUZZ2_NOTE_Db2

#define BUZZ2_NOTE_Db2   69

◆ BUZZ2_NOTE_Db3

#define BUZZ2_NOTE_Db3   139

◆ BUZZ2_NOTE_Db4

#define BUZZ2_NOTE_Db4   277

◆ BUZZ2_NOTE_Db5

#define BUZZ2_NOTE_Db5   554

◆ BUZZ2_NOTE_Db6

#define BUZZ2_NOTE_Db6   1109

◆ BUZZ2_NOTE_Db7

#define BUZZ2_NOTE_Db7   2217

◆ BUZZ2_NOTE_Db8

#define BUZZ2_NOTE_Db8   4435

◆ BUZZ2_NOTE_E2

#define BUZZ2_NOTE_E2   82

◆ BUZZ2_NOTE_E3

#define BUZZ2_NOTE_E3   165

◆ BUZZ2_NOTE_E4

#define BUZZ2_NOTE_E4   330

◆ BUZZ2_NOTE_E5

#define BUZZ2_NOTE_E5   659

◆ BUZZ2_NOTE_E6

#define BUZZ2_NOTE_E6   1319

◆ BUZZ2_NOTE_E7

#define BUZZ2_NOTE_E7   2637

◆ BUZZ2_NOTE_E8

#define BUZZ2_NOTE_E8   5274

◆ BUZZ2_NOTE_Eb2

#define BUZZ2_NOTE_Eb2   78

◆ BUZZ2_NOTE_Eb3

#define BUZZ2_NOTE_Eb3   156

◆ BUZZ2_NOTE_Eb4

#define BUZZ2_NOTE_Eb4   311

◆ BUZZ2_NOTE_Eb5

#define BUZZ2_NOTE_Eb5   622

◆ BUZZ2_NOTE_Eb6

#define BUZZ2_NOTE_Eb6   1245

◆ BUZZ2_NOTE_Eb7

#define BUZZ2_NOTE_Eb7   2489

◆ BUZZ2_NOTE_Eb8

#define BUZZ2_NOTE_Eb8   4978

◆ BUZZ2_NOTE_F2

#define BUZZ2_NOTE_F2   87

◆ BUZZ2_NOTE_F3

#define BUZZ2_NOTE_F3   175

◆ BUZZ2_NOTE_F4

#define BUZZ2_NOTE_F4   349

◆ BUZZ2_NOTE_F5

#define BUZZ2_NOTE_F5   698

◆ BUZZ2_NOTE_F6

#define BUZZ2_NOTE_F6   1397

◆ BUZZ2_NOTE_F7

#define BUZZ2_NOTE_F7   2794

◆ BUZZ2_NOTE_F8

#define BUZZ2_NOTE_F8   5588

◆ BUZZ2_NOTE_G2

#define BUZZ2_NOTE_G2   98

◆ BUZZ2_NOTE_G3

#define BUZZ2_NOTE_G3   196

◆ BUZZ2_NOTE_G4

#define BUZZ2_NOTE_G4   392

◆ BUZZ2_NOTE_G5

#define BUZZ2_NOTE_G5   784

◆ BUZZ2_NOTE_G6

#define BUZZ2_NOTE_G6   1568

◆ BUZZ2_NOTE_G7

#define BUZZ2_NOTE_G7   3136

◆ BUZZ2_NOTE_Gb2

#define BUZZ2_NOTE_Gb2   93

◆ BUZZ2_NOTE_Gb3

#define BUZZ2_NOTE_Gb3   185

◆ BUZZ2_NOTE_Gb4

#define BUZZ2_NOTE_Gb4   370

◆ BUZZ2_NOTE_Gb5

#define BUZZ2_NOTE_Gb5   740

◆ BUZZ2_NOTE_Gb6

#define BUZZ2_NOTE_Gb6   1480

◆ BUZZ2_NOTE_Gb7

#define BUZZ2_NOTE_Gb7   2960

◆ BUZZ2_NOTE_Gb8

#define BUZZ2_NOTE_Gb8   5920

◆ BUZZ2_PWM_PIN

#define BUZZ2_PWM_PIN   35

PWM pin define on the devboard.

Typedef Documentation

◆ NoteFinishedCallback

typedef void(* NoteFinishedCallback) (void *context)

Enumeration Type Documentation

◆ buzz2_status

Enum (buzz2 status)

Enumerator
BUZZ2_ST_OK 
BUZZ2_ST_FAIL 

◆ play_note_mode

Enum (mode for play note function)

Enumerator
BLOCKING 
NON_BLOCKING 

Function Documentation

◆ MIKROSDK_BUZZ2_Initialise()

uint8_t MIKROSDK_BUZZ2_Initialise ( void  )

Buzz2 Initialisation function.

Returns
uint8_t (buzz2 status)

◆ MIKROSDK_BUZZ2_play_note()

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.

Parameters
freqNote frequency
volumeVolume[%] of buzz2 (0 = off, 100 = max)
durationDuration[ms] of the note to be played (min = 0, max = 65535)
modeMode of the function (BLOCKING/NON-BLOCKING) Blocking: Uses delay, can call this function successively, not recommended for KNX applications. If using BLOCKING mode, set nfc to NULL. Non-blocking: Schedules tasklet, can only call this function once within the specified duration.
nfcOptional callback to be called after the note stops playing, if mode == NON-BLOCKING. Set to NULL if using BLOCKING mode. If using NON-BLOCKING mode, you can also set it to NULL if you don't need any callback to be called once the note stops playing.
Returns
uint8_t (buzz2 status)