Arduino Core for STM32  1.0
SPI initializers

Methods for initializing or de-initializing SPI periphery. Those methods can be also used to sleep the periphery. More...

Functions

bool HardwareSPI::begin (SPI_InitTypeDef &initStruct)
 Initialize SPI periphery and it's pins. More...
 
bool HardwareSPI::begin ()
 Initialize SPI periphery and it's pins. More...
 
bool HardwareSPI::end ()
 Deinitialization and disabling SPI periphery, it can be used for "sleep mode". More...
 

Detailed Description

Methods for initializing or de-initializing SPI periphery. Those methods can be also used to sleep the periphery.

Function Documentation

◆ begin() [1/2]

bool HardwareSPI::begin ( SPI_InitTypeDef &  initStruct)

Initialize SPI periphery and it's pins.

Parameters
initStructHAL init structure, that store SPI settings.
Note
Be careful when setting initStruct, it works different than HardwareSPI methods. For example, if you set it's BaudRatePrescaler member to 2, it will resolve to error, you have to use SPI_BAUDRATEPRESCALER_2 macro.
Returns
Returns true if initialization was successful.
Here is the call graph for this function:

◆ begin() [2/2]

bool HardwareSPI::begin ( )

Initialize SPI periphery and it's pins.

Returns
Returns true if initialization was successful.
Note
Call this method without parameters first time, to apply changes from .ioc file or call it when you want to re-initialize this periphery again (after calling end() method).
Here is the call graph for this function:

◆ end()

bool HardwareSPI::end ( )

Deinitialization and disabling SPI periphery, it can be used for "sleep mode".

Note
To wake up from "sleep mode", call begin() without any parameter, to re-initialize old settings and to re-enable SPI periphery.
Here is the call graph for this function: