pru: Initial support for the Beaglebone PRU
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
22
src/pru/gpio.h
Normal file
22
src/pru/gpio.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifndef __PRU_GPIO_H
|
||||
#define __PRU_GPIO_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
struct gpio_out {
|
||||
volatile uint32_t *reg;
|
||||
uint32_t bit;
|
||||
};
|
||||
struct gpio_out gpio_out_setup(uint8_t pin, uint8_t val);
|
||||
void gpio_out_toggle(struct gpio_out g);
|
||||
void gpio_out_write(struct gpio_out g, uint8_t val);
|
||||
|
||||
struct gpio_in {
|
||||
volatile uint32_t *reg;
|
||||
uint32_t bit;
|
||||
};
|
||||
struct gpio_in gpio_in_setup(uint8_t pin, int8_t pull_up);
|
||||
uint8_t gpio_in_read(struct gpio_in g);
|
||||
|
||||
#endif // gpio.h
|
||||
Reference in New Issue
Block a user