d_inouts.h 623 B

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