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

@@ -1067,6 +1067,17 @@ void AudioOutputAnalog::begin(void)
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)
{
audio_block_t *block;

+ 1
- 0
Audio.h View File

@@ -124,6 +124,7 @@ public:
AudioOutputAnalog(void) : AudioStream(1, inputQueueArray) { begin(); }
virtual void update(void);
void begin(void);
void analogReference(int ref);
friend void dma_ch4_isr(void);
private:
static audio_block_t *block_left_1st;

Loading…
Cancel
Save