45#define SPI_CLOCK_DIV2 (0)
46#define SPI_CLOCK_DIV4 (1)
47#define SPI_CLOCK_DIV8 (1)
48#define SPI_CLOCK_DIV16 (1)
49#define SPI_CLOCK_DIV32 (2)
50#define SPI_CLOCK_DIV64 (3)
51#define SPI_CLOCK_DIV128 (3)
82 SPISettings(uint32_t clock_hz, uint8_t bitOrder, uint8_t dataMode);
125 SPIClass(uint8_t uc_pinMISO, uint8_t uc_pinSCK, uint8_t uc_pinMOSI,
Configuration of the Arduino API for Arduino Atmega boards.
Functions to work with different byte orders.
static uint16_t ntohs(uint16_t v)
Convert from network byte order to host byte order, 16 bit.
static uint16_t htons(uint16_t v)
Convert from host byte order to network byte order, 16 bit.
void setDataMode(uint8_t mode)
Sets the SPI mode (clock phase and polarity)
void begin()
Doesn't do anything, for compatibility only.
void setClockDivider(uint8_t divider)
Sets the SPI clock in an archaic manner.
uint16_t transfer16(uint16_t data)
Transfer two bytes of data.
void end()
Doesn't do anything, for compatibility only.
SPIClass(spi_t spi_dev)
Create a new SPI interface instance.
SPIClass(uint8_t uc_pinMISO, uint8_t uc_pinSCK, uint8_t uc_pinMOSI, uint8_t uc_pinSS, uint8_t uc_mux)
Create a new SPI interface instance for SPI device 0.
void setBitOrder(uint8_t order)
Sets the bit order to the given value.
void endTransaction()
Releases the SPI interface.
void beginTransaction(SPISettings settings)
Acquires the SPI interface and applies the given settings.
void transfer(void *buf, size_t count)
Transfer data.
uint8_t transfer(uint8_t data)
Transfer a single byte of data.
Arduino SPI configuration interface.
SPISettings()
Create a new SPI settings instance with default settings.
SPISettings(uint32_t clock_hz, uint8_t bitOrder, uint8_t dataMode)
Create a new SPI settings instance.
#define SPI_DEV(x)
Default SPI device access macro.
spi_mode_t
Support SPI modes.
Recursive Mutex for thread synchronization.
Low-level SPI peripheral driver interface definition.
#define MSBFIRST
most significant bit first
SPIClass SPI
: Instance of the SPI interface as required by the Arduino API
#define SPI_MODE0
CPOL=0, CPHA=0.