AVR32 specific SPI bus declarations. More...
#include <dev/spibus.h>
Go to the source code of this file.
Data Structures | |
struct | _AVR32SPIREG |
Typedefs | |
typedef struct _AVR32SPIREG | AVR32SPIREG |
Functions | |
int | Avr32Spi0ChipSelect (uint_fast8_t cs, uint_fast8_t hi) |
Set the specified chip select to a given level. | |
void | Avr32SpiBus0Interrupt (void *arg) |
int | Avr32Spi1ChipSelect (uint_fast8_t cs, uint_fast8_t hi) |
Set the specified chip select to a given level. | |
void | Avr32SpiBus1Interrupt (void *arg) |
int | Avr32SpiSetup (NUTSPINODE *node) |
Update SPI shadow registers. | |
int | Avr32SpiBusNodeInit (NUTSPINODE *node) |
Initialize an SPI bus node. | |
int | Avr32SpiBusTransfer (NUTSPINODE *node, const void *txbuf, void *rxbuf, int xlen) |
int | Avr32SpiBusDblBufTransfer (NUTSPINODE *node, const void *txbuf, void *rxbuf, int xlen) |
int | Avr32SpiBusPollTransfer (NUTSPINODE *node, const void *txbuf, void *rxbuf, int xlen) |
int | Avr32SpiBusWait (NUTSPINODE *node, uint32_t tmo) |
Wait until all SPI bus transfers are done. | |
Variables | |
NUTSPIBUS | spiBus0Avr32 |
Avr32 SPI bus driver implementation structure. | |
NUTSPIBUS | spiBus1Avr32 |
Avr32 SPI bus driver implementation structure. |
AVR32 specific SPI bus declarations.
* $Id: spibus_avr32.h,v 1.1 2009/01/09 17:54:38 haraldkipp Exp $ *
typedef struct _AVR32SPIREG AVR32SPIREG |
int Avr32Spi0ChipSelect | ( | uint_fast8_t | cs, |
uint_fast8_t | hi | ||
) |
Set the specified chip select to a given level.
References EIO, errno, and rc.
Referenced by Avr32SpiBus0Deselect(), Avr32SpiBus0Select(), and Avr32SpiBusNodeInit().
void Avr32SpiBus0Interrupt | ( | void * | arg | ) |
References AVR32_SPI0_ADDRESS, inr, NutEventPostFromIrq, and outr.
Referenced by Avr32SpiBusNodeInit().
int Avr32Spi1ChipSelect | ( | uint_fast8_t | cs, |
uint_fast8_t | hi | ||
) |
Set the specified chip select to a given level.
References EIO, errno, and rc.
Referenced by Avr32SpiBus1Deselect(), Avr32SpiBus1Select(), and Avr32SpiBusNodeInit().
void Avr32SpiBus1Interrupt | ( | void * | arg | ) |
References inr, NutEventPostFromIrq, and outr.
Referenced by Avr32SpiBusNodeInit().
int Avr32SpiSetup | ( | NUTSPINODE * | node | ) |
Update SPI shadow registers.
node | Specifies the SPI bus node. |
References _NUTSPIBUS::bus_base, _AVR32SPIREG::csr, _AVR32SPIREG::mr, _NUTSPINODE::node_bits, _NUTSPINODE::node_bus, _NUTSPINODE::node_mode, _NUTSPINODE::node_rate, _NUTSPINODE::node_stat, NULL, NUT_HWCLK_PERIPHERAL_A, NUTASSERT, NutClockGet, SPI_MODE_CPHA, SPI_MODE_CPOL, SPI_MODE_CSKEEP, SPI_MODE_FAULT, SPI_MODE_LOOPBACK, and SPI_MODE_UPDATE.
Referenced by Avr32SpiBus0Select(), Avr32SpiBus1Select(), and Avr32SpiBusNodeInit().
int Avr32SpiBusNodeInit | ( | NUTSPINODE * | node | ) |
Initialize an SPI bus node.
This routine is called for each SPI node, which is registered via NutRegisterSpiDevice().
node | Specifies the SPI bus node. |
References Avr32Spi0ChipSelect(), Avr32Spi1ChipSelect(), Avr32SpiBus0Interrupt(), Avr32SpiBus1Interrupt(), Avr32SpiSetup(), _NUTSPIBUS::bus_base, _NUTSPIBUS::bus_ready, _NUTSPIBUS::bus_sig, _AVR32SPIREG::csr, malloc(), _AVR32SPIREG::mr, _NUTSPINODE::node_bus, _NUTSPINODE::node_cs, _NUTSPINODE::node_mode, _NUTSPINODE::node_stat, NULL, NUTASSERT, NutIrqEnable(), NutRegisterIrqHandler(), outr, rc, and SPI_MODE_CSHIGH.
int Avr32SpiBusTransfer | ( | NUTSPINODE * | node, |
const void * | txbuf, | ||
void * | rxbuf, | ||
int | xlen | ||
) |
int Avr32SpiBusDblBufTransfer | ( | NUTSPINODE * | node, |
const void * | txbuf, | ||
void * | rxbuf, | ||
int | xlen | ||
) |
int Avr32SpiBusPollTransfer | ( | NUTSPINODE * | node, |
const void * | txbuf, | ||
void * | rxbuf, | ||
int | xlen | ||
) |
int Avr32SpiBusWait | ( | NUTSPINODE * | node, |
uint32_t | tmo | ||
) |
Wait until all SPI bus transfers are done.
node | Specifies the SPI bus node. |
tmo | Timeout in milliseconds. To disable timeout, set this parameter to NUT_WAIT_INFINITE. |
References _NUTSPIBUS::bus_base, _NUTSPIBUS::bus_ready, inr, _NUTSPINODE::node_bus, and NutEventWait().
Referenced by Avr32SpiBus0Deselect(), and Avr32SpiBus1Deselect().
Avr32 SPI bus driver implementation structure.
Avr32 SPI bus driver implementation structure.