36#define IIC_SLAVE_ADDR 0x3B
39#define IIC_SCLK_RATE 400000
42#define I2S_DATA_RX_L_REG 0x00
43#define I2S_DATA_RX_R_REG 0x04
44#define I2S_DATA_TX_L_REG 0x08
45#define I2S_DATA_TX_R_REG 0x0C
46#define I2S_STATUS_REG 0x10
120extern void write_audio_reg(
unsigned char u8RegAddr,
unsigned char u8Data,
149extern void audio_bypass(
unsigned int audio_mmap_size,
unsigned int nsamples,
150 unsigned int volume,
int uio_index);
164extern void audio_record(
unsigned int audio_mmap_size,
unsigned int *BufAddr,
165 unsigned int nsamples,
int uio_index);
180extern void audio_play(
unsigned int audio_mmap_size,
unsigned int *BufAddr,
181 unsigned int nsamples,
unsigned int volume,
194 unsigned int *BufAddr,
unsigned int nsamples,
195 unsigned int volume,
unsigned int repetitions);
204 unsigned int volume);
void audio_generate_tone(unsigned int frequency, uint32_t time_ms, unsigned int volume)
void deselect(void)
Function to deselect input, either LINE_IN, or MIC.
void audio_record(unsigned int audio_mmap_size, unsigned int *BufAddr, unsigned int nsamples, int uio_index)
Function to support audio recording without the audio codec controller.
void select_mic(void)
Function to select MIC as input.
void write_audio_reg(unsigned char u8RegAddr, unsigned char u8Data, int iic_fd)
void audio_repeat_play(unsigned int audio_mmap_size, unsigned int *BufAddr, unsigned int nsamples, unsigned int volume, unsigned int repetitions)
Function to play one audio fragment for multiple repititions.
void config_audio_codec(void)
void audio_play(unsigned int audio_mmap_size, unsigned int *BufAddr, unsigned int nsamples, unsigned int volume, int uio_index)
void audio_bypass(unsigned int audio_mmap_size, unsigned int nsamples, unsigned int volume, int uio_index)
Record and play the audio without storing in DRAM.
void audio_select_input(int input)
selects the audio input channel.
void audio_init(void)
Initializes the audio register. Sets the sampling frequency. defines several values such as audio rec...
void config_audio_pll(void)
void select_line_in(void)
Function to select LINE_IN as input.
@ R17_CONVERTER_CONTROL_0
@ R8_LEFT_DIFFERENTIAL_INPUT_VOLUME_CONTROL
@ R9_RIGHT_DIFFERENTIAL_INPUT_VOLUME_CONTROL
@ R29_PLAYBACK_HEADPHONE_LEFT_VOLUME_CONTROL
@ R41_CONTROL_PORT_PAD_CONTROL_1
@ R42_JACK_DETECT_PIN_CONTROL
@ R26_PLAYBACK_LR_MIXER_LEFT_LINE_OUTPUT_CONTROL
@ R5_RECORD_MIXER_LEFT_CONTROL_1
@ R22_PLAYBACK_MIXER_LEFT_CONTROL_0
@ R39_SERIAL_PORT_PAD_CONTROL
@ R34_PLAYBACK_POP_CLICK_SUPPRESSION
@ R18_CONVERTER_CONTROL_1
@ R6_RECORD_MIXER_RIGHT_CONTROL_0
@ R35_PLAYBACK_POWER_MANAGEMENT
@ R30_PLAYBACK_HEADPHONE_RIGHT_VOLUME_CONTROL
@ R58_SERIAL_INPUT_ROUTE_CONTROL
@ R27_PLAYBACK_LR_MIXER_RIGHT_LINE_OUTPUT_CONTROL
@ R59_SERIAL_OUTPUT_ROUTE_CONTROL
@ R23_PLAYBACK_MIXER_LEFT_CONTROL_1
@ R7_RECORD_MIXER_RIGHT_CONTROL_1
@ R3_RECORD_POWER_MANAGEMENT
@ R40_CONTROL_PORT_PAD_CONTROL_0
@ R4_RECORD_MIXER_LEFT_CONTROL_0
@ R31_PLAYBACK_LINE_OUTPUT_LEFT_VOLUME_CONTROL
@ R21_RIGHT_INPUT_DIGITAL_VOLUME
@ R32_PLAYBACK_LINE_OUTPUT_RIGHT_VOLUME_CONTROL
@ R24_PLAYBACK_MIXER_RIGHT_CONTROL_0
@ R10_RECORD_MICROPHONE_BIAS_CONTROL
@ R64_SERIAL_PORT_SAMPLING_RATE
@ R15_SERIAL_PORT_CONTROL_0
@ R25_PLAYBACK_MIXER_RIGHT_CONTROL_1
@ R28_PLAYBACK_LR_MIXER_MONO_OUTPUT_CONTROL
@ R16_SERIAL_PORT_CONTROL_1
@ R33_PLAYBACK_MONO_OUTPUT_CONTROL
@ R2_DIGITAL_MIC_JACK_DETECTION_CONTROL
@ R20_LEFT_INPUT_DIGITAL_VOLUME