libpynq  (release 5EID0-2023 version 0.3.0 of 2024-04-25 09:42 )
audio.c File Reference
#include "audio.h"
#include <libpynq.h>
#include <stdint.h>
#include "i2cps.h"
#include "uio.h"
#include <fcntl.h>
#include <linux/i2c-dev.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <time.h>
#include <unistd.h>
Include dependency graph for audio.c:

Go to the source code of this file.

Macros

#define SAMPLE_RATE   48000
 
#define LOG_DOMAIN   "audio"
 

Functions

void audio_init (void)
 
void audio_select_input (int input)
 
void write_audio_reg (unsigned char u8RegAddr, unsigned char u8Data, int iic_fd)
 
uint8_t read_audio_reg (unsigned char u8RegAddr, int iic_fd)
 
void config_audio_pll (void)
 
void config_audio_codec (void)
 
void select_line_in (void)
 
void select_mic (void)
 
void deselect (void)
 
void audio_bypass (unsigned int audio_mmap_size, unsigned int nsamples, unsigned int volume, int uio_index)
 
void audio_record (unsigned int audio_mmap_size, unsigned int *BufAddr, unsigned int nsamples, int uio_index)
 
void audio_play (unsigned int audio_mmap_size, unsigned int *BufAddr, unsigned int nsamples, unsigned int volume, int uio_index)
 
void audio_repeat_play (unsigned int audio_mmap_size, unsigned int *BufAddr, unsigned int nsamples, unsigned int volume, unsigned int repetitions)
 
void audio_generate_tone (unsigned int frequency, uint32_t time_ms, unsigned int volume)
 
void audio_record_response_start (void)
 
int32_t * audio_record_response (unsigned int frequency, uint32_t nperiods, unsigned int volume, uint32_t *nsamples)
 

Macro Definition Documentation

◆ LOG_DOMAIN

#define LOG_DOMAIN   "audio"

Definition at line 70 of file audio.c.

◆ SAMPLE_RATE

#define SAMPLE_RATE   48000

Definition at line 67 of file audio.c.

Function Documentation

◆ read_audio_reg()

uint8_t read_audio_reg ( unsigned char  u8RegAddr,
int  iic_fd 
)

Definition at line 101 of file audio.c.

Here is the call graph for this function:
Here is the caller graph for this function: