std1.0.0-beta-7 SafeC docs

Module hal::spi

#include <std/hal/spi.h> source

SPI HAL Polling-based SPI master driver. Freestanding-safe.

SpiDevice<C> is generic over the SPI block, a compile-time chip type:

SpiGeneric    reference layout: DATA +0x00, STATUS +0x04 (bit 0 busy,
              bit 1 TX ready), CTRL +0x08 (mode | 0x80 enable),
              CS +0x0C (0 = asserted)
Stm32F4Spi    STM32F1/F2/F4 SPI as master with software NSS; chip select
              is an ordinary GPIO there (cs_assert/cs_deassert do
              nothing — drive a GpioPin)

Structs

SpiGeneric
Stm32F4Spi
SpiDevice

Traits

SpiChipWhat an SPI controller type provides; SpiDevice<C> requires it.

Macros

SPI_MODE_0SPI modes (CPOL/CPHA)
SPI_MODE_1CPOL=0, CPHA=1
SPI_MODE_2CPOL=1, CPHA=0
SPI_MODE_3CPOL=1, CPHA=1