andrewm@0
|
1 /*
|
andrewm@0
|
2 * render.h
|
andrewm@0
|
3 *
|
andrewm@0
|
4 * Created on: May 28, 2014
|
andrewm@0
|
5 * Author: Victor Zappi
|
andrewm@0
|
6 */
|
andrewm@0
|
7
|
andrewm@0
|
8 #ifndef RENDER_H_
|
andrewm@0
|
9 #define RENDER_H_
|
andrewm@0
|
10
|
andrewm@0
|
11 // uint types
|
andrewm@0
|
12 #include <stdint.h>
|
giuliomoro@24
|
13 #include "Utilities.h"
|
giuliomoro@24
|
14 #include "digital_gpio_mapping.h"
|
giuliomoro@24
|
15 #include "RTAudioSettings.h"
|
giuliomoro@24
|
16
|
andrewm@0
|
17 // Mappings from pin numbers on PCB to actual DAC channels
|
andrewm@0
|
18 // This gives the DAC and ADC connectors the same effective pinout
|
andrewm@0
|
19 #define DAC_PIN0 6
|
andrewm@0
|
20 #define DAC_PIN1 4
|
andrewm@0
|
21 #define DAC_PIN2 2
|
andrewm@0
|
22 #define DAC_PIN3 0
|
andrewm@0
|
23 #define DAC_PIN4 1
|
andrewm@0
|
24 #define DAC_PIN5 3
|
andrewm@0
|
25 #define DAC_PIN6 5
|
andrewm@0
|
26 #define DAC_PIN7 7
|
andrewm@0
|
27
|
andrewm@0
|
28 #define ADC_PIN0 0
|
andrewm@0
|
29 #define ADC_PIN1 1
|
andrewm@0
|
30 #define ADC_PIN2 2
|
andrewm@0
|
31 #define ADC_PIN3 3
|
andrewm@0
|
32 #define ADC_PIN4 4
|
andrewm@0
|
33 #define ADC_PIN5 5
|
andrewm@0
|
34 #define ADC_PIN6 6
|
andrewm@0
|
35 #define ADC_PIN7 7
|
andrewm@0
|
36
|
giuliomoro@19
|
37 #define ANALOG_MAX 65535.0
|
andrewm@0
|
38
|
andrewm@13
|
39 extern int gNumAudioChannels; // How many audio channels are present
|
giuliomoro@19
|
40 extern int gNumAnalogChannels; // How many analog channels are present
|
giuliomoro@19
|
41 extern int gNumDigitalChannels;
|
giuliomoro@19
|
42 bool initialise_render(int numAnalogChannels, int numDigitalChannels, int numAudioChannels,
|
giuliomoro@19
|
43 int numAnalogFramesPerPeriod,
|
andrewm@0
|
44 int numAudioFramesPerPeriod,
|
giuliomoro@19
|
45 float analogSampleRate, float audioSampleRate,
|
giuliomoro@24
|
46 void *userData, RTAudioSettings *settings);
|
andrewm@0
|
47
|
giuliomoro@19
|
48 void render(int numAnalogFrames, int numAudioFrames, int numDigitalFrames, float *audioIn, float *audioOut,
|
giuliomoro@19
|
49 float *analogIn, float *analogOut, uint32_t *digital);
|
andrewm@0
|
50
|
andrewm@0
|
51 void render_medium_prio();
|
andrewm@0
|
52 void render_low_prio();
|
andrewm@0
|
53
|
andrewm@0
|
54 void schedule_render_medium_prio();
|
andrewm@0
|
55 void schedule_render_low_prio();
|
andrewm@0
|
56
|
andrewm@0
|
57
|
andrewm@0
|
58 void cleanup_render();
|
andrewm@0
|
59
|
andrewm@0
|
60 #endif /* RENDER_H_ */
|