STM32F479xx HAL User Manual
|
Initialization and Configuration functions. More...
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. | |
HAL_StatusTypeDef | HAL_SPI_DeInit (SPI_HandleTypeDef *hspi) |
De-Initialize the SPI peripheral. | |
__weak void | HAL_SPI_MspInit (SPI_HandleTypeDef *hspi) |
Initialize the SPI MSP. | |
__weak void | HAL_SPI_MspDeInit (SPI_HandleTypeDef *hspi) |
De-Initialize the SPI MSP. | |
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. | |
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. |
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.
HAL_StatusTypeDef HAL_SPI_DeInit | ( | SPI_HandleTypeDef * | hspi | ) |
De-Initialize the SPI peripheral.
hspi | pointer to a SPI_HandleTypeDef structure that contains the configuration information for SPI module. |
HAL | status |
Definition at line 439 of file stm32f4xx_hal_spi.c.
References __HAL_SPI_DISABLE, assert_param, __SPI_HandleTypeDef::ErrorCode, HAL_SPI_ERROR_NONE, HAL_SPI_MspDeInit(), HAL_SPI_STATE_BUSY, HAL_SPI_STATE_RESET, __SPI_HandleTypeDef::Instance, __SPI_HandleTypeDef::MspDeInitCallback, and __SPI_HandleTypeDef::State.
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.
hspi | pointer to a SPI_HandleTypeDef structure that contains the configuration information for SPI module. |
HAL | status |
Definition at line 313 of file stm32f4xx_hal_spi.c.
References __HAL_SPI_DISABLE, __SPI_HandleTypeDef::AbortCpltCallback, assert_param, SPI_InitTypeDef::BaudRatePrescaler, SPI_InitTypeDef::CLKPhase, SPI_InitTypeDef::CLKPolarity, SPI_InitTypeDef::CRCCalculation, SPI_InitTypeDef::CRCPolynomial, SPI_InitTypeDef::DataSize, SPI_InitTypeDef::Direction, __SPI_HandleTypeDef::ErrorCallback, __SPI_HandleTypeDef::ErrorCode, SPI_InitTypeDef::FirstBit, HAL_SPI_AbortCpltCallback(), HAL_SPI_ERROR_NONE, HAL_SPI_ErrorCallback(), HAL_SPI_MspInit(), HAL_SPI_RxCpltCallback(), HAL_SPI_RxHalfCpltCallback(), HAL_SPI_STATE_BUSY, HAL_SPI_STATE_READY, HAL_SPI_STATE_RESET, HAL_SPI_TxCpltCallback(), HAL_SPI_TxHalfCpltCallback(), HAL_SPI_TxRxCpltCallback(), HAL_SPI_TxRxHalfCpltCallback(), __SPI_HandleTypeDef::Init, __SPI_HandleTypeDef::Instance, IS_SPI_BAUDRATE_PRESCALER, IS_SPI_CPHA, IS_SPI_CPOL, IS_SPI_CRC_CALCULATION, IS_SPI_CRC_POLYNOMIAL, IS_SPI_DATASIZE, IS_SPI_DIRECTION, IS_SPI_FIRST_BIT, IS_SPI_MODE, IS_SPI_NSS, IS_SPI_TIMODE, __SPI_HandleTypeDef::Lock, SPI_InitTypeDef::Mode, __SPI_HandleTypeDef::MspInitCallback, SPI_InitTypeDef::NSS, __SPI_HandleTypeDef::RxCpltCallback, __SPI_HandleTypeDef::RxHalfCpltCallback, SPI_BAUDRATEPRESCALER_2, SPI_CRCCALCULATION_DISABLE, SPI_CRCCALCULATION_ENABLE, SPI_MODE_MASTER, SPI_PHASE_1EDGE, SPI_POLARITY_LOW, SPI_TIMODE_DISABLE, __SPI_HandleTypeDef::State, SPI_InitTypeDef::TIMode, __SPI_HandleTypeDef::TxCpltCallback, __SPI_HandleTypeDef::TxHalfCpltCallback, __SPI_HandleTypeDef::TxRxCpltCallback, and __SPI_HandleTypeDef::TxRxHalfCpltCallback.
void HAL_SPI_MspDeInit | ( | SPI_HandleTypeDef * | hspi | ) |
De-Initialize the SPI MSP.
hspi | pointer to a SPI_HandleTypeDef structure that contains the configuration information for SPI module. |
None |
Definition at line 499 of file stm32f4xx_hal_spi.c.
Referenced by HAL_SPI_DeInit(), and HAL_SPI_UnRegisterCallback().
void HAL_SPI_MspInit | ( | SPI_HandleTypeDef * | hspi | ) |
Initialize the SPI MSP.
hspi | pointer to a SPI_HandleTypeDef structure that contains the configuration information for SPI module. |
None |
Definition at line 483 of file stm32f4xx_hal_spi.c.
Referenced by HAL_SPI_Init(), and HAL_SPI_UnRegisterCallback().
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.
hspi | Pointer to a SPI_HandleTypeDef structure that contains the configuration information for the specified SPI. |
CallbackID | ID of the callback to be registered |
pCallback | pointer to the Callback function |
HAL | status |
Definition at line 519 of file stm32f4xx_hal_spi.c.
References __SPI_HandleTypeDef::AbortCpltCallback, __SPI_HandleTypeDef::ErrorCallback, __SPI_HandleTypeDef::ErrorCode, HAL_SPI_ABORT_CB_ID, HAL_SPI_ERROR_CB_ID, HAL_SPI_ERROR_INVALID_CALLBACK, HAL_SPI_MSPDEINIT_CB_ID, HAL_SPI_MSPINIT_CB_ID, HAL_SPI_RX_COMPLETE_CB_ID, HAL_SPI_RX_HALF_COMPLETE_CB_ID, HAL_SPI_STATE_READY, HAL_SPI_STATE_RESET, HAL_SPI_TX_COMPLETE_CB_ID, HAL_SPI_TX_HALF_COMPLETE_CB_ID, HAL_SPI_TX_RX_COMPLETE_CB_ID, HAL_SPI_TX_RX_HALF_COMPLETE_CB_ID, __SPI_HandleTypeDef::MspDeInitCallback, __SPI_HandleTypeDef::MspInitCallback, __SPI_HandleTypeDef::RxCpltCallback, __SPI_HandleTypeDef::RxHalfCpltCallback, __SPI_HandleTypeDef::State, __SPI_HandleTypeDef::TxCpltCallback, __SPI_HandleTypeDef::TxHalfCpltCallback, __SPI_HandleTypeDef::TxRxCpltCallback, and __SPI_HandleTypeDef::TxRxHalfCpltCallback.
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.
hspi | Pointer to a SPI_HandleTypeDef structure that contains the configuration information for the specified SPI. |
CallbackID | ID of the callback to be unregistered |
HAL | status |
Definition at line 630 of file stm32f4xx_hal_spi.c.
References __SPI_HandleTypeDef::AbortCpltCallback, __SPI_HandleTypeDef::ErrorCallback, __SPI_HandleTypeDef::ErrorCode, HAL_SPI_ABORT_CB_ID, HAL_SPI_AbortCpltCallback(), HAL_SPI_ERROR_CB_ID, HAL_SPI_ERROR_INVALID_CALLBACK, HAL_SPI_ErrorCallback(), HAL_SPI_MspDeInit(), HAL_SPI_MSPDEINIT_CB_ID, HAL_SPI_MspInit(), HAL_SPI_MSPINIT_CB_ID, HAL_SPI_RX_COMPLETE_CB_ID, HAL_SPI_RX_HALF_COMPLETE_CB_ID, HAL_SPI_RxCpltCallback(), HAL_SPI_RxHalfCpltCallback(), HAL_SPI_STATE_READY, HAL_SPI_STATE_RESET, HAL_SPI_TX_COMPLETE_CB_ID, HAL_SPI_TX_HALF_COMPLETE_CB_ID, HAL_SPI_TX_RX_COMPLETE_CB_ID, HAL_SPI_TX_RX_HALF_COMPLETE_CB_ID, HAL_SPI_TxCpltCallback(), HAL_SPI_TxHalfCpltCallback(), HAL_SPI_TxRxCpltCallback(), HAL_SPI_TxRxHalfCpltCallback(), __SPI_HandleTypeDef::MspDeInitCallback, __SPI_HandleTypeDef::MspInitCallback, __SPI_HandleTypeDef::RxCpltCallback, __SPI_HandleTypeDef::RxHalfCpltCallback, __SPI_HandleTypeDef::State, __SPI_HandleTypeDef::TxCpltCallback, __SPI_HandleTypeDef::TxHalfCpltCallback, __SPI_HandleTypeDef::TxRxCpltCallback, and __SPI_HandleTypeDef::TxRxHalfCpltCallback.