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>
This commit is contained in:
14
src/linux/gpio.h
Normal file
14
src/linux/gpio.h
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user