dev_led.h 638 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef __DEV_LED_H
  2. #define __DEV_LED_H
  3. #include <stdint.h>
  4. typedef union
  5. {
  6. struct
  7. {
  8. uint8_t led0_state_flag : 1;
  9. uint8_t led1_state_flag : 1;
  10. uint8_t led2_state_flag : 1;
  11. uint8_t led3_state_flag : 1;
  12. uint8_t led4_state_flag : 1;
  13. uint8_t led5_state_flag : 1;
  14. uint8_t led6_state_flag : 1;
  15. uint8_t led7_state_flag : 1;
  16. } bits;
  17. uint8_t led_all_state;
  18. } dev_led_state_t;
  19. typedef struct
  20. {
  21. dev_led_state_t dev_led_state;
  22. uint8_t i;
  23. } dev_led_t;
  24. extern dev_led_t dev_led;
  25. void dev_led_on_off(uint8_t leds, uint8_t on_off);
  26. #endif // __DEV_LED_H