d_inouts.h 841 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef D_INOUTS_H
  2. #include "board.h"
  3. #include "common_config.h"
  4. #include <stdbool.h>
  5. #include <stdint.h>
  6. #include <stdlib.h>
  7. #define INOUTS_EXPAND_AS_ENUM(name, ...) name ## _,
  8. #ifdef DINS_ENABLE
  9. enum inputs_e {
  10. DI_TABLE(INOUTS_EXPAND_AS_ENUM)
  11. INPUTS_TOTAL_COUNT
  12. };
  13. extern uint8_t inputs[INPUTS_TOTAL_COUNT];
  14. bool get_inputs(uint8_t *inputs_p);
  15. uint8_t get_state_din_outs(gpio_t pin);
  16. #endif
  17. #ifdef DOUTS_ENABLE
  18. enum outputs_e {
  19. RELAYS(INOUTS_EXPAND_AS_ENUM)
  20. OUTPUTS_TOTAL_COUNT
  21. };
  22. extern uint8_t outputs[OUTPUTS_TOTAL_COUNT];
  23. bool set_outputs(uint8_t *outputs_p);
  24. void set_state_douts(gpio_t pin, uint8_t value);
  25. #endif
  26. #ifdef DINS_ENABLE || DOUTS_ENABLE
  27. void d_inouts_task(void *arg);
  28. #endif
  29. #if defined HARDWARE_BT6703
  30. void check_outputs_config(void);
  31. #endif
  32. #endif /* D_INOUTS_H */