ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_pdm_channel_cfg_t Struct Reference

One PDM channel's mode + filter configuration. More...

#include <ra8_pdm.h>

Data Fields

uint8_t sinc_order
 Sinc filter order 1..4 (PDMDSR.SFMD).
uint8_t clock_div
 PDM_CLKn divider code (PDSFCR.CKDIV[3:0]).
uint8_t sinc_dec
 Sinc decimation ratio - 1 (PDSFCR.SINCDEC[7:0]).
uint8_t sinc_range
 Sinc output clip range (PDSFCR.SINCRNG[4:0]).
uint8_t data_shift
 Data-buffer input shift (PDMDSR.DBIS[3:0]).
uint8_t edge
 0: rise-edge ch n; 1: fall-edge ch n-1 (INPSEL).
uint8_t hpf_shift
 High-pass input shift (PDMDSR.HFIS[1:0]).
uint8_t cf_shift
 Compensation input shift (PDMDSR.CFIS[1:0]).
uint8_t lpf_shift
 Low-pass input shift (PDMDSR.LFIS[1:0]).
uint8_t rx_threshold
 Data reception threshold code (PDDBCR.DATRITHR).
uint16_t hpf_s0
 High-pass filter coefficient s(0).
uint16_t hpf_k1
 High-pass filter coefficient k(1).
uint16_t hpf_h [k_ra8_pdm_hpf_h_count]
 High-pass filter h(0..1).
uint16_t comp_h [k_ra8_pdm_comp_h_count]
 Compensation filter h(0..10).
uint16_t lpf_h0
 Low-pass filter coefficient h0.
uint16_t lpf_h1 [k_ra8_pdm_lpf_h1_count]
 Low-pass filter h1(0..19).

Detailed Description

One PDM channel's mode + filter configuration.

Maps directly onto the channel's PDMDSR/PDSFCR/coefficient/PDDBCR registers. The sinc order, decimation ratio and clip range must be a combination allowed by HUM Table 49.7; the FIR coefficients are the microphone/vendor filter set.

Invariant
sinc_order is in 1..4.
clock_div/sinc_dec/sinc_range form a valid HUM Table 49.7 row.
See also
ra8_pdm_configure

Definition at line 93 of file ra8_pdm.h.

Field Documentation

◆ cf_shift

uint8_t ra8_pdm_channel_cfg_t::cf_shift

Compensation input shift (PDMDSR.CFIS[1:0]).

Definition at line 101 of file ra8_pdm.h.

Referenced by internal_pdm_write_mode().

◆ clock_div

uint8_t ra8_pdm_channel_cfg_t::clock_div

PDM_CLKn divider code (PDSFCR.CKDIV[3:0]).

Definition at line 95 of file ra8_pdm.h.

Referenced by internal_pdm_write_mode().

◆ comp_h

uint16_t ra8_pdm_channel_cfg_t::comp_h[k_ra8_pdm_comp_h_count]

Compensation filter h(0..10).

Definition at line 107 of file ra8_pdm.h.

Referenced by internal_pdm_write_coeffs().

◆ data_shift

uint8_t ra8_pdm_channel_cfg_t::data_shift

Data-buffer input shift (PDMDSR.DBIS[3:0]).

Definition at line 98 of file ra8_pdm.h.

Referenced by internal_pdm_write_mode().

◆ edge

uint8_t ra8_pdm_channel_cfg_t::edge

0: rise-edge ch n; 1: fall-edge ch n-1 (INPSEL).

Definition at line 99 of file ra8_pdm.h.

Referenced by internal_pdm_write_mode(), and ra8_board_pdm_mic_get_config().

◆ hpf_h

uint16_t ra8_pdm_channel_cfg_t::hpf_h[k_ra8_pdm_hpf_h_count]

High-pass filter h(0..1).

Definition at line 106 of file ra8_pdm.h.

Referenced by internal_pdm_write_coeffs().

◆ hpf_k1

uint16_t ra8_pdm_channel_cfg_t::hpf_k1

High-pass filter coefficient k(1).

Definition at line 105 of file ra8_pdm.h.

Referenced by internal_pdm_write_coeffs().

◆ hpf_s0

uint16_t ra8_pdm_channel_cfg_t::hpf_s0

High-pass filter coefficient s(0).

Definition at line 104 of file ra8_pdm.h.

Referenced by internal_pdm_write_coeffs().

◆ hpf_shift

uint8_t ra8_pdm_channel_cfg_t::hpf_shift

High-pass input shift (PDMDSR.HFIS[1:0]).

Definition at line 100 of file ra8_pdm.h.

Referenced by internal_pdm_write_mode().

◆ lpf_h0

uint16_t ra8_pdm_channel_cfg_t::lpf_h0

Low-pass filter coefficient h0.

Definition at line 108 of file ra8_pdm.h.

Referenced by internal_pdm_write_coeffs().

◆ lpf_h1

uint16_t ra8_pdm_channel_cfg_t::lpf_h1[k_ra8_pdm_lpf_h1_count]

Low-pass filter h1(0..19).

Definition at line 109 of file ra8_pdm.h.

Referenced by internal_pdm_write_coeffs().

◆ lpf_shift

uint8_t ra8_pdm_channel_cfg_t::lpf_shift

Low-pass input shift (PDMDSR.LFIS[1:0]).

Definition at line 102 of file ra8_pdm.h.

Referenced by internal_pdm_write_mode().

◆ rx_threshold

uint8_t ra8_pdm_channel_cfg_t::rx_threshold

Data reception threshold code (PDDBCR.DATRITHR).

Definition at line 103 of file ra8_pdm.h.

Referenced by ra8_pdm_configure().

◆ sinc_dec

uint8_t ra8_pdm_channel_cfg_t::sinc_dec

Sinc decimation ratio - 1 (PDSFCR.SINCDEC[7:0]).

Definition at line 96 of file ra8_pdm.h.

Referenced by internal_pdm_write_mode().

◆ sinc_order

uint8_t ra8_pdm_channel_cfg_t::sinc_order

Sinc filter order 1..4 (PDMDSR.SFMD).

Definition at line 94 of file ra8_pdm.h.

Referenced by internal_pdm_write_mode().

◆ sinc_range

uint8_t ra8_pdm_channel_cfg_t::sinc_range

Sinc output clip range (PDSFCR.SINCRNG[4:0]).

Definition at line 97 of file ra8_pdm.h.

Referenced by internal_pdm_write_mode().


The documentation for this struct was generated from the following file: