You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
2.0 KiB
59 lines
2.0 KiB
8 years ago
|
/*
|
||
|
control_tlv320aic3206
|
||
|
|
||
8 years ago
|
Created: Brendan Flynn (http://www.flexvoltbiosensor.com/) for Tympan, Jan-Feb 2017
|
||
|
Purpose: Control module for Texas Instruments TLV320AIC3206 compatible with Teensy Audio Library
|
||
8 years ago
|
|
||
|
License: MIT License. Use at your own risk.
|
||
8 years ago
|
*/
|
||
|
|
||
8 years ago
|
#ifndef control_tlv320aic3206_h_
|
||
|
#define control_tlv320aic3206_h_
|
||
8 years ago
|
|
||
|
#include "AudioControl.h"
|
||
|
|
||
|
class AudioControlTLV320AIC3206: public AudioControl
|
||
|
{
|
||
|
public:
|
||
8 years ago
|
//GUI: inputs:0, outputs:0 //this line used for automatic generation of GUI node
|
||
7 years ago
|
AudioControlTLV320AIC3206(void) { debugToSerial = false; };
|
||
|
AudioControlTLV320AIC3206(bool _debugToSerial) { debugToSerial = _debugToSerial; };
|
||
8 years ago
|
bool enable(void);
|
||
|
bool disable(void);
|
||
|
bool volume(float n);
|
||
8 years ago
|
bool volume_dB(float n);
|
||
|
bool inputLevel(float n); //dummy to be compatible with Teensy Audio Library
|
||
8 years ago
|
bool inputSelect(int n);
|
||
8 years ago
|
bool setInputGain_dB(float n);
|
||
8 years ago
|
bool setMicBias(int n);
|
||
7 years ago
|
bool debugToSerial;
|
||
8 years ago
|
private:
|
||
|
void aic_reset(void);
|
||
8 years ago
|
void aic_init(void);
|
||
8 years ago
|
void aic_initDAC(void);
|
||
|
void aic_initADC(void);
|
||
|
unsigned int aic_readPage(uint8_t page, uint8_t reg);
|
||
|
bool aic_writePage(uint8_t page, uint8_t reg, uint8_t val);
|
||
8 years ago
|
bool aic_writeAddress(uint16_t address, uint8_t val);
|
||
8 years ago
|
bool aic_goToPage(uint8_t page);
|
||
7 years ago
|
|
||
8 years ago
|
};
|
||
|
|
||
|
#define TYMPAN_OUTPUT_HEADPHONE_JACK_OUT 1
|
||
|
|
||
8 years ago
|
//convenience names to use with inputSelect() to set whnch analog inputs to use
|
||
|
#define TYMPAN_INPUT_LINE_IN 1 //uses IN1
|
||
|
#define TYMPAN_INPUT_ON_BOARD_MIC 2 //uses IN2 analog inputs
|
||
|
#define TYMPAN_INPUT_JACK_AS_LINEIN 3 //uses IN3 analog inputs
|
||
|
#define TYMPAN_INPUT_JACK_AS_MIC 4 //uses IN3 analog inputs *and* enables mic bias
|
||
|
|
||
|
//names to use with setMicBias() to set the amount of bias voltage to use
|
||
|
#define TYMPAN_MIC_BIAS_OFF 0
|
||
|
#define TYMPAN_MIC_BIAS_1_25 1
|
||
|
#define TYMPAN_MIC_BIAS_1_7 2
|
||
|
#define TYMPAN_MIC_BIAS_2_5 3
|
||
|
#define TYMPAN_MIC_BIAS_VSUPPLY 4
|
||
8 years ago
|
#define TYMPAN_DEFAULT_MIC_BIAS TYMPAN_MIC_BIAS_2_5
|
||
|
|
||
|
#endif
|