d_inouts.h 690 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef D_INOUTS_H
  2. #include "board.h"
  3. #include <stdbool.h>
  4. #include <stdint.h>
  5. #include <stdlib.h>
  6. #ifndef HARDWARE_BT6708
  7. #define INOUTS_EXPAND_AS_ENUM(name, ...) name ## _,
  8. enum inputs_e {
  9. DI_TABLE(INOUTS_EXPAND_AS_ENUM)
  10. INPUTS_TOTAL_COUNT
  11. };
  12. enum outputs_e {
  13. RELAYS(INOUTS_EXPAND_AS_ENUM)
  14. OUTPUTS_TOTAL_COUNT
  15. };
  16. extern uint8_t inputs[INPUTS_TOTAL_COUNT], outputs[OUTPUTS_TOTAL_COUNT];
  17. void d_inouts_task(void *arg);
  18. void d_inouts_test(void *arg);
  19. bool get_inputs(uint8_t *inputs_p);
  20. bool set_outputs(uint8_t *outputs_p);
  21. uint8_t get_state_din_outs(gpio_t pin);
  22. void set_state_douts(gpio_t pin, uint8_t value);
  23. #endif
  24. #endif /* D_INOUTS_H */