STM32F4xx_HAL_Driver  1.8.3
Initialization and de-initialization functions

Initialization and Configuration functions. More...

+ Collaboration diagram for Initialization and de-initialization functions:

Functions

HAL_StatusTypeDef HAL_SPI_Init (SPI_HandleTypeDef *hspi)
 Initialize the SPI according to the specified parameters in the SPI_InitTypeDef and initialize the associated handle. More...
 
HAL_StatusTypeDef HAL_SPI_DeInit (SPI_HandleTypeDef *hspi)
 De-Initialize the SPI peripheral. More...
 
void HAL_SPI_MspInit (SPI_HandleTypeDef *hspi)
 Initialize the SPI MSP. More...
 
void HAL_SPI_MspDeInit (SPI_HandleTypeDef *hspi)
 De-Initialize the SPI MSP. More...
 
HAL_StatusTypeDef HAL_SPI_RegisterCallback (SPI_HandleTypeDef *hspi, HAL_SPI_CallbackIDTypeDef CallbackID, pSPI_CallbackTypeDef pCallback)
 Register a User SPI Callback To be used instead of the weak predefined callback. More...
 
HAL_StatusTypeDef HAL_SPI_UnRegisterCallback (SPI_HandleTypeDef *hspi, HAL_SPI_CallbackIDTypeDef CallbackID)
 Unregister an SPI Callback SPI callback is redirected to the weak predefined callback. More...
 

Detailed Description

Initialization and Configuration functions.

 ===============================================================================
              ##### Initialization and de-initialization functions #####
 ===============================================================================
    [..]  This subsection provides a set of functions allowing to initialize and
          de-initialize the SPIx peripheral:

      (+) User must implement HAL_SPI_MspInit() function in which he configures
          all related peripherals resources (CLOCK, GPIO, DMA, IT and NVIC ).

      (+) Call the function HAL_SPI_Init() to configure the selected device with
          the selected configuration:
        (++) Mode
        (++) Direction
        (++) Data Size
        (++) Clock Polarity and Phase
        (++) NSS Management
        (++) BaudRate Prescaler
        (++) FirstBit
        (++) TIMode
        (++) CRC Calculation
        (++) CRC Polynomial if CRC enabled

      (+) Call the function HAL_SPI_DeInit() to restore the default configuration
          of the selected SPIx peripheral.

Function Documentation

◆ HAL_SPI_DeInit()

HAL_StatusTypeDef HAL_SPI_DeInit ( SPI_HandleTypeDef hspi)

De-Initialize the SPI peripheral.

Parameters
hspipointer to a SPI_HandleTypeDef structure that contains the configuration information for SPI module.
Return values
HALstatus

Definition at line 437 of file stm32f4xx_hal_spi.c.

◆ HAL_SPI_Init()

HAL_StatusTypeDef HAL_SPI_Init ( SPI_HandleTypeDef hspi)

Initialize the SPI according to the specified parameters in the SPI_InitTypeDef and initialize the associated handle.

Parameters
hspipointer to a SPI_HandleTypeDef structure that contains the configuration information for SPI module.
Return values
HALstatus

Definition at line 311 of file stm32f4xx_hal_spi.c.

◆ HAL_SPI_MspDeInit()

__weak void HAL_SPI_MspDeInit ( SPI_HandleTypeDef hspi)

De-Initialize the SPI MSP.

Parameters
hspipointer to a SPI_HandleTypeDef structure that contains the configuration information for SPI module.
Return values
None

Definition at line 497 of file stm32f4xx_hal_spi.c.

◆ HAL_SPI_MspInit()

__weak void HAL_SPI_MspInit ( SPI_HandleTypeDef hspi)

Initialize the SPI MSP.

Parameters
hspipointer to a SPI_HandleTypeDef structure that contains the configuration information for SPI module.
Return values
None

Definition at line 481 of file stm32f4xx_hal_spi.c.

◆ HAL_SPI_RegisterCallback()

HAL_StatusTypeDef HAL_SPI_RegisterCallback ( SPI_HandleTypeDef hspi,
HAL_SPI_CallbackIDTypeDef  CallbackID,
pSPI_CallbackTypeDef  pCallback 
)

Register a User SPI Callback To be used instead of the weak predefined callback.

Parameters
hspiPointer to a SPI_HandleTypeDef structure that contains the configuration information for the specified SPI.
CallbackIDID of the callback to be registered
pCallbackpointer to the Callback function
Return values
HALstatus

Definition at line 517 of file stm32f4xx_hal_spi.c.

◆ HAL_SPI_UnRegisterCallback()

HAL_StatusTypeDef HAL_SPI_UnRegisterCallback ( SPI_HandleTypeDef hspi,
HAL_SPI_CallbackIDTypeDef  CallbackID 
)

Unregister an SPI Callback SPI callback is redirected to the weak predefined callback.

Parameters
hspiPointer to a SPI_HandleTypeDef structure that contains the configuration information for the specified SPI.
CallbackIDID of the callback to be unregistered
Return values
HALstatus

Definition at line 628 of file stm32f4xx_hal_spi.c.