led.h 594 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef __LED_H
  2. #define __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. } led_state_t;
  19. typedef struct
  20. {
  21. led_state_t led_state;
  22. uint8_t i;
  23. } led_t;
  24. extern led_t led;
  25. void led_on_off(uint8_t leds, uint8_t on_off);
  26. #endif // __LED_H