Go to the documentation of this file.
22 #include "arduino_board.h"
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,
173 void transfer(
void *buf,
size_t count);
SPIClass SPI
: Instance of the SPI interface as required by the Arduino API
Functions to work with different byte orders.
void setClockDivider(uint8_t divider)
Sets the SPI clock in an archaic manner.
Low-level SPI peripheral driver interface definition.
#define MSBFIRST
most significat bit first
void setDataMode(uint8_t mode)
Sets the SPI mode (clock phase and polarity)
static uint16_t ntohs(uint16_t v)
Convert from network byte order to host byte order, 16 bit.
uint8_t transfer(uint8_t data)
Transfer a single byte of data.
#define SPI_DEV(x)
Default SPI device access macro.
void endTransaction()
Releases the SPI interface.
Arduino SPI configuration interface.
SPIClass(spi_t spi_dev)
Create a new SPI interface instance.
spi_mode_t
Available SPI modes, defining the configuration of clock polarity and clock phase.
spi_clk_t
Available SPI clock speeds.
void setBitOrder(uint8_t order)
Sets the bit order to the given value.
SPISettings()
Create a new SPI settings instance with default settings.
Recursive Mutex for thread synchronization.
static uint16_t htons(uint16_t v)
Convert from host byte order to network byte order, 16 bit.
void begin()
Doesn't do anything, for compatibility only.
void beginTransaction(SPISettings settings)
Acquires the SPI interface and applies the given settings.
#define SPI_MODE0
CPOL=0, CPHA=0.
void end()
Doesn't do anything, for compatibility only.
uint16_t transfer16(uint16_t data)
Transfer two bytes of data.
unsigned int spi_t
Default type for SPI devices.
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.