Mercurial > hg > beaglert
comparison include/render.h @ 16:670be80463a3 matrix_gpio
- analog matrixIn/matrixOut are now mapped as floats from 0 to 1
- use of an external PRU code can be enabled with -P <filename>
- 16 channels of programmable GPIO can be accessed straight from render() either writing directly to the matrixGpio[] array or using digitalWrite(),
digitalRead(), setDigitalDirection() macros from Utilities.h .
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Mon, 27 Apr 2015 13:01:57 +0100 |
parents | 6adb088196a7 |
children | c98863e63174 |
comparison
equal
deleted
inserted
replaced
15:901d205d1a3c | 16:670be80463a3 |
---|---|
8 #ifndef RENDER_H_ | 8 #ifndef RENDER_H_ |
9 #define RENDER_H_ | 9 #define RENDER_H_ |
10 | 10 |
11 // uint types | 11 // uint types |
12 #include <stdint.h> | 12 #include <stdint.h> |
13 | 13 #include "../include/Utilities.h" |
14 #include "../include/matrix_gpio_mapping.h" | |
14 // Mappings from pin numbers on PCB to actual DAC channels | 15 // Mappings from pin numbers on PCB to actual DAC channels |
15 // This gives the DAC and ADC connectors the same effective pinout | 16 // This gives the DAC and ADC connectors the same effective pinout |
16 #define DAC_PIN0 6 | 17 #define DAC_PIN0 6 |
17 #define DAC_PIN1 4 | 18 #define DAC_PIN1 4 |
18 #define DAC_PIN2 2 | 19 #define DAC_PIN2 2 |
33 | 34 |
34 #define MATRIX_MAX 65535.0 | 35 #define MATRIX_MAX 65535.0 |
35 | 36 |
36 extern int gNumAudioChannels; // How many audio channels are present | 37 extern int gNumAudioChannels; // How many audio channels are present |
37 extern int gNumMatrixChannels; // How many matrix channels are present | 38 extern int gNumMatrixChannels; // How many matrix channels are present |
38 | 39 extern int gNumMatrixGpioChannels; |
39 bool initialise_render(int numMatrixChannels, int numAudioChannels, | 40 bool initialise_render(int numMatrixChannels, int numMatrixGpioChannels, int numAudioChannels, |
40 int numMatrixFramesPerPeriod, | 41 int numMatrixFramesPerPeriod, |
41 int numAudioFramesPerPeriod, | 42 int numAudioFramesPerPeriod, |
42 float matrixSampleRate, float audioSampleRate, | 43 float matrixSampleRate, float audioSampleRate, |
43 void *userData); | 44 void *userData); |
44 | 45 |
45 void render(int numMatrixFrames, int numAudioFrames, float *audioIn, float *audioOut, | 46 void render(int numMatrixFrames, int numAudioFrames, int numMatrixGpioFrames, float *audioIn, float *audioOut, |
46 uint16_t *matrixIn, uint16_t *matrixOut); | 47 float *matrixIn, float *matrixOut, uint32_t *matrixGpio); |
47 | 48 |
48 void render_medium_prio(); | 49 void render_medium_prio(); |
49 void render_low_prio(); | 50 void render_low_prio(); |
50 | 51 |
51 void schedule_render_medium_prio(); | 52 void schedule_render_medium_prio(); |