no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


en:software:homelab:library:buzzer [2026/02/19 11:30] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +====== Sound generator ======
 +
 +The sound generator library is intended for controlling the beeper on the HomeLab user interface module.
 +
 +In the HomeLab II generation module, the sound source is a buzzer (piezo element), which produces sound when driven with pulses of a certain frequency using the timer PWM generator.
 +In the HomeLab III generation module, a speaker is used to generate sound and it is driven with a clock signal using the DAC module and timer; thanks to the DAC module it is possible to adjust the speaker volume. Without the library, the DAC can also be used to play audio files and speech through the speaker.
 +
 +===== Functions =====
 +
 +  * **//void buzzer_sound (unsigned char freq, unsigned int length)//** \\ Generate a sound signal with the selected frequency and length. Parameters:
 +    * //freq// - Sound frequency (Hz). Value 1 to 255 (8-65535 with HomeLab III).
 +    * //length// - Sound duration in milliseconds. Value 0 to 65535.
 +  * **//inline void buzzer_beep(void)//** \\ Generate a simple beep
 +  * **//inline void buzzer_volume(uint16_t vol)//** \\ Adjust sound volume on the HomeLab III generation module. Parameter:
 +    * //vol// - Sound volume. Value 0 to 4095 (default 1000 at startup).
 +
 +
 +===== Example =====
 +
 +<code c>
 +#include <homelab/module/buzzer.h>
 +
 +int main (void)
 +{
 + buzzer_sound(50,500);
 +}
 +
 +</code>
  
en/software/homelab/library/buzzer.txt · Last modified: by 127.0.0.1
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0