General purpose input/output port unit (GPIO) HW driver header file.
More...
#include <stdint.h>
Go to the source code of this file.
General purpose input/output port unit (GPIO) HW driver header file.
- Note
- These functions should only be used if the GPIO unit was synthesized (IO_GPIO_EN = true).
- See also
- https://stnolting.github.io/neorv32/sw/files.html
◆ NEORV32_GPIO
◆ neorv32_gpio_available()
int neorv32_gpio_available |
( |
void | | ) |
|
Check if GPIO unit was synthesized.
- Returns
- 0 if GPIO was not synthesized, 1 if GPIO is available.
◆ neorv32_gpio_pin_get()
uint32_t neorv32_gpio_pin_get |
( |
int | pin | ) |
|
Get single pin of GPIO's input port.
- Parameters
-
[in] | pin | Input pin to be read (0..63). |
- Returns
- =0 if pin is low, !=0 if pin is high.
◆ neorv32_gpio_pin_set()
void neorv32_gpio_pin_set |
( |
int | pin, |
|
|
int | value ) |
Set single pin of GPIO's output port.
- Parameters
-
[in] | pin | Output pin number to be set (0..63). |
[in] | value | Set pint high (1) or low (0). |
◆ neorv32_gpio_pin_toggle()
void neorv32_gpio_pin_toggle |
( |
int | pin | ) |
|
Toggle single pin of GPIO's output port.
- Parameters
-
[in] | pin | Output pin number to be toggled (0..63). |
◆ neorv32_gpio_port_get()
uint64_t neorv32_gpio_port_get |
( |
void | | ) |
|
Get complete GPIO input port.
- Returns
- Current input port state (64-bit).
◆ neorv32_gpio_port_set()
void neorv32_gpio_port_set |
( |
uint64_t | port_data | ) |
|
Set complete GPIO output port.
- Parameters
-
[in] | port_data | New output port value (64-bit). |
◆ neorv32_gpio_port_toggle()
void neorv32_gpio_port_toggle |
( |
uint64_t | toggle | ) |
|
Toggle bit in entire GPIO output port.
- Parameters
-
[in] | toggle | Bit mask; set bits will toggle the according output port (64-bit). |