Sound Byte Libs 0.5.1-121-g3358a44
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
sbl::hal::audio Namespace Reference

Audio streams and the sample clock. More...

Detailed Description

Audio streams and the sample clock.

Classes

struct  AudioConfig
 Audio stream configuration. More...
 
class  SampleClock
 

Typedefs

using Sample = int32_t
 
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

◆ Sample

using sbl::hal::audio::Sample = typedef int32_t

Definition at line 49 of file types.hpp.

◆ 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 63 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.