gpio-utils.h 610 B

1234567891011121314151617
  1. #define SYSFS_GPIO_DIR "/sys/class/gpio"
  2. #define MAX_BUF 64
  3. int gpio_export(unsigned int gpio);
  4. int gpio_unexport(unsigned int gpio);
  5. int gpio_set_dir(unsigned int gpio, const char* dir);
  6. int gpio_set_value(unsigned int gpio, unsigned int value);
  7. int gpio_get_value(unsigned int gpio, unsigned int *value);
  8. int gpio_set_edge(unsigned int gpio, const char *edge);
  9. int gpio_fd_open(unsigned int gpio, unsigned int dir);
  10. int gpio_fd_close(int fd);
  11. // Analog in
  12. #define ADC_BUF 1024
  13. #define SYSFS_AIN_DIR "/sys/devices/ocp.2/helper.11"
  14. int ain_get_value(unsigned int ain, unsigned int *value);