arduino-audio-driver
Loading...
Searching...
No Matches
Classes | Namespaces | Enumerations | Variables
CS42L51.h File Reference

Header only C++ port of the CS42L51 BSP audio codec driver. More...

#include <stdint.h>
#include "Codecs/CodecConstants.h"
#include "DriverCommon.h"
#include "Platforms/API_Delay.h"
#include "Platforms/API_I2C.h"

Go to the source code of this file.

Classes

class  CS42L51
 Header-only driver class for the CS42L51 codec chip. More...
 

Namespaces

namespace  audio_driver
 Namespace for audio driver components.
 

Enumerations

enum  CS42L51Frequency : uint32_t {
  CS42L51_FREQUENCY_192K = 192000 , CS42L51_FREQUENCY_176K = 176400 , CS42L51_FREQUENCY_96K = 96000 , CS42L51_FREQUENCY_88K = 88200 ,
  CS42L51_FREQUENCY_48K = 48000 , CS42L51_FREQUENCY_44K = 44100 , CS42L51_FREQUENCY_32K = 32000 , CS42L51_FREQUENCY_22K = 22050 ,
  CS42L51_FREQUENCY_16K = 16000 , CS42L51_FREQUENCY_11K = 11025 , CS42L51_FREQUENCY_8K = 8000
}
 Audio frequencies. More...
 
enum  CS42L51InputDevice : uint32_t {
  CS42L51_IN_NONE = 0x0000 , CS42L51_IN_MIC1 = 0x0100 , CS42L51_IN_MIC2 = 0x0200 , CS42L51_IN_LINE1 = 0x0400 ,
  CS42L51_IN_LINE2 = 0x0800 , CS42L51_IN_LINE3 = 0x1000
}
 Audio input devices: can be combined with |. More...
 
enum  CS42L51Mute : uint8_t { CS42L51_MUTE_OFF = 0 , CS42L51_MUTE_ON = 1 }
 Mute commands. More...
 
enum  CS42L51OutputDevice : uint32_t { CS42L51_OUT_NONE = 0x0000 , CS42L51_OUT_HEADPHONE = 0x0001 }
 Audio output devices: can be combined with |. More...
 
enum  CS42L51PowerDownMode : uint8_t { CS42L51_PDWN_HW = 0x00 , CS42L51_PDWN_SW = 0x01 }
 Codec stop / power down options. More...
 
enum  CS42L51Protocol : uint8_t { CS42L51_PROTOCOL_L_JUSTIFIED = 0 , CS42L51_PROTOCOL_I2S = 1 , CS42L51_PROTOCOL_R_JUSTIFIED = 2 }
 Audio protocols. More...
 
enum  CS42L51Reg : uint8_t {
  CS42L51_CHIP_ID = 0x01 , CS42L51_PWR_CTRL_1 = 0x02 , CS42L51_MIC_PWR_SPEED_CTRL = 0x03 , CS42L51_INTERFACE_CTRL = 0x04 ,
  CS42L51_MIC_CTRL = 0x05 , CS42L51_ADC_CTRL = 0x06 , CS42L51_ADCX_INPUT_SELECT = 0x07 , CS42L51_DAC_OUTPUT_CTRL = 0x08 ,
  CS42L51_DAC_CTRL = 0x09 , CS42L51_ALCA_PGAA_CTRL = 0x0A , CS42L51_ALCB_PGAB_CTRL = 0x0B , CS42L51_ADCA_ATTENUATOR = 0x0C ,
  CS42L51_ADCB_ATTENUATOR = 0x0D , CS42L51_ADCA_MIXER_VOL_CTRL = 0x0E , CS42L51_ADCB_MIXER_VOL_CTRL = 0x0F , CS42L51_PCMA_MIXER_VOL_CTRL = 0x10 ,
  CS42L51_PCMB_MIXER_VOL_CTRL = 0x11 , CS42L51_BEEP_FREQ_AND_TIMING_CFG = 0x12 , CS42L51_BEEP_OFF_TIME_AND_VOL = 0x13 , CS42L51_BEEP_CFG_AND_TONE_CFG = 0x14 ,
  CS42L51_TONE_CTRL = 0x15 , CS42L51_AOUTA_VOL_CTRL = 0x16 , CS42L51_AOUTB_VOL_CTRL = 0x17 , CS42L51_ADC_PCM_CHANNEL_MIXER = 0x18 ,
  CS42L51_LIMITER_THR_SZC_DISABLE = 0x19 , CS42L51_LIMITER_RELEASE_RATE_REG = 0x1A , CS42L51_LIMITER_ATTACK_RATE_REG = 0x1B , CS42L51_ALC_ENABLE_AND_ATTACK_RATE = 0x1C ,
  CS42L51_ALC_RELEASE_RATE = 0x1D , CS42L51_ALC_THR = 0x1E , CS42L51_NOISE_GATE_CFG_AND_MISC = 0x1F , CS42L51_STATUS = 0x20 ,
  CS42L51_CHARGE_PUMP_FREQ = 0x21
}
 
enum  CS42L51Resolution : uint8_t { CS42L51_RESOLUTION_16B = 0x05 , CS42L51_RESOLUTION_18B = 0x04 , CS42L51_RESOLUTION_20B = 0x03 , CS42L51_RESOLUTION_24B = 0x02 }
 Audio resolutions (only applicable for CS42L51_PROTOCOL_R_JUSTIFIED) More...
 
enum  CS42L51Status : int32_t { CS42L51_OK = 0 , CS42L51_ERROR = -1 }
 Component status. More...
 
enum  CS42L51VolumeSelect : uint8_t { CS42L51_VOLUME_INPUT = 0 , CS42L51_VOLUME_OUTPUT = 1 }
 Volume input/output selection. More...
 

Variables

static constexpr uint8_t CS42L51_ID = 0xD8
 CS42L51 chip identification.
 
static constexpr uint8_t CS42L51_ID_MASK = 0xF8
 

Detailed Description

Header only C++ port of the CS42L51 BSP audio codec driver.

Attention

Copyright (c) 2017-2019 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.