andrewm@0: /* andrewm@0: * render.h andrewm@0: * andrewm@0: * Created on: May 28, 2014 andrewm@0: * Author: Victor Zappi andrewm@0: */ andrewm@0: andrewm@0: #ifndef RENDER_H_ andrewm@0: #define RENDER_H_ andrewm@0: andrewm@0: // uint types andrewm@0: #include giuliomoro@24: #include "Utilities.h" giuliomoro@24: #include "digital_gpio_mapping.h" giuliomoro@24: #include "RTAudioSettings.h" giuliomoro@24: andrewm@0: // Mappings from pin numbers on PCB to actual DAC channels andrewm@0: // This gives the DAC and ADC connectors the same effective pinout andrewm@0: #define DAC_PIN0 6 andrewm@0: #define DAC_PIN1 4 andrewm@0: #define DAC_PIN2 2 andrewm@0: #define DAC_PIN3 0 andrewm@0: #define DAC_PIN4 1 andrewm@0: #define DAC_PIN5 3 andrewm@0: #define DAC_PIN6 5 andrewm@0: #define DAC_PIN7 7 andrewm@0: andrewm@0: #define ADC_PIN0 0 andrewm@0: #define ADC_PIN1 1 andrewm@0: #define ADC_PIN2 2 andrewm@0: #define ADC_PIN3 3 andrewm@0: #define ADC_PIN4 4 andrewm@0: #define ADC_PIN5 5 andrewm@0: #define ADC_PIN6 6 andrewm@0: #define ADC_PIN7 7 andrewm@0: giuliomoro@19: #define ANALOG_MAX 65535.0 andrewm@0: andrewm@13: extern int gNumAudioChannels; // How many audio channels are present giuliomoro@19: extern int gNumAnalogChannels; // How many analog channels are present giuliomoro@19: extern int gNumDigitalChannels; giuliomoro@19: bool initialise_render(int numAnalogChannels, int numDigitalChannels, int numAudioChannels, giuliomoro@19: int numAnalogFramesPerPeriod, andrewm@0: int numAudioFramesPerPeriod, giuliomoro@19: float analogSampleRate, float audioSampleRate, giuliomoro@24: void *userData, RTAudioSettings *settings); andrewm@0: giuliomoro@19: void render(int numAnalogFrames, int numAudioFrames, int numDigitalFrames, float *audioIn, float *audioOut, giuliomoro@19: float *analogIn, float *analogOut, uint32_t *digital); andrewm@0: andrewm@0: void render_medium_prio(); andrewm@0: void render_low_prio(); andrewm@0: andrewm@0: void schedule_render_medium_prio(); andrewm@0: void schedule_render_low_prio(); andrewm@0: andrewm@0: andrewm@0: void cleanup_render(); andrewm@0: andrewm@0: #endif /* RENDER_H_ */