32volatile uint32_t *
gpio = NULL;
74 pynq_error(
"gpio_set_direction: pin %d is invalid, must be 0..%d-1\n",
pin,
78 pynq_error(
"gpio_set_direction: invalid direction %d", dir);
80 int pin_bank =
pin % 32;
81 int bank =
pin < 32 ? 1 : 3;
83 gpio[bank] =
gpio[bank] | (1 << pin_bank);
85 gpio[bank] =
gpio[bank] & ~(1 << pin_bank);
91 pynq_error(
"gpio_get_direction: pin %d is invalid, must be 0..%d-1\n",
pin,
94 int pin_bank =
pin % 32;
95 int bank =
pin < 32 ? 1 : 3;
103 pynq_error(
"gpio_set_level: pin %d is invalid, must be 0..%d-1\n",
pin,
107 pynq_error(
"gpio_set_level: level %d is invalid", level);
109 int pin_bank =
pin % 32;
110 int bank =
pin < 32 ? 0 : 2;
112 gpio[bank] =
gpio[bank] | (1 << pin_bank);
114 gpio[bank] =
gpio[bank] & ~(1 << pin_bank);
120 pynq_error(
"gpio_get_level: pin %d is invalid, must be 0..%d-1\n",
pin,
123 int pin_bank =
pin % 32;
124 int bank =
pin < 32 ? 0 : 2;
volatile uint32_t * intc0
void arm_shared_close(arm_shared *handle)
void * arm_shared_init(arm_shared *handle, const uint32_t address, const uint32_t length)
void gpio_reset(void)
Reset all GPIO pins.
gpio_direction_t gpio_get_direction(const gpio_t pin)
Returns the direction the set pin is initialized in.
gpio_level_t gpio_get_level(const gpio_t pin)
Return the level of the GPIO pin.
void gpio_set_level(const gpio_t pin, const gpio_level_t level)
Set the level of the output GPIO pin. If the pin is configured as input, this function does nothing.
void gpio_reset_pin(const gpio_t pin)
Function is currently a no-op placeholder for arduino compatibility.
void gpio_set_direction(const gpio_t pin, const gpio_direction_t dir)
Set the GPIO pin as in input or output.
#define NUM_SWITCHBOX_PINS