comparison include/RTAudio.h @ 0:8a575ba3ab52

Initial commit.
author andrewm
date Fri, 31 Oct 2014 19:10:17 +0100
parents
children 09f03ac40fcc
comparison
equal deleted inserted replaced
-1:000000000000 0:8a575ba3ab52
1 /*
2 * RTAudio.h
3 *
4 * Central control code for hard real-time audio on BeagleBone Black
5 * using PRU and Xenomai Linux extensions. This code began as part
6 * of the Hackable Instruments project (EPSRC) at Queen Mary University
7 * of London, 2013-14.
8 *
9 * (c) 2014 Victor Zappi and Andrew McPherson
10 * Queen Mary University of London
11 */
12
13
14 #ifndef RTAUDIO_H_
15 #define RTAUDIO_H_
16
17 #include "render.h"
18
19 // Useful constants
20 #define DBOX_CAPE // New custom cape
21
22 #ifdef DBOX_CAPE
23 #define CODEC_I2C_ADDRESS 0x18 // Address of TLV320AIC3104 codec
24 #else
25 #define CODEC_I2C_ADDRESS 0x1B // Address of TLV320AIC3106 codec
26 #endif
27
28 enum {
29 kAmplifierMutePin = 61 // P8-26 controls amplifier mute
30 };
31
32 typedef void* AuxiliaryTask; // Opaque data type to keep track of aux tasks
33
34 // Flag that indicates when the audio will stop; can be read or
35 // set by other components which should end at the same time as the audio
36 extern bool gShouldStop;
37
38 int initAudio(int periodSize, int useMatrix, void *userData,
39 int codecI2CAddress = CODEC_I2C_ADDRESS, int ampMutePin = kAmplifierMutePin);
40 int startAudio();
41 void stopAudio();
42 void cleanupAudio();
43
44 AuxiliaryTask createAuxiliaryTaskLoop(void (*functionToCall)(void), int priority, const char *name);
45 void scheduleAuxiliaryTask(AuxiliaryTask task);
46
47 void setVerboseLevel(int level);
48
49 #endif /* RTAUDIO_H_ */