#include <stdio.h>
#include <avr/io.h>
#include <stdlib.h>
#include "variables.h"
Go to the source code of this file.
Function Documentation
Initialize the SPI port as a master. This function must be called once before using the SPI interface.
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.
- Parameters:
-
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. |
Write a block to the slave.
- Parameters:
-
data | A pointer to the contiguous memory block to write to the slave. |
len | The length of the block to write, in bytes. |
Write a byte to the slave, and get the return byte from the slave.