#include <cfg/spi.h>
#include <sys/timer.h>
#include <sys/nutdebug.h>
#include <stdlib.h>
#include <memdebug.h>
#include <dev/spibus_at91.h>
Defines | |
#define | SPI_DOUBLE_BUFFER_MIN_TRANSFER_SIZE 4 |
Functions | |
int | At91SpiSetup (NUTSPINODE *node) |
Update SPI shadow registers. | |
int | At91SpiBusNodeInit (NUTSPINODE *node) |
Initialize an SPI bus node. |
#define SPI_DOUBLE_BUFFER_MIN_TRANSFER_SIZE 4 |
int At91SpiSetup | ( | NUTSPINODE * | node | ) |
Update SPI shadow registers.
node | Specifies the SPI bus node. |
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, NULL, 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. |
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, NULL, NUTASSERT, NutIrqEnable(), NutRegisterIrqHandler(), outr, rc, 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.