Swadge 2024 2.0.0
APIs to develop games for the Magfest Swadge
Loading...
Searching...
No Matches
hdw-dac.c File Reference

Macros

#define DMA_DESCRIPTORS   4
 

Functions

void initDac (dac_channel_mask_t channel, gpio_num_t shdn_gpio, fnDacCallback_t cb)
 Initialize the DAC.
 
void deinitDac (void)
 Deinitialize the DAC and free memory.
 
void dacStart (void)
 Start the DAC. This will cause samples to be requested from the application.
 
void dacStop (void)
 Stop the DAC.
 
void dacPoll (void)
 Poll the queue to see if any buffers need to be filled with audio samples.
 
void setDacShutdown (bool shutdown)
 Set the shutdown state of the DAC.
 

Macro Definition Documentation

◆ DMA_DESCRIPTORS

#define DMA_DESCRIPTORS   4

The number of buffers to use. The more buffers, the longer latency

Function Documentation

◆ initDac()

void initDac ( dac_channel_mask_t channel,
gpio_num_t shdn_gpio,
fnDacCallback_t cb )

Initialize the DAC.

Parameters
channelThe output channel (pin) for the ADC
shdn_gpioThe GPIO that controls the amplifier's shutdown
cbA callback function which will be called to request samples from the application

◆ deinitDac()

void deinitDac ( void )

Deinitialize the DAC and free memory.

◆ dacStart()

void dacStart ( void )

Start the DAC. This will cause samples to be requested from the application.

◆ dacStop()

void dacStop ( void )

Stop the DAC.

◆ dacPoll()

void dacPoll ( void )

Poll the queue to see if any buffers need to be filled with audio samples.

◆ setDacShutdown()

void setDacShutdown ( bool shutdown)

Set the shutdown state of the DAC.

Parameters
shutdowntrue to shut down the DAC, false to enable it