notification-app.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #include <furi.h>
  2. #include <api-hal.h>
  3. #include "notification.h"
  4. #include "notification-messages.h"
  5. #define NOTIFICATION_LED_COUNT 3
  6. #define NOTIFICATION_EVENT_COMPLETE 0x00000001U
  7. typedef enum {
  8. NotificationLayerMessage,
  9. InternalLayerMessage,
  10. } NotificationAppMessageType;
  11. typedef struct {
  12. const NotificationSequence* sequence;
  13. NotificationAppMessageType type;
  14. osEventFlagsId_t back_event;
  15. } NotificationAppMessage;
  16. typedef enum {
  17. LayerInternal = 0,
  18. LayerNotification = 1,
  19. LayerMAX = 2,
  20. } NotificationLedLayerIndex;
  21. typedef struct {
  22. uint8_t value[LayerMAX];
  23. NotificationLedLayerIndex index;
  24. Light light;
  25. } NotificationLedLayer;
  26. typedef struct {
  27. float display_brightness;
  28. float led_brightness;
  29. uint32_t display_off_delay_ms;
  30. } NotificationSettings;
  31. struct NotificationApp {
  32. osMessageQueueId_t queue;
  33. osTimerId_t display_timer;
  34. NotificationLedLayer display;
  35. NotificationLedLayer led[NOTIFICATION_LED_COUNT];
  36. NotificationSettings settings;
  37. };