Namespaces | |
RAM | |
Test | |
Classes | |
class | Controller |
Manages access to SPI hardware. More... | |
struct | Data |
Specifies a block incoming or outgoing data. More... | |
class | Device |
Manages a specific SPI device instance attached to a controller. More... | |
struct | IoModeInfo |
class | MemoryDevice |
Base class for read/write addressable devices. More... | |
struct | Request |
Defines an SPI Request Packet. More... | |
struct | SpiPins |
SPI pin connections. More... | |
class | StreamAdapter |
Helper class for streaming data to/from SPI devices. More... | |
Typedefs | |
using | IoModes = BitSet< uint16_t, IoMode, unsigned(IoMode::MAX)> |
using | ByteOrder = uint8_t |
using | BitOrder = uint8_t |
using | Callback = bool(*)(Request &request) |
SPI completion callback routine. More... | |
Enumerations | |
enum | ClockMode : uint8_t { ClockMode::mode0 = 0x00, ClockMode::mode1 = 0x01, ClockMode::mode2 = 0x10, ClockMode::mode3 = 0x11 } |
SPI clock polarity (CPOL) and phase (CPHA) More... | |
enum | IoMode : uint8_t { IoMode::SPI, IoMode::SPIHD, IoMode::SPI3WIRE, IoMode::DUAL, IoMode::DIO, IoMode::SDI, IoMode::QUAD, IoMode::QIO, IoMode::SQI, IoMode::MAX } |
Mode of data transfer. More... | |
enum | PinSet { PinSet::none, PinSet::normal, PinSet::manual, PinSet::overlap } |
How SPI hardware pins are connected. More... | |
Functions | |
constexpr IoModes | operator| (IoMode a, IoMode b) |
const IoModeInfo | getIoModeInfo (IoMode mode) |
String | toString (IoMode mode) |
uint16_t | bswap16 (uint16_t value) |
uint32_t | bswap24 (uint32_t value) |
uint32_t | bswap32 (uint32_t value) |
Request * | reQueueRequest (Request *head, Request *request) |
Support function for fast request re-queuing. More... | |
Variables | |
static constexpr uint8_t | SPI_PIN_NONE {0xff} |
static constexpr uint8_t | SPI_PIN_DEFAULT {0xfe} |
Typedef Documentation
◆ BitOrder
using HSPI::BitOrder = typedef uint8_t |
◆ ByteOrder
using HSPI::ByteOrder = typedef uint8_t |
◆ IoModes
using HSPI::IoModes = typedef BitSet<uint16_t, IoMode, unsigned(IoMode::MAX)> |
Enumeration Type Documentation
◆ ClockMode
|
strong |
◆ IoMode
|
strong |
Mode of data transfer.
Enumerator | |
---|---|
SPI | One bit per clock, MISO stage concurrent with MISO (full-duplex) |
SPIHD | One bit per clock, MISO stage follows MOSI (half-duplex) |
SPI3WIRE | Half-duplex using MOSI for both sending and receiving data. |
DUAL | Two bits per clock for Data, 1-bit for Command and Address. |
DIO | Two bits per clock for Address and Data, 1-bit for Command. |
SDI | Two bits per clock for Command, Address and Data. |
QUAD | Four bits per clock for Data, 1-bit for Command and Address. |
QIO | Four bits per clock for Address and Data, 1-bit for Command. |
SQI | Four bits per clock for Command, Address and Data. |
MAX |
◆ PinSet
|
strong |
Function Documentation
◆ bswap16()
◆ bswap24()
|
inline |
◆ bswap32()
|
inline |
◆ getIoModeInfo()
const IoModeInfo HSPI::getIoModeInfo | ( | IoMode | mode | ) |
◆ operator|()
◆ reQueueRequest()
Support function for fast request re-queuing.
- Parameters
-
head The current queue head request The request to append
- Return values
-
Request* The new queue head
Append a request back onto the queue.
Don't just put it at the front of the queue though as it will block any other requests. So it goes at the end. BUT! we must preserve execution order for all requests for a given device, so any other requests for the same device must go after it.
The easiest way to do this is to build two queues, one off the current request (A) and the other containing all other requests (B). We then append (A) to (B) and set the head to the start of (B).
This is kind of laborious but fast as it's just pointer manipulation.
◆ toString()
Variable Documentation
◆ SPI_PIN_DEFAULT
|
staticconstexpr |
◆ SPI_PIN_NONE
|
staticconstexpr |