|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
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). | |
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.
| 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().
| 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().
| 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().
| 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().
| 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().
| 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().
| 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().
| 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().
| 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().
| 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().
| 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().
| 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().
| 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().
| 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().
| 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().
| 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().