CARME-M4 BSP  V1.5
cs42l51.h
Go to the documentation of this file.
1 #ifndef __CS42L51_H__
2 #define __CS42L51_H__
3 
72 #ifdef __cplusplus
73  extern "C" {
74 #endif /* __cplusplus */
75 
76 /*----- Header-Files -------------------------------------------------------*/
77 #include <stdint.h> /* Standard integer formats */
78 
79 /*----- Macros -------------------------------------------------------------*/
80 #define CODEC_I2C CARME_I2C_AUDIO
81 #define CODEC_I2S SPI2
82 #define CODEC_I2S_EXT I2S2ext
83 #define CODEC_I2S_CLK RCC_APB1Periph_SPI2
84 #define CODEC_ADDRESS 0x94
86 #define CHIP_ID 0x01
87 #define POWER_CONTROL 0x02
88 #define MIC_POWER_AND_SPEED 0x03
89 #define INTERFACE_CONTROL 0x04
90 #define MIC_CONTROL 0x05
91 #define ADC_CONTROL 0x06
92 #define ADC_CONFIGURE 0x07
93 #define DAC_OUTPUT_CONTROL 0x08
94 #define DAC_CONTROL 0x09
95 #define ALCA_AND_PGAA_CONTROL 0x0A
96 #define ALCB_AND_PGAB_CONTROL 0x0B
97 #define ADCX_ATTENUATOR 0x0D
98 #define ADCX_MIXER_VOLUME_CONTROL 0x0F
99 #define PCMA_MIXER_VOLUME_CONTROL 0x10
100 #define PCMB_MIXER_VOLUME_CONTROL 0x11
101 #define BEEP_FREQUENCY_AND_TIMING 0x12
102 #define BEEP_OFF_TIME_AND_VOLUME 0x13
103 #define BEEP_AND_TONE_CONFIGURATION 0x14
104 #define TONE_CONTROL 0x15
105 #define AOUTA_VOLUME_CONTROL 0x16
106 #define AOUTB_VOLUME_CONTROL 0x17
107 #define PCM_CHANNEL_MIXER 0x18
108 #define LIMITER_THRESHOLD 0x19
109 #define LIMITER_RELEASE 0x1A
110 #define LIMITER_ATTACK 0x1B
111 #define ALC_ENABLE_AND_ATTACK 0x1C
112 #define ALC_RELEASE 0x1D
113 #define ALC_THRESHOLD 0x1E
114 #define NOISE_GATE 0x1F
115 #define STATUS_REGISTER 0x20
116 #define CHARGE_PUMP_FREQUENCY 0x21
118 /*----- Data types ---------------------------------------------------------*/
119 
120 /*----- Function prototypes ------------------------------------------------*/
121 extern uint8_t CS42L51_Init(int8_t Volume);
122 extern uint8_t CS42L51_Status(void);
123 extern void CS42L51_VolumeOutCtrl(int8_t Volume);
124 extern void CS42L51_Mute(uint8_t on);
125 
126 /*----- Data ---------------------------------------------------------------*/
127 
128 #ifdef __cplusplus
129  }
130 #endif /* __cplusplus */
131 
137 #endif /* __CS42L51_H__ */
uint8_t CS42L51_Init(int8_t Volume)
Codec CS42L51 low-layer and register initialization.
Definition: cs42l51.c:133
uint8_t CS42L51_Status(void)
Get the status of the cs42l51 codec.
Definition: cs42l51.c:315
void CS42L51_Mute(uint8_t on)
Mute the CS42L51 output.
Definition: cs42l51.c:369
void CS42L51_VolumeOutCtrl(int8_t Volume)
Codec CS42L51 output volume control.
Definition: cs42l51.c:337