ESP-IDF Firmware
Firmware architecture and call graph
Loading...
Searching...
No Matches
wave_gen.h
Go to the documentation of this file.
1#pragma once
2
3#include "esp_err.h"
4
5#ifdef __cplusplus
6extern "C" {
7#endif
8
18
22typedef struct {
27 uint32_t sample_rate;
29
37
44
51
57void wave_gen_set_freq(float freq_hz);
58
65
71void wave_gen_set_volume(float volume);
72
79
86
87#ifdef __cplusplus
88}
89#endif
int esp_err_t
Definition esp_err.h:21
Configuration structure for Wave Generator.
Definition wave_gen.h:22
uint32_t sample_rate
Definition wave_gen.h:27
void wave_gen_set_type(wave_type_t type)
Set the waveform type.
Definition wave_gen.c:291
void wave_gen_set_freq(float freq_hz)
Set the frequency of the generated wave.
Definition wave_gen.c:284
esp_err_t wave_gen_stop(void)
Stop the wave generation task.
Definition wave_gen.c:266
esp_err_t wave_gen_init(const wave_gen_config_t *config)
Initialize the Wave Generator component.
Definition wave_gen.c:213
esp_err_t wave_gen_sdm_stop(void)
Stop the SDM sine generator.
Definition wave_gen.c:318
esp_err_t wave_gen_start(void)
Start the wave generation task.
Definition wave_gen.c:253
wave_type_t
Waveform types for generation.
Definition wave_gen.h:12
@ WAVE_TYPE_SAWTOOTH
Definition wave_gen.h:16
@ WAVE_TYPE_TRIANGLE
Definition wave_gen.h:15
@ WAVE_TYPE_SINE
Definition wave_gen.h:13
@ WAVE_TYPE_SQUARE
Definition wave_gen.h:14
esp_err_t wave_gen_sdm_start(void)
Start the SDM sine generator (uses CONFIG_SDM_* settings).
Definition wave_gen.c:303
void wave_gen_set_volume(float volume)
Set the output volume/amplitude.
Definition wave_gen.c:296