HPM SDK
HPMicro Software Development Kit
DAO driver APIs

DAO driver APIs. More...

Data Structures

struct  dao_config
 DAO config. More...
 

Macros

#define DAO_CHANNEL_LEFT_ONLY   DAO_CTRL_LEFT_EN_MASK
 DAO channel selection. More...
 
#define DAO_CHANNEL_RIGHT_ONLY   DAO_CTRL_RIGHT_EN_MASK
 
#define DAO_CHANNEL_BOTH    (DAO_CTRL_RIGHT_EN_MASK | DAO_CTRL_LEFT_EN_MASK)
 
#define DAO_DEFAULT_OUTPUT_ALL_LOW   (0U)
 DAO default output. More...
 
#define DAO_DEFAULT_OUTPUT_ALL_HIGH   (1U)
 
#define DAO_DEFAULT_OUTPUT_P_HIGH_N_LOW   (2U)
 
#define DAO_DEFAULT_OUTPUT_DISABLED   (3U)
 

Typedefs

typedef struct dao_config dao_config_t
 DAO config. More...
 

Enumerations

enum  dao_channel_t { dao_right_channel = DAO_CTRL_RIGHT_EN_MASK , dao_left_channel = DAO_CTRL_LEFT_EN_MASK }
 

Functions

static void dao_config_hpf (DAO_Type *ptr, uint32_t hpf_coef_ma, uint32_t hpf_coef_b, bool enable)
 config high pass filter More...
 
static void dao_enable_hpf (DAO_Type *ptr)
 enable high pass filter More...
 
static void dao_disable_hpf (DAO_Type *ptr)
 disable high pass filter More...
 
static void dao_enable_channel (DAO_Type *ptr, uint32_t ch)
 enable channel More...
 
static void dao_disable_channel (DAO_Type *ptr, uint32_t ch)
 disable channel More...
 
static void dao_enable_mono_output (DAO_Type *ptr)
 enable mono output More...
 
static void dao_disable_mono_output (DAO_Type *ptr)
 disable mono output More...
 
static void dao_enable_remap (DAO_Type *ptr)
 enable remap More...
 
static void dao_disable_remap (DAO_Type *ptr)
 disable remap More...
 
static void dao_invert_output (DAO_Type *ptr, bool invert)
 invert output More...
 
static void dao_force_output (DAO_Type *ptr, uint8_t output)
 force pads output with certain level More...
 
static void dao_enable_false_run (DAO_Type *ptr, bool enable)
 enable false run when false run mode is enabled, the module continues to consume data, no actual output on pads. More...
 
static void dao_software_reset (DAO_Type *ptr)
 software reset More...
 
static bool dao_is_running (DAO_Type *ptr)
 check whether DAO is running More...
 
static void dao_start (DAO_Type *ptr)
 start More...
 
static void dao_stop (DAO_Type *ptr)
 stop More...
 
hpm_stat_t dao_init (DAO_Type *ptr, dao_config_t *config)
 initlization More...
 
void dao_get_default_config (DAO_Type *ptr, dao_config_t *config)
 get default config More...
 

Detailed Description

DAO driver APIs.

Macro Definition Documentation

◆ DAO_CHANNEL_BOTH

#define DAO_CHANNEL_BOTH    (DAO_CTRL_RIGHT_EN_MASK | DAO_CTRL_LEFT_EN_MASK)

◆ DAO_CHANNEL_LEFT_ONLY

#define DAO_CHANNEL_LEFT_ONLY   DAO_CTRL_LEFT_EN_MASK

#include <drivers/inc/hpm_dao_drv.h>

DAO channel selection.

◆ DAO_CHANNEL_RIGHT_ONLY

#define DAO_CHANNEL_RIGHT_ONLY   DAO_CTRL_RIGHT_EN_MASK

◆ DAO_DEFAULT_OUTPUT_ALL_HIGH

#define DAO_DEFAULT_OUTPUT_ALL_HIGH   (1U)

◆ DAO_DEFAULT_OUTPUT_ALL_LOW

#define DAO_DEFAULT_OUTPUT_ALL_LOW   (0U)

#include <drivers/inc/hpm_dao_drv.h>

DAO default output.

◆ DAO_DEFAULT_OUTPUT_DISABLED

#define DAO_DEFAULT_OUTPUT_DISABLED   (3U)

◆ DAO_DEFAULT_OUTPUT_P_HIGH_N_LOW

#define DAO_DEFAULT_OUTPUT_P_HIGH_N_LOW   (2U)

Typedef Documentation

◆ dao_config_t

typedef struct dao_config dao_config_t

#include <drivers/inc/hpm_dao_drv.h>

DAO config.

Enumeration Type Documentation

◆ dao_channel_t

#include <drivers/inc/hpm_dao_drv.h>

Enumerator
dao_right_channel 
dao_left_channel 

Function Documentation

