Bare Metal Programming Tool Kit
|
a spi channel to a specific peripheral chip More...
#include <spi.h>
Public Types | |
enum | { type = type_spi_channel } |
identify this type as a spi channel | |
Static Public Member Functions | |
static void | init () |
intilialize the spi channel and the underlying spi bus | |
static void | transaction_in_out_n (unsigned char *input, unsigned char *output, int n_bytes) |
spi read-and-write transaction | |
static void | transaction_in_n (unsigned char *input, int n_bytes) |
spi read-only transaction | |
static void | transaction_out_n (unsigned char *output, int n_bytes) |
spi write-only transaction | |
a spi channel to a specific peripheral chip
This template represents a spi channel to one specific chip or chain of chips. It is created from a spi bus (which represents the sclk, miso and mosi lines, and the maximum bus frequency) and the ss (slave select) line, and the spi mode. The ss line is acive low.
|
inlinestatic |
spi read-and-write transaction
This method performs an n_byte spi write-and-read transaction. The output pointer must point to the array of bytes to be written, the input pointer must point to the array of bytes to be read. Both arrays must be n_bytes long. Alternatively, one of the pointers can be 0. (In fact both can be 0, but that would be pointless.)