RA Flexible Software Package Documentation  Release v5.6.0

 
IIR Interface

Detailed Description

Interface for IIR filter functionality.

Summary

The IIR interface allows access to the IIRFA peripheral for hardware acceleration of direct form 2 transposed biquad IIR filters.

Data Structures

struct  iir_filter_coeffs_t
 
struct  iir_filter_state_t
 
struct  iir_filter_cfg_t
 
struct  iir_status_t
 
struct  iir_cfg_t
 
struct  iir_api_t
 
struct  iirfa_instance_t
 

Typedefs

typedef void iir_ctrl_t
 

Data Structure Documentation

◆ iir_filter_coeffs_t

struct iir_filter_coeffs_t

Filter stage coefficient data

Data Fields
float b0 Coefficient B0.
float b1 Coefficient B1.
float b2 Coefficient B2.
float a1 Coefficient A0.
float a2 Coefficient A1.

◆ iir_filter_state_t

struct iir_filter_state_t

Filter stage state data

Data Fields
float d0 State variable D0.
float d1 State variable D1.

◆ iir_filter_cfg_t

struct iir_filter_cfg_t

Filter configuration

Data Fields
iir_filter_coeffs_t * p_filter_coeffs Filter coefficients.
iir_filter_state_t * p_filter_state Filter state data.
uint8_t stage_base Hardware stage to start from.
uint8_t stage_num Number of filter stages to use.

◆ iir_status_t

struct iir_status_t

Filter state register status

◆ iir_cfg_t

struct iir_cfg_t

IIRFA API configuration parameter

Data Fields
void const * p_extend
uint8_t channel IIRFA channel to use.

◆ iir_api_t

struct iir_api_t

IIR driver structure. IIR functions implemented at the HAL layer follow this API.

Data Fields

fsp_err_t(* open )(iir_ctrl_t *const p_ctrl, iir_cfg_t const *const p_cfg)
 
fsp_err_t(* close )(iir_ctrl_t *const p_ctrl)
 
fsp_err_t(* configure )(iir_ctrl_t *const p_ctrl, iir_filter_cfg_t const *const p_filter_cfg)
 
fsp_err_t(* filter )(iir_ctrl_t *const p_ctrl, float const *p_data_in, float *p_data_out, uint16_t const num_samples)
 
fsp_err_t(* statusGet )(iir_ctrl_t *const p_ctrl, iir_status_t *const p_status)
 

Field Documentation

◆ open

fsp_err_t(* iir_api_t::open) (iir_ctrl_t *const p_ctrl, iir_cfg_t const *const p_cfg)

Initial configuration.

Parameters
[in]p_ctrlPointer to control block. Must be declared by user. Elements set here.
[in]p_cfgPointer to configuration structure. All elements of this structure must be set by user.

◆ close

fsp_err_t(* iir_api_t::close) (iir_ctrl_t *const p_ctrl)

Close the IIRFA channel.

Parameters
[in]p_ctrlControl block set in iir_api_t::open.

◆ configure

fsp_err_t(* iir_api_t::configure) (iir_ctrl_t *const p_ctrl, iir_filter_cfg_t const *const p_filter_cfg)

Configure filter coefficients and state variables.

Parameters
[in]p_ctrlControl block set in iir_api_t::open.
[in]p_filter_cfgPointer to filter configuration to write.

◆ filter

fsp_err_t(* iir_api_t::filter) (iir_ctrl_t *const p_ctrl, float const *p_data_in, float *p_data_out, uint16_t const num_samples)

Filter the specified data.

Parameters
[in]p_ctrlControl block set in iir_api_t::open.
[in]p_data_inPointer to float input data.
[in]p_data_outPointer to float output buffer.
[in]num_samplesNumber of samples to process.

◆ statusGet

fsp_err_t(* iir_api_t::statusGet) (iir_ctrl_t *const p_ctrl, iir_status_t *const p_status)

Retrieve current status (including state registers).

Parameters
[in]p_ctrlControl block set in iir_api_t::open.
[in]p_statusPointer to status struct.

◆ iirfa_instance_t

struct iirfa_instance_t

This structure encompasses everything that is needed to use an instance of this interface.

Data Fields
iir_ctrl_t * p_ctrl Pointer to the control structure for this instance.
iir_cfg_t const * p_cfg Pointer to the configuration structure for this instance.
iir_api_t const * p_api Pointer to the API structure for this instance.

Typedef Documentation

◆ iir_ctrl_t

typedef void iir_ctrl_t

IIR control block. Allocate an instance specific control block to pass into the DAC API calls.