notification-app.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. float speaker_volume;
  30. uint32_t display_off_delay_ms;
  31. } NotificationSettings;
  32. struct NotificationApp {
  33. osMessageQueueId_t queue;
  34. osTimerId_t display_timer;
  35. NotificationLedLayer display;
  36. NotificationLedLayer led[NOTIFICATION_LED_COUNT];
  37. NotificationSettings settings;
  38. };