NVIC_ENABLE_IRQ(IRQ_DMA_CH4); | NVIC_ENABLE_IRQ(IRQ_DMA_CH4); | ||||
} | } | ||||
void AudioOutputAnalog::analogReference(int ref) | |||||
{ | |||||
// TODO: this should ramp gradually to the new DC level | |||||
if (ref == INTERNAL) { | |||||
DAC0_C0 &= ~DAC_C0_DACRFS; // 1.2V | |||||
} else { | |||||
DAC0_C0 |= DAC_C0_DACRFS; // 3.3V | |||||
} | |||||
} | |||||
void AudioOutputAnalog::update(void) | void AudioOutputAnalog::update(void) | ||||
{ | { | ||||
audio_block_t *block; | audio_block_t *block; |
AudioOutputAnalog(void) : AudioStream(1, inputQueueArray) { begin(); } | AudioOutputAnalog(void) : AudioStream(1, inputQueueArray) { begin(); } | ||||
virtual void update(void); | virtual void update(void); | ||||
void begin(void); | void begin(void); | ||||
void analogReference(int ref); | |||||
friend void dma_ch4_isr(void); | friend void dma_ch4_isr(void); | ||||
private: | private: | ||||
static audio_block_t *block_left_1st; | static audio_block_t *block_left_1st; |