74 #define HSPI_IOMODE_MAP(XX) \
75 XX(SPI, 1, 1, 1, true) \
76 XX(SPIHD, 1, 1, 1, false) \
77 XX(SPI3WIRE, 1, 1, 1, false) \
78 XX(DUAL, 1, 1, 2, false) \
79 XX(DIO, 1, 2, 2, false) \
80 XX(SDI, 2, 2, 2, false) \
81 XX(QUAD, 1, 1, 4, false) \
82 XX(QIO, 1, 4, 4, false) \
83 XX(SQI, 4, 4, 4, false)
119 return (value >> 8) | (value << 8);
124 return ((value >> 16) & 0x0000ff) | (value & 0x00ff00) | ((value << 16) & 0xff0000);
129 return (value >> 24) | ((value >> 8) & 0xff00) | ((value << 8) & 0xff0000) | (value << 24);
Manage a set of bit values using enumeration.
Definition: BitSet.h:45
static constexpr S bitVal(E e)
Get the bitmask corresponding to a given value.
Definition: BitSet.h:150
describes a counted string stored in flash memory
Definition: String.hpp:174
The String class.
Definition: WString.h:137
ClockMode
SPI clock polarity (CPOL) and phase (CPHA)
Definition: Common.h:39
IoMode
Mode of data transfer.
Definition: Common.h:49
@ SQI
Four bits per clock for Command, Address and Data.
@ SPIHD
One bit per clock, MISO stage follows MOSI (half-duplex)
@ SPI
One bit per clock, MISO stage concurrent with MISO (full-duplex)
@ SPI3WIRE
Half-duplex using MOSI for both sending and receiving data.
@ DIO
Two bits per clock for Address and Data, 1-bit for Command.
@ DUAL
Two bits per clock for Data, 1-bit for Command and Address.
@ QIO
Four bits per clock for Address and Data, 1-bit for Command.
@ QUAD
Four bits per clock for Data, 1-bit for Command and Address.
@ SDI
Two bits per clock for Command, Address and Data.
PinSet
How SPI hardware pins are connected.
Definition: Common.h:108
@ manual
HSPI pins with manual chip select.
@ overlap
Overlapped with SPI 0.
@ normal
Standard HSPI pins.
constexpr IoModes operator|(IoMode a, IoMode b)
Definition: Common.h:64
uint32_t bswap24(uint32_t value)
Definition: Common.h:122
const IoModeInfo getIoModeInfo(IoMode mode)
uint8_t BitOrder
Definition: Common.h:103
uint32_t bswap32(uint32_t value)
Definition: Common.h:127
uint16_t bswap16(uint16_t value)
Definition: Common.h:117
uint8_t ByteOrder
Definition: Common.h:102
BitSet< uint16_t, IoMode, unsigned(IoMode::MAX)> IoModes
Definition: Common.h:62
String toString(IoMode mode)
Definition: Common.h:96
uint8_t addrressBits
Definition: Common.h:89
uint8_t clockBits
Definition: Common.h:88
uint8_t dataBits
Definition: Common.h:90
const FlashString * name
Definition: Common.h:86
IoMode mode
Definition: Common.h:87
bool duplex
Definition: Common.h:91