libpynq
(release 5EID0-2023 version 0.3.0 of 2024-04-25 09:42 )
|
Go to the documentation of this file.
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
120 extern void write_audio_reg(
unsigned char u8RegAddr,
unsigned char u8Data,
149 extern void audio_bypass(
unsigned int audio_mmap_size,
unsigned int nsamples,
150 unsigned int volume,
int uio_index);
164 extern void audio_record(
unsigned int audio_mmap_size,
unsigned int *BufAddr,
165 unsigned int nsamples,
int uio_index);
180 extern 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);
207 int volume, uint32_t *nsamples);
@ R26_PLAYBACK_LR_MIXER_LEFT_LINE_OUTPUT_CONTROL
void audio_select_input(int input)
selects the audio input channel.
@ R3_RECORD_POWER_MANAGEMENT
@ R40_CONTROL_PORT_PAD_CONTROL_0
@ R9_RIGHT_DIFFERENTIAL_INPUT_VOLUME_CONTROL
@ R30_PLAYBACK_HEADPHONE_RIGHT_VOLUME_CONTROL
@ R27_PLAYBACK_LR_MIXER_RIGHT_LINE_OUTPUT_CONTROL
@ R8_LEFT_DIFFERENTIAL_INPUT_VOLUME_CONTROL
@ R22_PLAYBACK_MIXER_LEFT_CONTROL_0
@ R4_RECORD_MIXER_LEFT_CONTROL_0
void audio_record_response_start(void)
@ R29_PLAYBACK_HEADPHONE_LEFT_VOLUME_CONTROL
@ R21_RIGHT_INPUT_DIGITAL_VOLUME
@ R42_JACK_DETECT_PIN_CONTROL
@ R23_PLAYBACK_MIXER_LEFT_CONTROL_1
@ R39_SERIAL_PORT_PAD_CONTROL
@ R58_SERIAL_INPUT_ROUTE_CONTROL
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.
@ R33_PLAYBACK_MONO_OUTPUT_CONTROL
@ R20_LEFT_INPUT_DIGITAL_VOLUME
@ R41_CONTROL_PORT_PAD_CONTROL_1
void write_audio_reg(unsigned char u8RegAddr, unsigned char u8Data, int iic_fd)
void config_audio_pll(void)
void config_audio_codec(void)
void audio_generate_tone(unsigned int frequency, uint32_t time_ms, unsigned int volume)
@ R6_RECORD_MIXER_RIGHT_CONTROL_0
@ R32_PLAYBACK_LINE_OUTPUT_RIGHT_VOLUME_CONTROL
@ R18_CONVERTER_CONTROL_1
void select_line_in(void)
Function to select LINE_IN as input.
void audio_init(void)
Initializes the audio register. Sets the sampling frequency. defines several values such as audio rec...
@ R10_RECORD_MICROPHONE_BIAS_CONTROL
@ R28_PLAYBACK_LR_MIXER_MONO_OUTPUT_CONTROL
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.
@ R2_DIGITAL_MIC_JACK_DETECTION_CONTROL
@ R17_CONVERTER_CONTROL_0
@ R7_RECORD_MIXER_RIGHT_CONTROL_1
void audio_play(unsigned int audio_mmap_size, unsigned int *BufAddr, unsigned int nsamples, unsigned int volume, int uio_index)
@ R5_RECORD_MIXER_LEFT_CONTROL_1
int32_t * audio_record_response(unsigned int frequency, uint32_t nperiods, unsigned int volume, uint32_t *nsamples)
void deselect(void)
Function to deselect input, either LINE_IN, or MIC.
@ R59_SERIAL_OUTPUT_ROUTE_CONTROL
@ R34_PLAYBACK_POP_CLICK_SUPPRESSION
@ R16_SERIAL_PORT_CONTROL_1
@ R25_PLAYBACK_MIXER_RIGHT_CONTROL_1
void select_mic(void)
Function to select MIC as input.
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.
@ R35_PLAYBACK_POWER_MANAGEMENT
@ R31_PLAYBACK_LINE_OUTPUT_LEFT_VOLUME_CONTROL
@ R24_PLAYBACK_MIXER_RIGHT_CONTROL_0
@ R15_SERIAL_PORT_CONTROL_0
@ R64_SERIAL_PORT_SAMPLING_RATE