TTK4155 Lab Node 1
Term project in the NTNU course TTK4155 Embedded and Industrial Computer Systems Design
Loading...
Searching...
No Matches
spi.h File Reference

SPI driver. More...

Go to the source code of this file.

Enumerations

enum  spi_slave { SSB2 , SSB3 , SSE2 }
 Identifiers for available SPI slave devices. More...

Functions

int spi_init (void)
 Initialize SPI in master mode.
int spi_ready (void)
 Check if the SPI subsystem is initialized.
int spi_send_n (enum spi_slave *slave, unsigned char *data, int length)
 Send a sequence of bytes to a slave without reading response.
int spi_send (enum spi_slave *slave, unsigned char data)
 Send a single byte to a slave.
int spi_recieve (enum spi_slave *slave, unsigned char *out)
 Receive one byte from a slave.
int spi_recieve_n (enum spi_slave *slave, unsigned char *out, int length)
 Receive several bytes from a slave.
int spi_duplex (enum spi_slave *slave, unsigned char *data, unsigned char *out, int length)
 Full-duplex SPI transfer.
int spi_set_slave_select (enum spi_slave *slave, unsigned char state)
 Set the slave-select line for the given device.
int spi_push (enum spi_slave *slave, unsigned char data, unsigned char *out)
 Push one byte to a slave and optionally read the response.

Detailed Description

SPI driver.

Definition in file spi.h.