FastArduino v1.10
C++ library to build fast but small Arduino/AVR projects
|
Define API to define and manage SPI devices. More...
Classes | |
class | AbstractSPIDevice |
Contain general payload transfer API for an SPI device. More... | |
class | SPIDevice |
Base class for any SPI slave device. More... | |
Enumerations | |
enum class | ClockRate : uint8_t { CLOCK_DIV_4 = 0x00 , CLOCK_DIV_16 = 0x01 , CLOCK_DIV_64 = 0x02 , CLOCK_DIV_128 = 0x03 , CLOCK_DIV_2 = 0x10 , CLOCK_DIV_8 = 0x11 , CLOCK_DIV_32 = 0x12 } |
Define SPI clock rate as a divider of MCU clock frequency. More... | |
enum class | DataOrder : uint8_t { MSB_FIRST = 0 , LSB_FIRST = bits::BV8(DORD) } |
Bit ordering per byte. More... | |
enum class | Mode : uint8_t { MODE_0 = 0 , MODE_1 = bits::BV8(CPHA) , MODE_2 = bits::BV8(CPOL) , MODE_3 = bits::BV8(CPHA, CPOL) } |
SPI transmission mode. More... | |
enum class | ChipSelect : uint8_t { ACTIVE_LOW = 0 , ACTIVE_HIGH = 1 } |
Active polarity of slave selection pin. More... | |
Functions | |
void | init () |
This function must be called once in your program, before any use of an SPI device. More... | |
constexpr ClockRate | compute_clockrate (uint32_t frequency) |
Calculate ClockRate for the given frequency . More... | |
Define API to define and manage SPI devices.
SPI is available to all MCU supported by FastArduino, even in ATtiny MCU, for which SPI is implemented with Universal Serial Interface (USI).
|
strong |
Define SPI clock rate as a divider of MCU clock frequency.
|
strong |
|
strong |
|
strong |
void spi::init | ( | ) |
|
constexpr |