led.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef LED_INDICATION_H
  2. #define LED_INDICATION_H
  3. #include <stdbool.h>
  4. typedef enum
  5. {
  6. eLedMode_Idle, // No indication
  7. eLedMode_Signaling, // Signaling indincation
  8. eLedMode_Normal // Normal indication
  9. }
  10. eLedMode_t;
  11. typedef enum
  12. {
  13. LED1,
  14. LED2
  15. }eLedNumber_t;
  16. typedef enum
  17. {
  18. eLed_color_off = 0,
  19. eLed_color_red,
  20. eLed_color_grn,
  21. eLed_color_orange
  22. }eLed_color_t;
  23. typedef struct
  24. {
  25. // Init - initialize module
  26. bool (*Init)();
  27. // Tick - 1ms tick signal, e.g. SysTickIRQ
  28. void (*Tick)();
  29. bool (*SetMode)( eLedMode_t mode );
  30. // SetLowBattery - set battery low signal (true/false)
  31. void (*SetLowBattery)( bool batteryLow );
  32. // SetUSBConnectivity - set USB active signal (true/false)
  33. void (*SetUSBConnectivity)( bool usbActive );
  34. // SetAutomatAlarm - set Automat-mode alarm signal
  35. void (*SetAutomatAlarm)( bool automatAlarm );
  36. // SetHarmupStatus - set device harming up status
  37. void (*SetHarmupStatus)( bool harmupCompleted );
  38. // DeInit - deinitialize module
  39. bool (*DeInit)();
  40. void (*harmup_init)();
  41. void (*harmup_serve)();
  42. void (*harmup_stop)();
  43. }
  44. sLED_Handle_t;
  45. extern const sLED_Handle_t LEDHandle;
  46. void setLedColor( eLed_color_t color );
  47. eLed_color_t GET_LED_COLOR_STATE( int number );
  48. #endif