Annotation of funnyos/sys/gpio.h, Revision 1.1
1.1 ! nbrk 1: /*
! 2: * $Id$
! 3: */
! 4: #ifndef _SYS_GPIO_H
! 5: #define _SYS_GPIO_H
! 6:
! 7: #include <sys/types.h>
! 8:
! 9: /*
! 10: * General Purpose Input/Output
! 11: */
! 12:
! 13: /* gpio pin flags */
! 14: #define GPIO_PIN_INPUT 0x00 /* configured as input */
! 15: #define GPIO_PIN_OUTPUT 0x01 /* configured as output */
! 16:
! 17:
! 18: struct gpio_pin {
! 19: uint32_t gp_pinno; /* pin number */
! 20:
! 21: uint8_t gp_pio; /* driven by PIO (1) or by Peripherals (0) */
! 22: uint8_t gp_flags; /* pin flags */
! 23: uint8_t gp_value; /* pin value (0 or 1) */
! 24: };
! 25:
! 26:
! 27: /* each gpio controller should provide us with this */
! 28: struct gpio_controller {
! 29: uint8_t (*gc_pinread)(void *selfdd, uint32_t pin);
! 30: void (*gc_pinwrite)(void *selfdd, uint32_t pin, uint8_t data);
! 31: void (*gc_pinset)(void *selfdd, struct gpio_pin state);
! 32: struct gpio_pin (*gc_pinget)(void *selfdd, uint32_t pin);
! 33:
! 34: uint32_t gc_npins; /* total number of pins */
! 35:
! 36: void *gc_selfdd; /* controller's dv_devdata */
! 37: };
! 38:
! 39: #endif /* not _SYS_GPIO_H */
! 40:
CVSweb