Nut/OS  5.0.5
API Reference
spibus_gpio.c File Reference
#include <sys/timer.h>
#include <sys/nutdebug.h>
#include <dev/spibus_gpio.h>
Include dependency graph for spibus_gpio.c:

Functions

uint_fast32_t GpioSpiBusSetRate (NUTSPINODE *node, uint_fast32_t rate)
 Set clock rate of a specified SPI device.
int GpioSpiSetup (NUTSPINODE *node)
 Update SPI settings.

Function Documentation

uint_fast32_t GpioSpiBusSetRate ( NUTSPINODE node,
uint_fast32_t  rate 
)

Set clock rate of a specified SPI device.

The new clock rate will be used for the next transfer. If the given rate is beyond the capabilities of the bus controller, it will automatically adjusted before the transfer starts.

Parameters:
nodeSpecifies the SPI bus node.
rateNew clock rate, given in bits per second. If the value is SPI_CURRENT_RATE, then the current rate is kept.
Returns:
Previous rate.

References _GSPIREG::gspi_dly_rate, _NUTSPINODE::node_mode, _NUTSPINODE::node_rate, _NUTSPINODE::node_stat, NULL, NUTASSERT, rc, SPI_CURRENT_RATE, and SPI_MODE_UPDATE.

Referenced by GpioSpiSetup().

int GpioSpiSetup ( NUTSPINODE node)

Update SPI settings.

References GpioSpiBusSetRate(), _NUTSPINODE::node_bits, _NUTSPINODE::node_mode, _NUTSPINODE::node_rate, and SPI_MODE_UPDATE.

Referenced by GpioSpiBus0NodeInit(), and GpioSpiBus0Select().

Here is the call graph for this function: