unleashed-firmware/applications/notification/notification.h
あく c4a0847c99
FuriHal: replace HAL with LL in RFID Part 1. Drop F6. (#1049)
* FuriHal: new speaker HAL
* FuriHal: drop PWM
* FuriHal: move COMP1 to LL
* FuriHal: move COMP1 to LL backport to F6
* FuriHal: remove missing gpio_rfid_carrier from F6
* FurHal: use LL for system controls in flash HAL
* Drop F6 source tree
* Drop F6 from GitHub workflow
* Tie USE_FULL_ASSERT with APP_UNIT_TESTS
* Speaker: return to old volume calculation
* FreeRTOS: move TCB header to glue

Co-authored-by: DrZlo13 <who.just.the.doctor@gmail.com>
2022-03-23 20:59:20 +03:00

95 lines
2.4 KiB
C

#pragma once
#include "stdint.h"
#include "stdbool.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct NotificationApp NotificationApp;
typedef struct {
float frequency;
float volume;
} NotificationMessageDataSound;
typedef struct {
uint8_t value;
} NotificationMessageDataLed;
typedef struct {
bool on;
} NotificationMessageDataVibro;
typedef struct {
uint32_t length;
} NotificationMessageDataDelay;
typedef struct {
float speaker_volume;
bool vibro;
float display_brightness;
} NotificationMessageDataForcedSettings;
typedef union {
NotificationMessageDataSound sound;
NotificationMessageDataLed led;
NotificationMessageDataVibro vibro;
NotificationMessageDataDelay delay;
NotificationMessageDataForcedSettings forced_settings;
} NotificationMessageData;
typedef enum {
NotificationMessageTypeVibro,
NotificationMessageTypeSoundOn,
NotificationMessageTypeSoundOff,
NotificationMessageTypeLedRed,
NotificationMessageTypeLedGreen,
NotificationMessageTypeLedBlue,
NotificationMessageTypeDelay,
NotificationMessageTypeLedDisplay,
NotificationMessageTypeLedDisplayLock,
NotificationMessageTypeLedDisplayUnlock,
NotificationMessageTypeDoNotReset,
NotificationMessageTypeForceSpeakerVolumeSetting,
NotificationMessageTypeForceVibroSetting,
NotificationMessageTypeForceDisplayBrightnessSetting,
} NotificationMessageType;
typedef struct {
NotificationMessageType type;
NotificationMessageData data;
} NotificationMessage;
typedef const NotificationMessage* NotificationSequence[];
void notification_message(NotificationApp* app, const NotificationSequence* sequence);
void notification_message_block(NotificationApp* app, const NotificationSequence* sequence);
/**
* @brief Send internal (apply to permanent layer) notification message. Think twice before use.
*
* @param app notification record content
* @param sequence notification sequence
*/
void notification_internal_message(NotificationApp* app, const NotificationSequence* sequence);
/**
* @brief Send internal (apply to permanent layer) notification message and wait for notification end. Think twice before use.
*
* @param app notification record content
* @param sequence notification sequence
*/
void notification_internal_message_block(
NotificationApp* app,
const NotificationSequence* sequence);
#ifdef __cplusplus
}
#endif