You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
irmc/src/beep.h

33 lines
609 B

#include <stdio.h>
8 years ago
#include <math.h>
#include "portaudio.h"
8 years ago
#define NUM_SECONDS (5)
#define SAMPLE_RATE (44100)
8 years ago
#define FRAMES_PER_BUFFER (64)
#ifndef M_PI
#define M_PI (3.14159265)
#endif
typedef struct
{
7 years ago
uint32_t total_count;
uint32_t up_count;
7 years ago
7 years ago
uint32_t counter;
uint32_t prev_freq;
uint32_t freq;
} paTestData;
8 years ago
7 years ago
void buzzer_set_freq(int frequency);
void buzzer_beep(int frequency, int msecs);
int buzzer_start(void);
int buzzer_stop();
void msleep(int d);
int beep_test(void);
7 years ago
7 years ago
// compatibility to old interface
int beep(double freq_hz, double duration_sec);
int beep_init();