#include <software_spi.h>
template<typename SI, typename SO, typename SCK, typename CE, unsigned numNops>
class miosix::SoftwareSPI< SI, SO, SCK, CE, numNops >
Software implementation of the SPI protocol mode 0 (CPOL=0, CPHA=0 mode)
- Parameters
-
SI | an instance of the Gpio class indicating the SPI input pin |
SO | an instance of the Gpio class indicating the SPI output pin |
SCK | an instance of the Gpio class indicating the SPI clock pin |
CE | an instance of the Gpio class indicating the SPI chip enable pin |
numNops | number of nops to add to the send loop to slow down SPI clock |
template<typename SI , typename SO , typename SCK , typename CE , unsigned numNops>
Pull CE high, indicating transmission end.
template<typename SI , typename SO , typename SCK , typename CE , unsigned numNops>
Pull CE low, indicating transmission start.
template<typename SI , typename SO , typename SCK , typename CE , unsigned numNops>
Initialize the SPI interface
template<typename SI , typename SO , typename SCK , typename CE , unsigned numNops>
unsigned char miosix::SoftwareSPI< SI, SO, SCK, CE, numNops >::sendRecvChar |
( |
unsigned char |
data | ) |
|
|
static |
Send a byte and, since SPI is full duplex, simultaneously receive a byte
- Parameters
-
- Returns
- data received
template<typename SI , typename SO , typename SCK , typename CE , unsigned numNops>
unsigned int miosix::SoftwareSPI< SI, SO, SCK, CE, numNops >::sendRecvLong |
( |
unsigned int |
data | ) |
|
|
static |
Send an int and, since SPI is full duplex, simultaneously receive an int
- Parameters
-
- Returns
- data received
template<typename SI , typename SO , typename SCK , typename CE , unsigned numNops>
unsigned short miosix::SoftwareSPI< SI, SO, SCK, CE, numNops >::sendRecvShort |
( |
unsigned short |
data | ) |
|
|
static |
Send an unsigned short and, since SPI is full duplex, simultaneously receive an unsigned short
- Parameters
-
- Returns
- data received
The documentation for this class was generated from the following file: