소스 검색

Merge pull request #334 from jurgenbelien/master

Switch headphone source between input and DAC
dds
Paul Stoffregen 4 년 전
부모
커밋
8bc5b0cfb7
No account linked to committer's email address
1개의 변경된 파일13개의 추가작업 그리고 0개의 파일을 삭제
  1. +13
    -0
      control_sgtl5000.h

+ 13
- 0
control_sgtl5000.h 파일 보기

#include <AudioStream.h> #include <AudioStream.h>
#include "AudioControl.h" #include "AudioControl.h"


// SGTL5000-specific defines for headphones
#define AUDIO_HEADPHONE_DAC 0
#define AUDIO_HEADPHONE_LINEIN 1

class AudioControlSGTL5000 : public AudioControl class AudioControlSGTL5000 : public AudioControl
{ {
public: public:
return false; return false;
} }
} }
bool headphoneSelect(int n) {
if (n == AUDIO_HEADPHONE_DAC) {
return write(0x0024, ana_ctrl | (1<<6)); // route DAC to headphones out
} else if (n == AUDIO_HEADPHONE_LINEIN) {
return write(0x0024, ana_ctrl & ~(1<<6)); // route linein to headphones out
} else {
return false;
}
}
bool volume(float left, float right); bool volume(float left, float right);
bool micGain(unsigned int dB); bool micGain(unsigned int dB);
bool lineInLevel(uint8_t n) { return lineInLevel(n, n); } bool lineInLevel(uint8_t n) { return lineInLevel(n, n); }

Loading…
취소
저장