NEORV32 - Software Framework Documentation
Functions
neorv32_gpio.h File Reference

General purpose input/output port unit (GPIO) HW driver header file. More...

Go to the source code of this file.

Functions

int neorv32_gpio_available (void)
 
void neorv32_gpio_pin_set (int pin)
 
void neorv32_gpio_pin_clr (int pin)
 
void neorv32_gpio_pin_toggle (int pin)
 
uint32_t neorv32_gpio_pin_get (int pin)
 
void neorv32_gpio_port_set (uint64_t d)
 
uint64_t neorv32_gpio_port_get (void)
 

Detailed Description

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).

Function Documentation

◆ 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_clr()

void neorv32_gpio_pin_clr ( int  pin)

Clear single pin of GPIO's output port.

Parameters
[in]pinOutput pin number to be cleared (0..63).

◆ neorv32_gpio_pin_get()

uint32_t neorv32_gpio_pin_get ( int  pin)

Get single pin of GPIO's input port.

Parameters
[in]pinInput 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)

Set single pin of GPIO's output port.

Parameters
[in]pinOutput pin number to be set (0..63).

◆ neorv32_gpio_pin_toggle()

void neorv32_gpio_pin_toggle ( int  pin)

Toggle single pin of GPIO's output port.

Parameters
[in]pinOutput 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_dataNew output port value (64-bit).