mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-23 13:03:13 +00:00
917410a0a8
* fbt: reworking targets & assets handling WIP * fbt: dist fixes * fbt: moved SD card resources to owning apps * unit_tests: moved resources to app folder * github: updated unit_tests paths * github: packaging fixes * unit_tests: fixes * fbt: assets: internal cleanup * fbt: reworked assets handling * github: unit_tests: reintroducing fixes * minor cleanup * fbt: naming changes to reflect private nature of scons tools * fbt: resources: fixed dist archive paths * docs: updated paths * docs: updated more paths * docs: included "resources" parameter in app manifest docs; updated assets readme * updated gitignore for assets * github: updated action versions * unit_tests: restored timeout; scripts: assets: logging changes * gh: don't upload desktop animations for unit test run Co-authored-by: あく <alleteam@gmail.com>
68 lines
1.3 KiB
C
68 lines
1.3 KiB
C
/**
|
|
* @file furi_hal_speaker.h
|
|
* Speaker HAL
|
|
*/
|
|
#pragma once
|
|
|
|
#include <furi.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/** Init speaker */
|
|
void furi_hal_speaker_init();
|
|
|
|
/** Deinit speaker */
|
|
void furi_hal_speaker_deinit();
|
|
|
|
/** Acquire speaker ownership
|
|
*
|
|
* @warning You must acquire speaker ownership before use
|
|
*
|
|
* @param timeout Timeout during which speaker ownership must be acquired
|
|
*
|
|
* @return bool returns true on success
|
|
*/
|
|
FURI_WARN_UNUSED bool furi_hal_speaker_acquire(uint32_t timeout);
|
|
|
|
/** Release speaker ownership
|
|
*
|
|
* @warning You must release speaker ownership after use
|
|
*/
|
|
void furi_hal_speaker_release();
|
|
|
|
/** Check current process speaker ownership
|
|
*
|
|
* @warning always returns true if called from ISR
|
|
*
|
|
* @return bool returns true if process owns speaker
|
|
*/
|
|
bool furi_hal_speaker_is_mine();
|
|
|
|
/** Play a note
|
|
*
|
|
* @warning no ownership check if called from ISR
|
|
*
|
|
* @param frequency The frequency
|
|
* @param volume The volume
|
|
*/
|
|
void furi_hal_speaker_start(float frequency, float volume);
|
|
|
|
/** Set volume
|
|
*
|
|
* @warning no ownership check if called from ISR
|
|
*
|
|
* @param volume The volume
|
|
*/
|
|
void furi_hal_speaker_set_volume(float volume);
|
|
|
|
/** Stop playback
|
|
*
|
|
* @warning no ownership check if called from ISR
|
|
*/
|
|
void furi_hal_speaker_stop();
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|