Nut/OS  4.10.3
API Reference
spibus_at91.h File Reference

AT91 specific SPI bus declarations. More...

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

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

Detailed Description

AT91 specific SPI bus declarations.

 * $Id: spibus_at91.h 2614 2009-04-15 13:53:30Z haraldkipp $
 * 

Definition in file spibus_at91.h.


Typedef Documentation

typedef struct _AT91SPIREG AT91SPIREG

Definition at line 48 of 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 169 of file spibus0at91.c.

References EIO, and errno.

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 At91SpiBusNodeInit ( NUTSPINODE node)

Initialize an SPI bus node.

This routine is called for each SPI node, which is registered via NutRegisterSpiDevice().

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

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.

Here is the call graph for this function:

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


Variable Documentation

AT91 SPI bus driver implementation structure.

Definition at line 382 of file spibus0at91.c.