| 123456789101112131415161718192021222324252627282930 |
- #ifndef _commGPIO_H_
- #define _commGPIO_H_
-
- #include <stdio.h>
- #include <string.h>
- #include <unistd.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <stdarg.h>
- #include <time.h>
- #include <assert.h>
- #include <errno.h>
- #include <stdlib.h>
- #include <fcntl.h>
- #include <poll.h>
- #include "commLOG.h"
- //#define MSG(args...) printf(args)
- #define MSG(fmt, args...) DBGLog(fmt, ##args)
- //函数声明
- int gpio_export(int pin);
- int gpio_unexport(int pin);
- int gpio_direction(int pin, int dir); //dir: 0-->IN, 1-->OUT
- int gpio_write(int pin, int value); //value: 0-->LOW, 1-->HIGH
- int gpio_read(int pin);
- int gpio_edge(int pin, int edge); //edge: 0-->none, 1-->rising, 2-->falling, 3-->both
- #endif
|