You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

33 lines
975 B

  1. #ifndef __EVENT_H__
  2. #define __EVENT_H__
  3. /* *********************************************************************** */
  4. struct event_entry
  5. {
  6. uint8_t type;
  7. uint8_t num;
  8. uint16_t value;
  9. };
  10. #define EVENT_TYPE_EMPTY 0x00
  11. #define EVENT_TYPE_GENERIC 0x01
  12. #define EVENT_TYPE_INPUT_SWITCH 0x10
  13. #define EVENT_TYPE_INPUT_BUTTON 0x11
  14. #define EVENT_TYPE_INPUT_INCDEC 0x12
  15. #define EVENT_TYPE_PWM_COMMAND 0x18
  16. #define EVENT_TYPE_PWM_VALUE 0x19
  17. #define EVENT_TYPE_PWM_STATUS 0x1A
  18. #define EVENT_TYPE_TIMER_SET 0xF0
  19. #define EVENT_TYPE_TIMER_ELAPSED 0xF1
  20. /* *********************************************************************** */
  21. void event_queue (uint8_t type, uint8_t num, uint16_t value);
  22. struct event_entry * event_get (void);
  23. void event_clear (void);
  24. /* *********************************************************************** */
  25. #endif /* __EVENT_H__ */