Elisa3
|
Defines | |
#define | SPI_DDR DDRB |
#define | SPI_PORT PORTB |
#define | SPI_MOSI PORTB2 |
#define | SPI_MISO PORTB3 |
#define | SPI_SCK PORTB1 |
#define | SPI_SS PORTB0 |
Functions | |
void | SPI_WAIT () |
void | initSPI () |
void | closeSPI () |
void | SPI_ReadWrite_Block (uint8_t *data, uint8_t *buffer, uint8_t len) |
void | SPI_Write_Block (uint8_t *data, uint8_t len) |
uint8_t | SPI_Write_Byte (uint8_t byte) |
#define SPI_DDR DDRB |
#define SPI_MISO PORTB3 |
#define SPI_MOSI PORTB2 |
#define SPI_PORT PORTB |
#define SPI_SCK PORTB1 |
#define SPI_SS PORTB0 |
void closeSPI | ( | ) |
void initSPI | ( | ) |
Initialize the SPI port as a master. This function must be called once before using the SPI interface.
void SPI_ReadWrite_Block | ( | uint8_t * | data, |
uint8_t * | buffer, | ||
uint8_t | len | ||
) |
Write a block of data to the slave, and read the data returned from the slave into a buffer. The data and buffer memory blocks must be the same length.
data | A pointer to the contiguous memory block to write to the slave. |
buffer | A pointer to the contiguous memory block to which the SPI data are to be written. |
len | The length of the memory blocks, in bytes. |
void SPI_WAIT | ( | ) |
void SPI_Write_Block | ( | uint8_t * | data, |
uint8_t | len | ||
) |
Write a block to the slave.
data | A pointer to the contiguous memory block to write to the slave. |
len | The length of the block to write, in bytes. |
uint8_t SPI_Write_Byte | ( | uint8_t | data | ) |
Write a byte to the slave, and get the return byte from the slave.