2021-05-24 13:44:14 +00:00
|
|
|
#pragma once
|
|
|
|
#include "stdint.h"
|
|
|
|
#include "stdbool.h"
|
2022-06-09 07:33:46 +00:00
|
|
|
#include <furi_hal_resources.h>
|
2021-05-24 13:44:14 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2022-07-26 12:21:51 +00:00
|
|
|
#define RECORD_NOTIFICATION "notification"
|
|
|
|
|
2021-05-24 13:44:14 +00:00
|
|
|
typedef struct NotificationApp NotificationApp;
|
|
|
|
typedef struct {
|
|
|
|
float frequency;
|
2022-03-23 17:59:20 +00:00
|
|
|
float volume;
|
2021-05-24 13:44:14 +00:00
|
|
|
} NotificationMessageDataSound;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
uint8_t value;
|
|
|
|
} NotificationMessageDataLed;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
bool on;
|
|
|
|
} NotificationMessageDataVibro;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
uint32_t length;
|
|
|
|
} NotificationMessageDataDelay;
|
|
|
|
|
2021-12-28 15:46:08 +00:00
|
|
|
typedef struct {
|
|
|
|
float speaker_volume;
|
|
|
|
bool vibro;
|
|
|
|
float display_brightness;
|
|
|
|
} NotificationMessageDataForcedSettings;
|
|
|
|
|
2022-06-09 07:33:46 +00:00
|
|
|
typedef struct {
|
|
|
|
uint16_t on_time;
|
|
|
|
uint16_t period;
|
|
|
|
Light color;
|
|
|
|
} NotificationMessageDataLedBlink;
|
|
|
|
|
2021-05-24 13:44:14 +00:00
|
|
|
typedef union {
|
|
|
|
NotificationMessageDataSound sound;
|
|
|
|
NotificationMessageDataLed led;
|
2022-06-09 07:33:46 +00:00
|
|
|
NotificationMessageDataLedBlink led_blink;
|
2021-05-24 13:44:14 +00:00
|
|
|
NotificationMessageDataVibro vibro;
|
|
|
|
NotificationMessageDataDelay delay;
|
2021-12-28 15:46:08 +00:00
|
|
|
NotificationMessageDataForcedSettings forced_settings;
|
2021-05-24 13:44:14 +00:00
|
|
|
} NotificationMessageData;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
NotificationMessageTypeVibro,
|
2022-02-24 00:17:40 +00:00
|
|
|
|
2021-05-24 13:44:14 +00:00
|
|
|
NotificationMessageTypeSoundOn,
|
|
|
|
NotificationMessageTypeSoundOff,
|
2022-02-24 00:17:40 +00:00
|
|
|
|
2021-05-24 13:44:14 +00:00
|
|
|
NotificationMessageTypeLedRed,
|
|
|
|
NotificationMessageTypeLedGreen,
|
|
|
|
NotificationMessageTypeLedBlue,
|
2022-02-24 00:17:40 +00:00
|
|
|
|
2022-06-09 07:33:46 +00:00
|
|
|
NotificationMessageTypeLedBlinkStart,
|
|
|
|
NotificationMessageTypeLedBlinkStop,
|
|
|
|
NotificationMessageTypeLedBlinkColor,
|
|
|
|
|
2021-05-24 13:44:14 +00:00
|
|
|
NotificationMessageTypeDelay,
|
2022-02-24 00:17:40 +00:00
|
|
|
|
2022-04-29 14:21:12 +00:00
|
|
|
NotificationMessageTypeLedDisplayBacklight,
|
|
|
|
NotificationMessageTypeLedDisplayBacklightEnforceOn,
|
|
|
|
NotificationMessageTypeLedDisplayBacklightEnforceAuto,
|
2022-02-24 00:17:40 +00:00
|
|
|
|
2021-05-24 13:44:14 +00:00
|
|
|
NotificationMessageTypeDoNotReset,
|
2022-02-24 00:17:40 +00:00
|
|
|
|
2021-12-28 15:46:08 +00:00
|
|
|
NotificationMessageTypeForceSpeakerVolumeSetting,
|
|
|
|
NotificationMessageTypeForceVibroSetting,
|
|
|
|
NotificationMessageTypeForceDisplayBrightnessSetting,
|
2022-04-21 12:33:03 +00:00
|
|
|
|
|
|
|
NotificationMessageTypeLedBrightnessSettingApply,
|
2023-06-06 17:46:01 +00:00
|
|
|
|
|
|
|
NotificationMessageTypeLcdContrastUpdate,
|
2021-05-24 13:44:14 +00:00
|
|
|
} 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
|
|
|
|
}
|
2022-02-24 00:17:40 +00:00
|
|
|
#endif
|