Nut/OS  5.0.5
API Reference
spibus_gpio.h File Reference

GPIO SPI bus declarations. More...

#include <dev/spibus.h>
Include dependency graph for spibus_gpio.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _GSPIREG

Typedefs

typedef struct _GSPIREG GSPIREG

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.

Variables

NUTSPIBUS spiBus0Gpio
 AVR SPI bus driver implementation structure.

Detailed Description

GPIO SPI bus declarations.

 * $Id: spibus_gpio.h 4470 2012-08-20 14:06:43Z haraldkipp $
 * 

Typedef Documentation

typedef struct _GSPIREG GSPIREG

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:


Variable Documentation

AVR SPI bus driver implementation structure.