modm API documentation
modm::platform::SpiBase Class Reference

#include <modm/platform/spi/spi_base.hpp>

Inheritance diagram for modm::platform::SpiBase:
modm::platform::SpiHal1 modm::platform::SpiHal2

Public Types

enum  Interrupt : uint32_t {
  RxBufferNotEmpty = SPI_CR2_RXNEIE, TxBufferEmpty = SPI_CR2_TXEIE, Error = SPI_CR2_ERRIE, RxDmaEnable = SPI_CR2_RXDMAEN,
  TxDmaEnable = SPI_CR2_TXDMAEN
}
 
enum  InterruptFlag : uint32_t {
  TxBufferEmpty = SPI_SR_TXE, RxBufferNotEmpty = SPI_SR_RXNE, CrcError = SPI_SR_CRCERR, ModeFaultError = SPI_SR_MODF,
  OverrunError = SPI_SR_OVR, Busy = SPI_SR_BSY, FrameFormatError = SPI_SR_FRE, FifoRxLevel = SPI_SR_FRLVL,
  FifoTxLevel = SPI_SR_FTLVL
}
 
enum  MasterSelection : uint32_t { Slave = 0, Master = SPI_CR1_MSTR, All = Master }
 
enum  DataMode : uint32_t {
  DataMode::Mode0 = 0b00, DataMode::Mode1 = SPI_CR1_CPHA, DataMode::Mode2 = SPI_CR1_CPOL, Mode3 = SPI_CR1_CPOL | SPI_CR1_CPHA,
  All = Mode3
}
 
enum  DataOrder : uint32_t { MsbFirst = 0b0, LsbFirst = SPI_CR1_LSBFIRST, All = LsbFirst }
 
enum  DataSize : uint32_t {
  Bit4 = SPI_CR2_DS_1 | SPI_CR2_DS_0, Bit5 = SPI_CR2_DS_2, Bit6 = SPI_CR2_DS_2 | SPI_CR2_DS_0, Bit7 = SPI_CR2_DS_2 | SPI_CR2_DS_1,
  Bit8 = SPI_CR2_DS_2 | SPI_CR2_DS_1 | SPI_CR2_DS_0, Bit9 = SPI_CR2_DS_3, Bit10 = SPI_CR2_DS_3 | SPI_CR2_DS_0, Bit11 = SPI_CR2_DS_3 | SPI_CR2_DS_1,
  Bit12 = SPI_CR2_DS_3 | SPI_CR2_DS_1 | SPI_CR2_DS_0, Bit13 = SPI_CR2_DS_3 | SPI_CR2_DS_2, Bit14 = SPI_CR2_DS_3 | SPI_CR2_DS_2 | SPI_CR2_DS_0, Bit15 = SPI_CR2_DS_3 | SPI_CR2_DS_2 | SPI_CR2_DS_1,
  Bit16 = SPI_CR2_DS_3 | SPI_CR2_DS_2 | SPI_CR2_DS_1 | SPI_CR2_DS_0, All = Bit16
}
 
enum  Prescaler : uint32_t {
  Div2 = 0, Div4 = SPI_CR1_BR_0, Div8 = SPI_CR1_BR_1, Div16 = SPI_CR1_BR_1 | SPI_CR1_BR_0,
  Div32 = SPI_CR1_BR_2, Div64 = SPI_CR1_BR_2 | SPI_CR1_BR_0, Div128 = SPI_CR1_BR_2 | SPI_CR1_BR_1, Div256 = SPI_CR1_BR_2 | SPI_CR1_BR_1 | SPI_CR1_BR_0
}
 
enum  RxFifoThreshold : uint32_t { HalfFull = 0, QuarterFull = SPI_CR2_FRXTH }
 

Public Member Functions

 MODM_FLAGS32 (Interrupt)
 
 MODM_FLAGS32 (InterruptFlag)
 

Detailed Description

Base class for the SPI classes

Provides some common enum that do not depend on the specific SPI.

Author
Kevin Laeufer

Member Enumeration Documentation

enum modm::platform::SpiBase::DataMode : uint32_t
strong
Enum ValuesDocumentation
Mode0 

clock normal, sample on rising edge

Mode1 

clock normal, sample on falling edge

Mode2 

clock inverted, sample on falling edge clock inverted, sample on rising edge


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