Nut/OS  4.10.3
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 $
 * 

Definition in file spibus_avr32.h.


Typedef Documentation

typedef struct _AVR32SPIREG AVR32SPIREG

Definition at line 48 of file spibus_avr32.h.


Function Documentation

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.

References EIO, and errno.

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.

References EIO, and errno.

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

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.

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.

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

Here is the call graph for this function:


Variable Documentation

Avr32 SPI bus driver implementation structure.

Definition at line 421 of file spibus0.c.

Avr32 SPI bus driver implementation structure.

Definition at line 403 of file spibus1.c.