#include <float.h>
#include <limits.h>
#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include "cybsp.h"
#include "cyhal.h"
#include "picovoice.h"
Go to the source code of this file.
Macros | |
#define | AUDIO_SYS_CLOCK_HZ (24576000u) |
#define | DECIMATION_RATE (96u) |
#define | PDM_CLK (P10_4) |
#define | PDM_DATA (P10_5) |
#define | PV_AUDIO_REC_AUDIO_FREQUENCY (16000U) |
#define | PV_AUDIO_REC_CHANNEL_NUMBER (1) |
#define | PV_AUDIO_REC_RECORD_BUFFER_SIZE (512) |
Functions | |
cy_rslt_t | pdm_pcm_clock_init (void) |
void | pdm_pcm_isr_handler (void *arg, cyhal_pdm_pcm_event_t event) |
void | pv_audio_rec_deinit (void) |
const int16_t * | pv_audio_rec_get_new_buffer (void) |
pv_status_t | pv_audio_rec_init (void) |
float | pv_audio_rec_loudness_db (void) |
pv_status_t | pv_audio_rec_start (void) |
pv_status_t | pv_audio_rec_stop (void) |
Variables | |
cyhal_clock_t | audio_clock |
static int32_t | last_read_index = -1 |
cyhal_pdm_pcm_t | pdm_pcm |
const cyhal_pdm_pcm_cfg_t | pdm_pcm_cfg |
static int16_t | ping_pong_buffer [2][PV_AUDIO_REC_RECORD_BUFFER_SIZE] |
cyhal_clock_t | pll_clock |
struct { | |
uint32_t audio_frequency | |
uint32_t channel_number | |
bool is_recording | |
uint32_t record_buffer_size | |
} | pv_audio_rec |
static int32_t | read_index = -1 |
static int32_t | write_index = 1 |
#define AUDIO_SYS_CLOCK_HZ (24576000u) |
Definition at line 29 of file psoc062s2/src/pv_audio_rec.c.
#define DECIMATION_RATE (96u) |
Definition at line 28 of file psoc062s2/src/pv_audio_rec.c.
#define PDM_CLK (P10_4) |
Definition at line 31 of file psoc062s2/src/pv_audio_rec.c.
#define PDM_DATA (P10_5) |
Definition at line 30 of file psoc062s2/src/pv_audio_rec.c.
#define PV_AUDIO_REC_AUDIO_FREQUENCY (16000U) |
Definition at line 25 of file psoc062s2/src/pv_audio_rec.c.
#define PV_AUDIO_REC_CHANNEL_NUMBER (1) |
Definition at line 26 of file psoc062s2/src/pv_audio_rec.c.
#define PV_AUDIO_REC_RECORD_BUFFER_SIZE (512) |
Definition at line 27 of file psoc062s2/src/pv_audio_rec.c.
cy_rslt_t pdm_pcm_clock_init | ( | void | ) |
Definition at line 61 of file psoc062s2/src/pv_audio_rec.c.
void pdm_pcm_isr_handler | ( | void * | arg, |
cyhal_pdm_pcm_event_t | event | ||
) |
Definition at line 164 of file psoc062s2/src/pv_audio_rec.c.
void pv_audio_rec_deinit | ( | void | ) |
Definition at line 173 of file psoc062s2/src/pv_audio_rec.c.
const int16_t* pv_audio_rec_get_new_buffer | ( | void | ) |
Definition at line 150 of file psoc062s2/src/pv_audio_rec.c.
pv_status_t pv_audio_rec_init | ( | void | ) |
Definition at line 96 of file psoc062s2/src/pv_audio_rec.c.
float pv_audio_rec_loudness_db | ( | void | ) |
Definition at line 133 of file psoc062s2/src/pv_audio_rec.c.
pv_status_t pv_audio_rec_start | ( | void | ) |
Definition at line 118 of file psoc062s2/src/pv_audio_rec.c.
pv_status_t pv_audio_rec_stop | ( | void | ) |
Definition at line 127 of file psoc062s2/src/pv_audio_rec.c.
cyhal_clock_t audio_clock |
Definition at line 36 of file psoc062s2/src/pv_audio_rec.c.
uint32_t audio_frequency |
Definition at line 56 of file psoc062s2/src/pv_audio_rec.c.
uint32_t channel_number |
Definition at line 55 of file psoc062s2/src/pv_audio_rec.c.
bool is_recording |
Definition at line 58 of file psoc062s2/src/pv_audio_rec.c.
|
static |
Definition at line 50 of file psoc062s2/src/pv_audio_rec.c.
cyhal_pdm_pcm_t pdm_pcm |
Definition at line 35 of file psoc062s2/src/pv_audio_rec.c.
const cyhal_pdm_pcm_cfg_t pdm_pcm_cfg |
Definition at line 39 of file psoc062s2/src/pv_audio_rec.c.
|
static |
Definition at line 49 of file psoc062s2/src/pv_audio_rec.c.
cyhal_clock_t pll_clock |
Definition at line 37 of file psoc062s2/src/pv_audio_rec.c.
struct { ... } pv_audio_rec |
|
static |
Definition at line 51 of file psoc062s2/src/pv_audio_rec.c.
uint32_t record_buffer_size |
Definition at line 57 of file psoc062s2/src/pv_audio_rec.c.
|
static |
Definition at line 52 of file psoc062s2/src/pv_audio_rec.c.