43 int gpio_init (
unsigned int pin,
unsigned int dir);
44 int gpio_set_int (
unsigned int pin,
void (*isr) (
int),
char *mode);
46 int gpio_write (
unsigned int pin,
unsigned int val);
51 #define pinMode(pin, dir) gpio_init(pin, dir); 52 #define digitalWrite(pin, val) gpio_write(pin, val); 53 #define digitalRead(pin) gpio_read(pin); 54 #define attachInterrupt(pin, isr, mode) gpio_set_int(pin, isr, mode); 55 #define detachInterrupt(pin) gpio_clear_int(pin); int gpio_init(unsigned int pin, unsigned int dir)
Initialize the GPIO interface for the pin numbered pin on the Raspberry Pi P1 header in the direction...
int gpio_release(unsigned int pin)
The inverse of gpio_init. Frees the pin numbered pin on the Raspberry Pi P1 header, so it can be used for other purposes.
int gpio_write(unsigned int pin, unsigned int val)
Set the pin numbered pin on the Raspberry Pi P1 header to the value specified by val. dir should be either "0" or "1". The defined constants LOW or OFF may be used instead of 0 and HIGH or ON instead of 1/.
int gpio_read(unsigned int pin)
Read the value on the pin numbered pin on the Raspberry Pi P1 header.
int gpio_set_int(unsigned int pin, void(*isr)(int), char *mode)
Set isr as the interrupt service routine (ISR) for pin numbered pin on the Raspberry Pi P1 header...
int gpio_clear_int(unsigned int pin)
Clears any interrupt service routine (ISR) set on the pin numbered pin on the Raspberry Pi P1 header...