spibus_at91.h File Reference

AT91 specific SPI bus declarations. More...

Go to the source code of this file.

Data Structures

struct  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)
 Wait until all SPI bus transfers are done.

Variables

NUTSPIBUS spiBus0At91
 AT91 SPI bus driver implementation structure.

Detailed Description

AT91 specific SPI bus declarations.

 * $Id: spibus_at91.h 2375 2009-01-09 17:54:38Z haraldkipp $
 * 

Definition in file spibus_at91.h.


Function Documentation

int At91Spi0ChipSelect ( uint_fast8_t  cs,
uint_fast8_t  hi 
)

Set the specified chip select to a given level.

Definition at line 121 of file spibus0at91.c.

References EIO, and errno.

Referenced by At91SpiBus0Deselect(), At91SpiBus0Select(), and At91SpiBusNodeInit().

void At91SpiBus0Interrupt ( void *  arg  ) 

Definition at line 260 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.

Parameters:
node Specifies the SPI bus node.
Returns:
Always 0.

Definition at line 72 of file spibus_at91.c.

References 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().

Parameters:
node Specifies the SPI bus node.
Returns:
0 on success or -1 if there is no valid chip select.

Definition at line 137 of file spibus_at91.c.

References At91Spi0ChipSelect(), At91Spi1ChipSelect(), At91SpiBus0Interrupt(), At91SpiBus1Interrupt(), At91SpiSetup(), malloc, 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 
)

Wait until all SPI bus transfers are done.

Parameters:
node Specifies the SPI bus node.
tmo Timeout in milliseconds. To disable timeout, set this parameter to NUT_WAIT_INFINITE.
Returns:
Always 0.

Definition at line 343 of file spibus_at91.c.

References inr, NutEventWait(), SPI_RXBUFF, and SPI_SR_OFF.

Referenced by At91SpiBus0Deselect().


Variable Documentation

NUTSPIBUS spiBus0At91

AT91 SPI bus driver implementation structure.

Definition at line 328 of file spibus0at91.c.


© 2000-2007 by egnite Software GmbH - visit http://www.ethernut.de/