◆ dao_config_hpf()

static void dao_config_hpf ( DAO_Type ptr,
uint32_t  hpf_coef_ma,
uint32_t  hpf_coef_b,
bool  enable 
)
inlinestatic

#include <drivers/inc/hpm_dao_drv.h>

config high pass filter

Parameters
[in]ptrDAO base address
[in]hpf_coef_mahigh pass filter a coefficient's complement
[in]hpf_coef_bhigh pass filter b coefficient
[in]enable
  • true: enable
  • false: disable

◆ dao_disable_channel()

static void dao_disable_channel ( DAO_Type ptr,
uint32_t  ch 
)
inlinestatic

#include <drivers/inc/hpm_dao_drv.h>

disable channel

Parameters
[in]ptrDAO base address
[in]chchannel defined in dao_channel_t

◆ dao_disable_hpf()

static void dao_disable_hpf ( DAO_Type ptr)
inlinestatic

#include <drivers/inc/hpm_dao_drv.h>

disable high pass filter

Parameters
[in]ptrDAO base address

◆ dao_disable_mono_output()

static void dao_disable_mono_output ( DAO_Type ptr)
inlinestatic

#include <drivers/inc/hpm_dao_drv.h>

disable mono output

Parameters
[in]ptrDAO base address

◆ dao_disable_remap()

static void dao_disable_remap ( DAO_Type ptr)
inlinestatic

#include <drivers/inc/hpm_dao_drv.h>

disable remap

Parameters
[in]ptrDAO base address

◆ dao_enable_channel()

static void dao_enable_channel ( DAO_Type ptr,
uint32_t  ch 
)
inlinestatic

#include <drivers/inc/hpm_dao_drv.h>

enable channel

Parameters
[in]ptrDAO base address
[in]chchannel defined in dao_channel_t

◆ dao_enable_false_run()

static void dao_enable_false_run ( DAO_Type ptr,
bool  enable 
)
inlinestatic

#include <drivers/inc/hpm_dao_drv.h>

enable false run when false run mode is enabled, the module continues to consume data, no actual output on pads.

Parameters
[in]ptrDAO base address
[in]enable
  • true: enable
  • false: disable

◆ dao_enable_hpf()

static void dao_enable_hpf ( DAO_Type ptr)
inlinestatic

#include <drivers/inc/hpm_dao_drv.h>

enable high pass filter

Parameters
[in]ptrDAO base address

◆ dao_enable_mono_output()

static void dao_enable_mono_output ( DAO_Type ptr)
inlinestatic

#include <drivers/inc/hpm_dao_drv.h>

enable mono output

Parameters
[in]ptrDAO base address

◆ dao_enable_remap()

static void dao_enable_remap ( DAO_Type ptr)
inlinestatic

#include <drivers/inc/hpm_dao_drv.h>

enable remap

Parameters
[in]ptrDAO base address

◆ dao_force_output()

static void dao_force_output ( DAO_Type ptr,
uint8_t  output 
)
inlinestatic

#include <drivers/inc/hpm_dao_drv.h>

force pads output with certain level

Parameters
[in]ptrDAO base address
[in]outputoutput level

◆ dao_get_default_config()

void dao_get_default_config ( DAO_Type ptr,
dao_config_t config 
)

#include <drivers/inc/hpm_dao_drv.h>

get default config

Parameters
[in]ptrDAO base address
[out]configdao_config_t

◆ dao_init()

hpm_stat_t dao_init ( DAO_Type ptr,
dao_config_t config 
)

#include <drivers/inc/hpm_dao_drv.h>

initlization

Parameters
[in]ptrDAO base address
[in]configdao_config_t
Return values
hpm_stat_tstatus_invalid_argument or status_success

◆ dao_invert_output()

static void dao_invert_output ( DAO_Type ptr,
bool  invert 
)
inlinestatic

#include <drivers/inc/hpm_dao_drv.h>

invert output

Parameters
[in]ptrDAO base address
[in]invert
  • true: invert output
  • false: not invert output

◆ dao_is_running()

static bool dao_is_running ( DAO_Type ptr)
inlinestatic

#include <drivers/inc/hpm_dao_drv.h>

check whether DAO is running

Parameters
[in]ptrDAO base address
Return values
trueif dao is running

◆ dao_software_reset()

static void dao_software_reset ( DAO_Type ptr)
inlinestatic

#include <drivers/inc/hpm_dao_drv.h>

software reset

Parameters
[in]ptrDAO base address

◆ dao_start()

static void dao_start ( DAO_Type ptr)
inlinestatic

#include <drivers/inc/hpm_dao_drv.h>

start

Parameters
[in]ptrDAO base address

◆ dao_stop()

static void dao_stop ( DAO_Type ptr)
inlinestatic

#include <drivers/inc/hpm_dao_drv.h>

stop

Parameters
[in]ptrDAO base address