Swadge ESP32-S2
APIs to develop for the Magfest Swadge
Toggle main menu visibility
Loading...
Searching...
No Matches
hdw-dac.h
Go to the documentation of this file.
1
62
63
#pragma once
64
65
//==============================================================================
66
// Includes
67
//==============================================================================
68
69
#include <stdint.h>
70
#include <stdbool.h>
71
#include "driver/dac_continuous.h"
72
#include "driver/gpio.h"
73
74
//==============================================================================
75
// Defines
76
//==============================================================================
77
79
#define DAC_SAMPLE_RATE_HZ 16384
80
82
#define DAC_BUF_SIZE 512
83
84
//==============================================================================
85
// Typedefs
86
//==============================================================================
87
94
typedef
void (*
fnDacCallback_t
)(uint8_t* samples, int16_t len);
95
96
//==============================================================================
97
// Function Declarations
98
//==============================================================================
99
100
void
initDac
(dac_channel_mask_t channel, gpio_num_t shdn_gpio,
fnDacCallback_t
cb);
101
void
deinitDac
(
void
);
102
void
powerDownDac
(
void
);
103
void
powerUpDac
(
void
);
104
void
dacPoll
(
void
);
105
void
dacStart
(
void
);
106
void
dacStop
(
void
);
107
void
setDacShutdown
(
bool
shutdown);
powerUpDac
void powerUpDac(void)
Power up the DAC (speaker).
Definition
hdw-dac.c:150
setDacShutdown
void setDacShutdown(bool shutdown)
Set the shutdown state of the DAC.
Definition
hdw-dac.c:211
dacStop
void dacStop(void)
Stop the DAC.
Definition
hdw-dac.c:172
dacPoll
void dacPoll(void)
Poll the queue to see if any buffers need to be filled with audio samples.
Definition
hdw-dac.c:186
initDac
void initDac(dac_channel_mask_t channel, gpio_num_t shdn_gpio, fnDacCallback_t cb)
Initialize the DAC.
Definition
hdw-dac.c:74
powerDownDac
void powerDownDac(void)
Power down the DAC (speaker).
Definition
hdw-dac.c:142
deinitDac
void deinitDac(void)
Deinitialize the DAC and free memory.
Definition
hdw-dac.c:121
dacStart
void dacStart(void)
Start the DAC. This will cause samples to be requested from the application.
Definition
hdw-dac.c:158
fnDacCallback_t
void(* fnDacCallback_t)(uint8_t *samples, int16_t len)
A callback which requests DAC samples from the application.
Definition
hdw-dac.h:94
components
hdw-dac
include
hdw-dac.h
Generated by
1.17.0