|
arduino-audio-driver
|
The CS42448 CODEC from Cirrus Logic provides six multi-bit ana- log-to-digital and eight multi-bit digital-to-analog delta-sigma converters. More...
#include <CS42448.h>
Public Types | |
| enum class | Format { LeftJustified24Bit = 0 , I2S = 1 , RightJustified24Bits = 2 , RightJustified16Bits = 3 , OneLine1 = 4 , OneLine2 = 5 , TDM = 6 } |
| enum class | FunctionalMode { MasterSingleSpeed = 0 , MasterDoubleSpeed , MasterQuadSpeed , SlaveAutoDetect } |
| enum class | InterruptControl { ActiveHigh = 0 , ActiveLow , OpenDrain } |
| enum class | MasterFrequency { MasterSingleSpeed = 0 , MasterDoubleSpeed = 2 , MasterQuadSpeed = 4 } |
| enum class | SoftRamp { ImmediateChange = 0 , ZeroCross , SoftRamp , SoftRampOnZeroCross } |
Public Member Functions | |
| bool | begin (codec_config_t codecCfg, i2c_bus_handle_t handle, int i2cAddress=-1) |
| bool | end () |
| Mute ADC and DAC and then power down. | |
| bool | freeze (bool freeze) |
| All mute and volume values are activated on unfreeze. | |
| uint8_t | getChipID () |
| uint8_t | getChipRevision () |
| bool | getInterruptStatus (uint8_t &status) |
| int8_t | getVolumeADC (uint8_t channel) |
| int | getVolumeDAC (uint8_t channel) |
| bool | setADCHighPassFilterFreeze12 (bool freeze) |
| bool | setADCHighPassFilterFreeze3 (bool freeze) |
| bool | setADCInvert (int invert) |
| bool | setADCInvert (uint8_t channel, int invert) |
| bool | setADCSingleEnded (bool on) |
| bool | setADCSingleEnded (int adc, bool on) |
| bool | setAutoMute (bool autoMute) |
| bool | setDACDeEmphasisControl (bool on) |
| bool | setDACInvert (int invert) |
| bool | setDACInvert (uint8_t channel, int invert) |
| bool | setFormat (CS42448::Format fmt) |
| bool | setInterrupControl (InterruptControl value) |
| bool | setMute (bool mute) |
| bool | setMuteADC (bool mute) |
| bool | setMuteDAC (bool mute) |
| bool | setMuteDAC (uint8_t line, bool mute) |
| bool | setPower (bool active) |
| Device Power. | |
| bool | setPowerADC (bool active) |
| bool | setPowerADC (int adc, bool active) |
| Power on individual ADC from 1 to 3. | |
| bool | setPowerAll (bool active) |
| Power all ADC and DAC and Device. | |
| bool | setPowerDAC (bool active) |
| bool | setPowerDAC (int dac, bool active) |
| Power on individual DAC from 1 to 4. | |
| bool | setPowerDevices (bool active) |
| Power only the selected devices. | |
| bool | setSampleRate (int rate) |
| Single-Speed Mode (SSM) supports input sample rates up to 50 kHz and uses a 128x oversampling ratio. Double-Speed Mode (DSM) supports input sample rates up to 100 kHz and uses an oversampling ratio of 64x. Quad-Speed Mode (QSM) supports input sample rates up to 200 kHz and uses an oversampling ratio of 32x (Note: QSM for the ADC is only supported in the I2S, Left-Justified, Right-Justified interface formats. | |
| bool | setSoftRampControl (CS42448::SoftRamp softRamp) |
| bool | setVolumeADC (int8_t volume) |
| Set volume in 0.5 dB increments. -128 .. 127 is -64dB .. 24dB; 0 = 0dB. | |
| bool | setVolumeADC (uint8_t channel, int8_t volume) |
| bool | setVolumeDAC (uint8_t channel, uint8_t vol) |
| bool | setVolumeDAC (uint8_t vol) |
Static Public Attributes | |
| static constexpr uint8_t | CS42448_ADC_Channel_Invert = 0x17 |
| static constexpr uint8_t | CS42448_ADC_Control_DAC_DeEmphasis = 0x05 |
| static constexpr uint8_t | CS42448_ADC_DIF_I2S = (1 << 0) |
| static constexpr uint8_t | CS42448_ADC_DIF_TDM = (3 << 1) |
| static constexpr uint8_t | CS42448_ADC_FM_SLAVE = (3 << 4) |
| static constexpr uint8_t | CS42448_AIN1_Volume_Control = 0x11 |
| static constexpr uint8_t | CS42448_AIN2_Volume_Control = 0x12 |
| static constexpr uint8_t | CS42448_AIN3_Volume_Control = 0x13 |
| static constexpr uint8_t | CS42448_AIN4_Volume_Control = 0x14 |
| static constexpr uint8_t | CS42448_AIN5_Volume_Control = 0x15 |
| static constexpr uint8_t | CS42448_AIN6_Volume_Control = 0x16 |
| static constexpr uint8_t | CS42448_AOUT1_Volume_Control = 0x08 |
| static constexpr uint8_t | CS42448_AOUT2_Volume_Control = 0x09 |
| static constexpr uint8_t | CS42448_AOUT3_Volume_Control = 0x0A |
| static constexpr uint8_t | CS42448_AOUT4_Volume_Control = 0x0B |
| static constexpr uint8_t | CS42448_AOUT5_Volume_Control = 0x0C |
| static constexpr uint8_t | CS42448_AOUT6_Volume_Control = 0x0D |
| static constexpr uint8_t | CS42448_AOUT7_Volume_Control = 0x0E |
| static constexpr uint8_t | CS42448_AOUT8_Volume_Control = 0x0F |
| static constexpr uint8_t | CS42448_Chip_ID = 0x01 |
| static constexpr uint8_t | CS42448_DAC_Channel_Invert = 0x10 |
| static constexpr uint8_t | CS42448_DAC_Channel_Mute = 0x07 |
| static constexpr uint8_t | CS42448_DAC_DIF_I2S = (1 << 3) |
| static constexpr uint8_t | CS42448_DAC_DIF_TDM = (3 << 4) |
| static constexpr uint8_t | CS42448_DAC_FM_SLAVE = (3 << 6) |
| static constexpr uint8_t | CS42448_Functional_Mode = 0x03 |
| static constexpr uint8_t | CS42448_Interface_Formats = 0x04 |
| static constexpr uint8_t | CS42448_MUTEC_Pin_Control = 0x1B |
| static constexpr uint8_t | CS42448_PDN = (1 << 0) |
| static constexpr uint8_t | CS42448_PDN_ADC1 = (1 << 5) |
| static constexpr uint8_t | CS42448_PDN_ADC2 = (1 << 6) |
| static constexpr uint8_t | CS42448_PDN_ADC3 = (1 << 7) |
| static constexpr uint8_t | CS42448_PDN_DAC1 = (1 << 1) |
| static constexpr uint8_t | CS42448_PDN_DAC2 = (1 << 2) |
| static constexpr uint8_t | CS42448_PDN_DAC3 = (1 << 3) |
| static constexpr uint8_t | CS42448_PDN_DAC4 = (1 << 4) |
| static constexpr uint8_t | CS42448_Power_Control = 0x02 |
| static constexpr uint8_t | CS42448_Status = 0x19 |
| static constexpr uint8_t | CS42448_Status_Control = 0x18 |
| static constexpr uint8_t | CS42448_Status_Mask = 0x1A |
| static constexpr uint8_t | CS42448_Transition_Control = 0x06 |
Protected Member Functions | |
| bool | readReg (uint8_t reg, uint8_t *outdata, int datalen=1) |
| uint8_t | setBit (uint8_t number, uint8_t n, bool x) |
| bool | setFormat () |
| Set I2S format based on codec_config. | |
| bool | writeReg (uint8_t reg, uint8_t *value, int len) |
| bool | writeReg (uint8_t reg, uint8_t value) |
Protected Attributes | |
| codec_config_t | codec_config |
| i2c_bus_handle_t | i2c |
| int | i2c_address = 0x48 |
| bool | is_active = false |
The CS42448 CODEC from Cirrus Logic provides six multi-bit ana- log-to-digital and eight multi-bit digital-to-analog delta-sigma converters.
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
inline |
|
inline |
Mute ADC and DAC and then power down.
|
inline |
All mute and volume values are activated on unfreeze.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprotected |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprotected |
|
inline |
|
inline |
|
inline |
|
inlineprotected |
Set I2S format based on codec_config.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Device Power.
|
inline |
|
inline |
Power on individual ADC from 1 to 3.
|
inline |
Power all ADC and DAC and Device.
|
inline |
|
inline |
Power on individual DAC from 1 to 4.
|
inline |
Power only the selected devices.
|
inline |
Single-Speed Mode (SSM) supports input sample rates up to 50 kHz and uses a 128x oversampling ratio. Double-Speed Mode (DSM) supports input sample rates up to 100 kHz and uses an oversampling ratio of 64x. Quad-Speed Mode (QSM) supports input sample rates up to 200 kHz and uses an oversampling ratio of 32x (Note: QSM for the ADC is only supported in the I2S, Left-Justified, Right-Justified interface formats.
|
inline |
|
inline |
Set volume in 0.5 dB increments. -128 .. 127 is -64dB .. 24dB; 0 = 0dB.
|
inline |
|
inline |
Sets signal levels in 0.5 dB increment from 0 dB to -127.5 dB; Value range is from 0 to 256; e.g 0 = 0 DB; 180 = -90 DB
|
inline |
|
inlineprotected |
|
inlineprotected |
|
protected |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
protected |
|
protected |
|
protected |