IOComm.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * IO_Test.h
  3. *
  4. * Created on: 2020¦~4¤ë21¤é
  5. * Author: Wendell
  6. */
  7. #ifndef IO_TEST_H_
  8. #define IO_TEST_H_
  9. typedef enum
  10. {
  11. GPIO_DIR_INPUT = 0,
  12. GPIO_DIR_OUTPUT
  13. }_GPIO_DIR;
  14. typedef enum
  15. {
  16. GPIO_AM_OK_FLAG = 0, // output
  17. GPIO_IO_BD1_1, // output
  18. GPIO_IO_BD1_2, // output
  19. GPIO_IO_BD2_1, // output
  20. GPIO_IO_BD2_2, // output
  21. GPIO_ID_BD1_1, // input
  22. GPIO_ID_BD1_2, // input
  23. GPIO_ID_BD2_1, // input
  24. GPIO_ID_BD2_2, // input
  25. GPIO_AM_RFID_RST, // output
  26. GPIO_AM_RFID_ICC, // output
  27. GPIO_BOARD1_PROXIMITY, // input
  28. GPIO_BOARD2_PROXIMITY, // input
  29. }_SYS_GPIO;
  30. #define SYS_GPIO_NUM 16
  31. #define PIN_AM_OK_FLAG 112
  32. #define PIN_IO_BD1_1 26
  33. #define PIN_IO_BD1_2 27
  34. #define PIN_IO_BD2_1 46
  35. #define PIN_IO_BD2_2 47
  36. #define PIN_ID_BD1_1 22
  37. #define PIN_ID_BD1_2 23
  38. #define PIN_ID_BD2_1 44
  39. #define PIN_ID_BD2_2 45
  40. #define PIN_AM_RFID_RST 19
  41. #define PIN_AM_RFID_ICC 20
  42. #define PIN_BOARD1_PROXIMITY 88
  43. #define PIN_BOARD2_PROXIMITY 86
  44. #define PIN_AM_DE_1 89
  45. #define PIN_AM_RE_1 87
  46. #define PIN_ETHERNET_RESET 110
  47. #define ADC_AIN0 0
  48. #define ADC_AIN1 1
  49. #define ADC_AIN2 2
  50. #define ADC_AIN3 3
  51. void gpio_set_direction(int pin, unsigned char dir);
  52. void gpio_write(int pin, unsigned char value);
  53. int gpio_read(int pin);
  54. void DoIOTest(void);
  55. #endif /* IO_TEST_H_ */