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 $ *
Definition in file spibus_avr32.h.
| typedef struct _AVR32SPIREG AVR32SPIREG | 
Definition at line 48 of file spibus_avr32.h.
| int Avr32Spi0ChipSelect | ( | uint_fast8_t | cs, | 
| uint_fast8_t | hi | ||
| ) | 
Set the specified chip select to a given level.
Definition at line 212 of file spibus0.c.
Referenced by Avr32SpiBus0Deselect(), Avr32SpiBus0Select(), and Avr32SpiBusNodeInit().
| void Avr32SpiBus0Interrupt | ( | void * | arg | ) | 
Definition at line 353 of file spibus0.c.
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.
Definition at line 194 of file spibus1.c.
Referenced by Avr32SpiBus1Deselect(), Avr32SpiBus1Select(), and Avr32SpiBusNodeInit().
| void Avr32SpiBus1Interrupt | ( | void * | arg | ) | 
Definition at line 335 of file spibus1.c.
References inr, NutEventPostFromIrq, and outr.
Referenced by Avr32SpiBusNodeInit().
| int Avr32SpiSetup | ( | NUTSPINODE * | node | ) | 
Update SPI shadow registers.
| node | Specifies the SPI bus node. | 
Definition at line 75 of file spibus.c.
References _NUTSPIBUS::bus_base, _AVR32SPIREG::csr, _AVR32SPIREG::mr, _NUTSPINODE::node_bits, _NUTSPINODE::node_bus, _NUTSPINODE::node_mode, _NUTSPINODE::node_rate, _NUTSPINODE::node_stat, 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. | 
Definition at line 145 of file spibus.c.
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, NUTASSERT, NutIrqEnable(), NutRegisterIrqHandler(), outr, 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. | 
Definition at line 294 of file spibus.c.
References _NUTSPIBUS::bus_base, _NUTSPIBUS::bus_ready, inr, _NUTSPINODE::node_bus, and NutEventWait().
Referenced by Avr32SpiBus0Deselect(), and Avr32SpiBus1Deselect().
