|
NetBurner 3.5.6
PDF Version |
Configuration structure for one direction (TX or RX) of the SAI module. More...
#include <sai.h>
Public Attributes | |
| bool | enable {false} |
| uint8_t | startDly {1} |
| startCond_t | startCond {START_FRAME_EDGE} |
| clkGate_t | clkGate {CLK_GATE_CONTINUOUS} |
| clkOut_t | clkOut {CLK_OUT_CONTINUOUS} |
| clkSrc_t | clkSrc {CLK_SRC_MCK} |
| clkCh_t | clkCh {CLK_CH_CH} |
| clkPol_t | clkPol {CLK_ACTIVE_HIGH} |
| uint8_t | syncLen {0} |
| frameEdge_t | syncEdge {FRAME_SYNC_FALLING} |
| frameSyncOut_t | syncOut {FRAME_SYNC_INPUT} |
| frameSyncCh_t | syncCh {SYNC_CH_CH} |
| uint8_t | wordsPerFrame {2} |
| dataPacking_t | dataPacking {BUFFER_WORD32_RIGHT} |
| bool | unifyDataStream {false} |
| bitOrder_t | bitOrder {MOST_SIG_FIRST} |
| bool | lineIdleState {1} |
| uint8_t | bitsPerWord {24} |
| uint32_t | wordMask {0} |
| bufferDepletionBehavior_t | depletionBehavior {DEPLETED_PAUSE} |
Configuration structure for one direction (TX or RX) of the SAI module.
This structure contains all parameters needed to configure either the transmit or receive channel of the SAI peripheral. The same structure type is used for both directions, with appropriate defaults provided by predefined configurations.
Timing Configuration
The SAI operates on a frame-based model where:
Example Configuration
| bitOrder_t SAI_rxtx_cfg_t::bitOrder {MOST_SIG_FIRST} |
Bit transmission order (MSB first is standard)
| uint8_t SAI_rxtx_cfg_t::bitsPerWord {24} |
Number of bits per word (valid audio sample size). Common values: 8, 16, 24, 32
| clkGate_t SAI_rxtx_cfg_t::clkGate {CLK_GATE_CONTINUOUS} |
Clock gating mode for power management
| clkOut_t SAI_rxtx_cfg_t::clkOut {CLK_OUT_CONTINUOUS} |
Clock output mode (input/continuous output/gated output)
| clkPol_t SAI_rxtx_cfg_t::clkPol {CLK_ACTIVE_HIGH} |
Clock polarity (active high/low)
| clkSrc_t SAI_rxtx_cfg_t::clkSrc {CLK_SRC_MCK} |
Clock source selection (master clock or external)
| dataPacking_t SAI_rxtx_cfg_t::dataPacking {BUFFER_WORD32_RIGHT} |
Buffer word format and data justification
| bufferDepletionBehavior_t SAI_rxtx_cfg_t::depletionBehavior {DEPLETED_PAUSE} |
DMA behavior when buffer queue is exhausted
| bool SAI_rxtx_cfg_t::enable {false} |
Enable this channel (true = enabled, false = disabled)
| bool SAI_rxtx_cfg_t::lineIdleState {1} |
Logic level to drive on data line when idle (between words).
| startCond_t SAI_rxtx_cfg_t::startCond {START_FRAME_EDGE} |
Starting condition that triggers data transfer
| uint8_t SAI_rxtx_cfg_t::startDly {1} |
Data delay in bit clocks from frame sync to first data bit.
| frameSyncCh_t SAI_rxtx_cfg_t::syncCh {SYNC_CH_CH} |
Frame sync channel selection (default/RX/TX)
| frameEdge_t SAI_rxtx_cfg_t::syncEdge {FRAME_SYNC_FALLING} |
Frame sync edge defining frame boundary
| uint8_t SAI_rxtx_cfg_t::syncLen {0} |
Frame sync pulse width in bit clocks.
| frameSyncOut_t SAI_rxtx_cfg_t::syncOut {FRAME_SYNC_INPUT} |
Frame sync output mode (input/negative pulse/positive pulse)
| bool SAI_rxtx_cfg_t::unifyDataStream {false} |
Unify data stream across multiple SAI data lines. When true, treats multiple data lines as a single stream.
| uint32_t SAI_rxtx_cfg_t::wordMask {0} |
Word slot mask for frames with multiple words. Each bit represents a word slot:
Example for stereo with left channel only: 0x00000002
| uint8_t SAI_rxtx_cfg_t::wordsPerFrame {2} |
Number of words contained in each frame.