AT91 specific SPI bus declarations. More...
#include <dev/spibus.h>
Go to the source code of this file.
Data Structures | |
struct | _AT91SPIREG |
Typedefs | |
typedef struct _AT91SPIREG | AT91SPIREG |
Functions | |
int | At91Spi0ChipSelect (uint_fast8_t cs, uint_fast8_t hi) |
Set the specified chip select to a given level. | |
void | At91SpiBus0Interrupt (void *arg) |
int | At91Spi1ChipSelect (uint_fast8_t cs, uint_fast8_t hi) |
void | At91SpiBus1Interrupt (void *arg) |
int | At91SpiSetup (NUTSPINODE *node) |
Update SPI shadow registers. | |
int | At91SpiBusNodeInit (NUTSPINODE *node) |
Initialize an SPI bus node. | |
int | At91SpiBusTransfer (NUTSPINODE *node, CONST void *txbuf, void *rxbuf, int xlen) |
int | At91SpiBusDblBufTransfer (NUTSPINODE *node, CONST void *txbuf, void *rxbuf, int xlen) |
int | At91SpiBusPollTransfer (NUTSPINODE *node, CONST void *txbuf, void *rxbuf, int xlen) |
int | At91SpiBusWait (NUTSPINODE *node, uint32_t tmo) |
Variables | |
NUTSPIBUS | spiBus0At91 |
AT91 SPI bus driver implementation structure. | |
NUTSPIBUS | spiBus1At91 |
AT91 specific SPI bus declarations.
* $Id: spibus_at91.h 2614 2009-04-15 13:53:30Z haraldkipp $ *
Definition in file spibus_at91.h.
typedef struct _AT91SPIREG AT91SPIREG |
Definition at line 48 of file spibus_at91.h.
int At91Spi0ChipSelect | ( | uint_fast8_t | cs, |
uint_fast8_t | hi | ||
) |
Set the specified chip select to a given level.
Definition at line 169 of file spibus0at91.c.
Referenced by At91SpiBus0Deselect(), At91SpiBus0Select(), and At91SpiBusNodeInit().
void At91SpiBus0Interrupt | ( | void * | arg | ) |
Definition at line 314 of file spibus0at91.c.
References inb, NutEventPostFromIrq, and outb.
Referenced by At91SpiBusNodeInit().
int At91Spi1ChipSelect | ( | uint_fast8_t | cs, |
uint_fast8_t | hi | ||
) |
Referenced by At91SpiBusNodeInit().
void At91SpiBus1Interrupt | ( | void * | arg | ) |
Referenced by At91SpiBusNodeInit().
int At91SpiSetup | ( | NUTSPINODE * | node | ) |
Update SPI shadow registers.
node | Specifies the SPI bus node. |
Definition at line 74 of file spibus_at91.c.
References _AT91SPIREG::at91spi_csr, _AT91SPIREG::at91spi_mr, _NUTSPIBUS::bus_base, _NUTSPINODE::node_bits, _NUTSPINODE::node_bus, _NUTSPINODE::node_mode, _NUTSPINODE::node_rate, _NUTSPINODE::node_stat, NUT_HWCLK_PERIPHERAL, NUTASSERT, NutClockGet, SPI_BITS, SPI_BITS_LSB, SPI_CPOL, SPI_CSAAT, SPI_LLB, SPI_MODE_CPHA, SPI_MODE_CPOL, SPI_MODE_CSKEEP, SPI_MODE_FAULT, SPI_MODE_LOOPBACK, SPI_MODE_UPDATE, SPI_MODFDIS, SPI_NCPHA, SPI_SCBR, and SPI_SCBR_LSB.
Referenced by At91SpiBus0Select(), and At91SpiBusNodeInit().
int At91SpiBusNodeInit | ( | 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 139 of file spibus_at91.c.
References At91Spi0ChipSelect(), At91Spi1ChipSelect(), _AT91SPIREG::at91spi_csr, _AT91SPIREG::at91spi_mr, At91SpiBus0Interrupt(), At91SpiBus1Interrupt(), At91SpiSetup(), _NUTSPIBUS::bus_base, _NUTSPIBUS::bus_ready, _NUTSPIBUS::bus_sig, malloc(), _NUTSPINODE::node_bus, _NUTSPINODE::node_cs, _NUTSPINODE::node_mode, _NUTSPINODE::node_stat, NUTASSERT, NutIrqEnable(), NutRegisterIrqHandler(), outr, SPI1_BASE, SPI_IDR_OFF, SPI_MODE_CSHIGH, SPI_MODFDIS, SPI_MSTR, SPI_PCS_0, SPI_PCS_1, SPI_PCS_2, and SPI_PCS_3.
int At91SpiBusTransfer | ( | NUTSPINODE * | node, |
CONST void * | txbuf, | ||
void * | rxbuf, | ||
int | xlen | ||
) |
int At91SpiBusDblBufTransfer | ( | NUTSPINODE * | node, |
CONST void * | txbuf, | ||
void * | rxbuf, | ||
int | xlen | ||
) |
int At91SpiBusPollTransfer | ( | NUTSPINODE * | node, |
CONST void * | txbuf, | ||
void * | rxbuf, | ||
int | xlen | ||
) |
int At91SpiBusWait | ( | NUTSPINODE * | node, |
uint32_t | tmo | ||
) |
Referenced by At91SpiBus0Deselect().
AT91 SPI bus driver implementation structure.
Definition at line 382 of file spibus0at91.c.