Fraise  2.1
FRAmework for Interfacing Software and Electronics
pico_audio_pwm

PWM audio output (with optional noise shaping and error diffusion) using the PIO. More...

PWM audio output (with optional noise shaping and error diffusion) using the PIO.

This library uses the hardware_pio system to implement a PWM audio interface

Functions

const audio_format_taudio_pwm_setup (const audio_format_t *intended_audio_format, int32_t max_latency_ms, const audio_pwm_channel_config_t *channel_config0,...)
 
bool audio_pwm_default_connect (audio_buffer_pool_t *producer_pool, bool dedicate_core_1)
 
void audio_pwm_set_enabled (bool enabled)
 
bool audio_pwm_set_correction_mode (enum audio_correction_mode mode)
 Set the PWM correction mode. More...
 
enum audio_correction_mode audio_pwm_get_correction_mode ()
 Get the PWM correction mode. More...
 

Function Documentation

◆ audio_pwm_setup()

const audio_format_t* audio_pwm_setup ( const audio_format_t intended_audio_format,
int32_t  max_latency_ms,
const audio_pwm_channel_config_t *  channel_config0,
  ... 
)

max_latency_ms may be -1 (for don't care)

Parameters
intended_audio_format
max_latency_ms
channel_config0
...
Returns

◆ audio_pwm_default_connect()

bool audio_pwm_default_connect ( audio_buffer_pool_t producer_pool,
bool  dedicate_core_1 
)
Parameters
producer_pool
dedicate_core_1attempt a default mapping of producer buffers to pio pwm pico_audio output dedicate_core_1 to have core 1 set aside entirely to do work offloading as much stuff from the producer side as possible todo also allow IRQ handler to do it I guess

◆ audio_pwm_set_enabled()

void audio_pwm_set_enabled ( bool  enabled)
Parameters
enabletrue to enable the PWM audio, false to disable

◆ audio_pwm_set_correction_mode()

bool audio_pwm_set_correction_mode ( enum audio_correction_mode  mode)

Set the PWM correction mode.

Parameters
mode

◆ audio_pwm_get_correction_mode()

enum audio_correction_mode audio_pwm_get_correction_mode ( )

Get the PWM correction mode.

Returns
mode