From 4a97c151819fc52e90cb580e047cf4b24776d561 Mon Sep 17 00:00:00 2001 From: eleccoder <9162301+eleccoder@users.noreply.github.com> Date: Wed, 21 Dec 2022 18:13:30 +0100 Subject: [PATCH] aprs_pico_send1kHz() -> aprs_pico_send_sine_wave() --- include/aprs_pico.h | 5 +++-- src/aprs_pico_example.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/aprs_pico.h b/include/aprs_pico.h index 27605c9..09f4daf 100644 --- a/include/aprs_pico.h +++ b/include/aprs_pico.h @@ -61,11 +61,12 @@ bool aprs_pico_sendAPRS(audio_buffer_pool_t* audio_buffer_pool, uint16_t volume); -/** \brief Generates a 1 KHz sine wave PWM-signal at GPIO-pin 'GP0' +/** \brief Generates a sine wave PWM-signal at GPIO-pin 'GP0' * * \param[in, out] audio_buffer_pool The pool of audio buffers to be used for rendering the sine audio signal + * \param[in] freq_in_hz The frequency of the sine wave to be generated (in Hz) * \param[in] volume The volume level of the generated signal (0 ... 256) */ -void aprs_pico_send1kHz(audio_buffer_pool_t* audio_buffer_pool, uint16_t volume); +void aprs_pico_send_sine_wave(audio_buffer_pool_t* audio_buffer_pool, unsigned int freq_in_hz, uint16_t volume); #endif // APRS_PICO_H diff --git a/src/aprs_pico_example.c b/src/aprs_pico_example.c index 8da3872..aa2ad21 100644 --- a/src/aprs_pico_example.c +++ b/src/aprs_pico_example.c @@ -31,9 +31,10 @@ int main() #if (SINE_WAVE_TEST == 1) - const uint16_t VOLUME = 128u; + const unsigned int FREQ_IN_HZ = 1000u; + const uint16_t VOLUME = 128u; - aprs_pico_send1kHz(audio_buffer_pool, VOLUME); + aprs_pico_send_sine_wave(audio_buffer_pool, FREQ_IN_HZ, VOLUME); #else // !SINE_WAVE_TEST