Browse Source

Add analogReference() to AudioOutputAnalog

dds
PaulStoffregen 11 years ago
parent
commit
e6ee6db33c
2 changed files with 12 additions and 0 deletions
  1. +11
    -0
      Audio.cpp
  2. +1
    -0
      Audio.h

+ 11
- 0
Audio.cpp View File

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;

+ 1
- 0
Audio.h View File

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;

Loading…
Cancel
Save