HPM SDK
HPMicro Software Development Kit
hpm_vad_drv.h File Reference
#include "hpm_common.h"
#include "hpm_vad_regs.h"

Go to the source code of this file.

Data Structures

struct  vad_config
 vad config More...
 

Macros

#define VAD_EVENT_VAD   (1U << 7)
 vad event More...
 
#define VAD_EVENT_FIFO_DATA_AVAILABLE   (1U << 6)
 
#define VAD_EVENT_MEMBUF_EMPTY   (1U << 5)
 
#define VAD_EVENT_FIFO_OVERFLOW   (1U << 4)
 
#define VAD_EVENT_IIR_OVERLOAD   (1U << 3)
 
#define VAD_EVENT_IIR_OVERFLOW   (1U << 2)
 
#define VAD_EVENT_CIC_OVERLOAD_ERROR   (1U << 1)
 
#define VAD_EVENT_CIC_STA_ERROR   (1U << 0)
 

Typedefs

typedef struct vad_config vad_config_t
 vad config More...
 

Functions

static void vad_set_capture_delay (VAD_Type *ptr, uint8_t delay)
 set capture deplay cycle More...
 
static void vad_set_pdm_clock_half_div (VAD_Type *ptr, uint8_t div)
 set pdm clock hald_divider More...
 
static void vad_enable_irq (VAD_Type *ptr, uint32_t irq_mask)
 enable irq More...
 
static void vad_disable_irq (VAD_Type *ptr, uint32_t irq_mask)
 disable irq More...
 
static void vad_disable_buffer (VAD_Type *ptr)
 disable buffer More...
 
static void vad_enable_buffer (VAD_Type *ptr)
 enable buffer More...
 
static void vad_set_fifo_threshold (VAD_Type *ptr, uint8_t threshold)
 set fifo threshold More...
 
static void vad_enable_pdm_clock_out (VAD_Type *ptr)
 enable pdm clock out More...
 
static void vad_disable_pdm_clock_out (VAD_Type *ptr)
 disable pdm clock out More...
 
static void vad_set_pdm_clock_capture_level (VAD_Type *ptr, uint8_t level)
 set pdm clock polarity More...
 
static void vad_set_channel_number (VAD_Type *ptr, bool two_channels)
 set channel number More...
 
static uint32_t vad_get_status (VAD_Type *ptr)
 get status More...
 
static void vad_clear_status (VAD_Type *ptr, uint32_t mask)
 slear status More...
 
static uint32_t vad_get_data (VAD_Type *ptr)
 get data More...
 
static void vad_software_reset (VAD_Type *ptr)
 software reset More...
 
static void vad_start (VAD_Type *ptr)
 start More...
 
static void vad_stop (VAD_Type *ptr)
 stop More...
 
static bool vad_is_running (VAD_Type *ptr)
 check whether vad is running More...
 
static void vad_enable_fifo (VAD_Type *ptr)
 enable fifo More...
 
static void vad_disable_fifo (VAD_Type *ptr)
 disable fifo More...
 
static uint32_t vad_get_coef_value (VAD_Type *ptr, uint32_t index)
 get coefficient value More...
 
static void vad_set_post_scale (VAD_Type *ptr, uint8_t post_scale)
 set ouptput value post scale More...
 
static void vad_set_amplify (VAD_Type *ptr, uint16_t high, uint16_t low)
 set sampling signal amplitude limits More...
 
void vad_get_default_config (VAD_Type *ptr, vad_config_t *config)
 get default config More...
 
void vad_init (VAD_Type *ptr, vad_config_t *config)
 initialization More...
 
void vad_reset (VAD_Type *ptr)
 reset More...