PowerBlocks SDK
 
Loading...
Searching...
No Matches
gpio.h
Go to the documentation of this file.
1#
11
12#pragma once
13
14#include <stdint.h>
15#include <stdbool.h>
16
17// There are more bits, these are just the one that the
18// PowerPC side has access to.
19#define GPIO_SLOT_LED 0x000020 // Blue LEDs around the disk reader
20#define GPIO_SLOT_IN 0x000080 // High when tilt switch in disk reader is presses.
21#define GPIO_SENSOR_BAR 0x000100 // Turns on the sensor bar.
22#define GPIO_EJECT 0x000200 // Pulse to eject disk
23#define GPIO_AVE_SCL 0x004000 // AVE Encoder I2C Clock
24#define GPIO_AVE_SDA 0x008000 // AVE Encoder I2C SDA
25
33extern void gpio_write(uint32_t bit, bool set);
34
42extern bool gpio_read(uint32_t bit);
43
54extern void gpio_set_direction(uint32_t bit, bool direction);
55
56
void gpio_set_direction(uint32_t bit, bool direction)
Sets the direction of the GPIO.
Definition gpio.c:35
void gpio_write(uint32_t bit, bool set)
Writes a GPIO output.
Definition gpio.c:23
bool gpio_read(uint32_t bit)
Reads a GPIO Input.
Definition gpio.c:31