CHGame 0.3.0
Libraries for the CHGame handheld
Loading...
Searching...
No Matches
SPISettings Class Reference

A device's SPI settings: its maximum clock, bit order and mode, for SPIClass::beginTransaction(). More...

#include <SPI.h>

Public Member Functions

constexpr SPISettings (uint32_t clock, BitOrder bitOrder, uint8_t dataMode, bool noRecv=SPI_TRANSMITRECEIVE)
 Settings for a device.
 
constexpr SPISettings ()
 The default settings: 4 MHz requested (3 MHz on the wire), MSB first, SPI_MODE0, send and receive.
 

Detailed Description

A device's SPI settings: its maximum clock, bit order and mode, for SPIClass::beginTransaction().

SPI.beginTransaction(SPISettings(8000000, MSBFIRST, SPI_MODE0)); // runs at 6 MHz
virtual void beginTransaction(uint8_t pin, SPISettings settings)
Stores a device's settings for a CS pin and programs SPI1 with them.
constexpr SPISettings()
The default settings: 4 MHz requested (3 MHz on the wire), MSB first, SPI_MODE0, send and receive.
Definition SPI.h:187
SPIClass SPI
The SPI: SPI1 on PA5 (SCK), PA6 (MISO) and PA7 (MOSI), the bus the board's panel and SD card are on.
#define SPI_MODE0
clock idles low, data sampled on the rising edge (CPOL 0, CPHA 0)
Definition SPI.h:102

Constructor & Destructor Documentation

◆ SPISettings() [1/2]

constexpr SPISettings::SPISettings ( uint32_t  clock,
BitOrder  bitOrder,
uint8_t  dataMode,
bool  noRecv = SPI_TRANSMITRECEIVE 
)
inlineconstexpr

Settings for a device.

Parameters
clockthe device's maximum clock in Hz; the bus runs at the fastest 48 MHz / 2^n (n = 1..8) that does not exceed it, and at 187.5 kHz below that.
bitOrderMSBFIRST or LSBFIRST.
dataModeSPI_MODE0 ... SPI_MODE3; any other value means SPI_MODE0.
noRecvSPI_TRANSMITRECEIVE (the default) or SPI_TRANSMITONLY: send only, and do not read what comes back.

◆ SPISettings() [2/2]

constexpr SPISettings::SPISettings ( )
inlineconstexpr

The default settings: 4 MHz requested (3 MHz on the wire), MSB first, SPI_MODE0, send and receive.


The documentation for this class was generated from the following file: