Sound Byte Libs 29c5ff3
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
Classes | Typedefs | Enumerations
sbl::hal::audio Namespace Reference

Classes

struct  AudioConfig
 Audio stream configuration. More...
 

Typedefs

using AudioCallback = void(*)(int32_t *tx_buf, const int32_t *rx_buf, uint16_t frames)
 Audio processing callback (called from ISR context)
 

Enumerations

enum class  SaiLayout { A_TX_B_RX , A_RX_B_TX }
 SAI block direction layout. More...
 

Typedef Documentation

◆ AudioCallback

using sbl::hal::audio::AudioCallback = typedef void(*)(int32_t* tx_buf, const int32_t* rx_buf, uint16_t frames)

Audio processing callback (called from ISR context)

Audio samples are int32_t in 24-bit signed range (±8,388,607). Saturation is the caller's responsibility — use sbl::dsp::saturate_24() from <sbl/dsp/fixed.hpp> before writing to tx_buf. The SAI driver outputs raw values with no implicit clamping.

Parameters
tx_bufInterleaved output [L0,R0,L1,R1,...] - fill these
rx_bufInterleaved input [L0,R0,L1,R1,...] - read-only
framesNumber of stereo frames (= block_size from AudioConfig)

Definition at line 58 of file types.hpp.

Enumeration Type Documentation

◆ SaiLayout

enum class sbl::hal::audio::SaiLayout
strong

SAI block direction layout.

Determines which SAI block is TX (to DAC) and which is RX (from ADC). This is board-level configuration — the codec wiring determines the mapping.

Enumerator
A_TX_B_RX 

Block A = Master TX, Block B = Slave RX (Daisy Seed / AK4556)

A_RX_B_TX 

Block A = Slave RX, Block B = Master TX (Patch SM / PCM3060)

Definition at line 28 of file types.hpp.