GaIA BIOS Library
Loading...
Searching...
No Matches
IOBUS Handling functions

Functions to handle IOBUS interfacing and handling. More...

Functions

void gwa_core_io_lib_speed (iobus_speed_t speed)
 IOBUS SPI speed setup.
int gwa_core_io_lib_init (void)
 Identifies hardware and initializes the core library.
const spi_module_t ** gwa_core_get_modules (void)
 Gets the list of installed modules.
void gwa_core_io_scan (void)
 Scans the io spi daisy chain.
void gwa_core_io_out_copy (void)
 Copies output values to SPI buffers.
void gwa_core_io_in_copy (void)
 Copies input values from SPI buffers.
uint16_t gwa_dip_read (void)
 Gets the DIP switch value.

Detailed Description

Functions to handle IOBUS interfacing and handling.

Function Documentation

◆ gwa_core_get_modules()

const spi_module_t ** gwa_core_get_modules ( void )

Gets the list of installed modules.

Returns
an array of descriptors of the installed modules.

◆ gwa_core_io_lib_init()

int gwa_core_io_lib_init ( void )

Identifies hardware and initializes the core library.

Returns
0 if everything was ok, an error code otherwise.

◆ gwa_core_io_lib_speed()

void gwa_core_io_lib_speed ( iobus_speed_t speed)

IOBUS SPI speed setup.

IOBUS SPI interface can operate at different clock rates, based on how many devices are connected on the IOBUS. The more devices, the slower must the IOBUS clock be, to compensate for SPI chain delays. By default, the IOBUS operates at the slowest speed; this function is called to select an higher clock speed.

Parameters
speed- IOBUS speed setting. It can be one of: iobus_default_speed, iobus_full_speed, iobus_high_speed, iobus_warp_speed Default value is iobus_default_speed

This function must be called BEFORE gwa_core_io_lib_init. Calling this function when the IOBUS is already initialized has no effect.

◆ gwa_core_io_scan()

void gwa_core_io_scan ( void )

Scans the io spi daisy chain.

The length and composition of the chain depends on the hardware configuration.

◆ gwa_dip_read()

uint16_t gwa_dip_read ( void )

Gets the DIP switch value.

Returns
the value of the DIP switch.