diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2017-08-27 13:58:19 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2017-09-20 12:55:28 -0400 |
commit | 16d2ec3a905204dd804831611aff37a4b508e0fa (patch) | |
tree | 9f2b4f64b575fae07f24ea599b8796d95d5ec86e /src/linux/gpio.h | |
parent | 4d60567bc66417c48e7c3095ceded6c24ec1888f (diff) | |
download | kutter-16d2ec3a905204dd804831611aff37a4b508e0fa.tar.gz kutter-16d2ec3a905204dd804831611aff37a4b508e0fa.tar.xz kutter-16d2ec3a905204dd804831611aff37a4b508e0fa.zip |
linux: Add support for analog IIO devices
Add support for reading analog values via the standard Linux IIO
interface. This can be used on Replicape boards to sample analog
input pins.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/linux/gpio.h')
-rw-r--r-- | src/linux/gpio.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/linux/gpio.h b/src/linux/gpio.h new file mode 100644 index 00000000..a2c92520 --- /dev/null +++ b/src/linux/gpio.h @@ -0,0 +1,14 @@ +#ifndef __LINUX_GPIO_H +#define __LINUX_GPIO_H + +#include <stdint.h> // uint8_t + +struct gpio_adc { + int fd; +}; +struct gpio_adc gpio_adc_setup(uint8_t pin); +uint32_t gpio_adc_sample(struct gpio_adc g); +uint16_t gpio_adc_read(struct gpio_adc g); +void gpio_adc_cancel_sample(struct gpio_adc g); + +#endif // gpio.h |