Nut/OS  5.0.5
API Reference
spibus_avr32.h File Reference

AVR32 specific SPI bus declarations. More...

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

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.

Detailed Description

AVR32 specific SPI bus declarations.

 * $Id: spibus_avr32.h,v 1.1 2009/01/09 17:54:38 haraldkipp Exp $
 * 

Typedef Documentation

typedef struct _AVR32SPIREG AVR32SPIREG

Function Documentation

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

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.

Here is the call graph for this function:

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.

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

References _NUTSPIBUS::bus_base, _NUTSPIBUS::bus_ready, inr, _NUTSPINODE::node_bus, and NutEventWait().

Referenced by Avr32SpiBus0Deselect(), and Avr32SpiBus1Deselect().

Here is the call graph for this function:


Variable Documentation

Avr32 SPI bus driver implementation structure.

Avr32 SPI bus driver implementation structure.