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. |
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.
node | Specifies the SPI bus node. |
rate | New clock rate, given in bits per second. If the value is SPI_CURRENT_RATE, then the current rate is kept. |
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().