HAL_SPI_ErrorCallback. STMicroelectronics STM32F4
Reklama
Reklama
UM1725
Function Name
void HAL_SPI_TxRxHalfCpltCallback (SPI_HandleTypeDef *
hspi)
Function Description Tx and Rx Transfer completed callbacks.
Parameters
hspi: pointer to a SPI_HandleTypeDef structure that contains the configuration information for SPI module.
Return values
None
59.3.28 HAL_SPI_ErrorCallback
Function Name
void HAL_SPI_ErrorCallback (SPI_HandleTypeDef * hspi)
Function Description SPI error callbacks.
Parameters
Return values
hspi: pointer to a SPI_HandleTypeDef structure that contains the configuration information for SPI module.
None
59.3.29 HAL_SPI_GetState
Function Name
HAL_SPI_StateTypeDef HAL_SPI_GetState
(SPI_HandleTypeDef * hspi)
Function Description Return the SPI state.
Parameters
Return values
hspi: pointer to a SPI_HandleTypeDef structure that contains the configuration information for SPI module.
HAL state
59.3.30 HAL_SPI_GetError
Function Name uint32_t HAL_SPI_GetError (SPI_HandleTypeDef * hspi)
Function Description Return the SPI error code.
Parameters
Return values
hspi: pointer to a SPI_HandleTypeDef structure that contains the configuration information for SPI module.
SPI Error Code
59.4 SPI Firmware driver defines
59.4.1 SPI
SPI BaudRate Prescaler
SPI_BAUDRATEPRESCALER_2
SPI_BAUDRATEPRESCALER_4
SPI_BAUDRATEPRESCALER_8
SPI_BAUDRATEPRESCALER_16
SPI_BAUDRATEPRESCALER_32
SPI_BAUDRATEPRESCALER_64
SPI_BAUDRATEPRESCALER_128
DOCID025834 Rev 3 819/963
820/963
UM1725
SPI_BAUDRATEPRESCALER_256
SPI Clock Phase
SPI_PHASE_1EDGE
SPI_PHASE_2EDGE
SPI Clock Polarity
SPI_POLARITY_LOW
SPI_POLARITY_HIGH
SPI CRC Calculation
SPI_CRCCALCULATION_DISABLE
SPI_CRCCALCULATION_ENABLE
SPI Data Size
SPI_DATASIZE_8BIT
SPI_DATASIZE_16BIT
SPI Direction Mode
SPI_DIRECTION_2LINES
SPI_DIRECTION_2LINES_RXONLY
SPI_DIRECTION_1LINE
SPI Error Code
HAL_SPI_ERROR_NONE No error
HAL_SPI_ERROR_MODF MODF error
HAL_SPI_ERROR_CRC CRC error
HAL_SPI_ERROR_OVR OVR error
HAL_SPI_ERROR_FRE FRE error
HAL_SPI_ERROR_DMA DMA transfer error
HAL_SPI_ERROR_FLAG Flag: RXNE,TXE, BSY
SPI Exported Macros
__HAL_SPI_RESET_HANDLE_STATE Description:
Reset SPI handle state.
Parameters:
__HANDLE__: specifies the SPI handle.
This parameter can be SPI where x: 1, 2, or
3 to select the SPI peripheral.
Return value:
None
__HAL_SPI_ENABLE_IT Description:
Enable or disable the specified SPI interrupts.
DOCID025834 Rev 3
UM1725
__HAL_SPI_DISABLE_IT
__HAL_SPI_GET_IT_SOURCE
__HAL_SPI_GET_FLAG
Parameters:
__HANDLE__: specifies the SPI handle.
This parameter can be SPI where x: 1, 2, or
3 to select the SPI peripheral.
__INTERRUPT__: specifies the interrupt source to enable or disable. This parameter can be one of the following values:
SPI_IT_TXE: Tx buffer empty interrupt enable
SPI_IT_RXNE: RX buffer not empty interrupt enable
SPI_IT_ERR: Error interrupt enable
Return value:
None
Description:
Check if the specified SPI interrupt source is enabled or disabled.
Parameters:
__HANDLE__: specifies the SPI handle.
This parameter can be SPI where x: 1, 2, or
3 to select the SPI peripheral.
__INTERRUPT__: specifies the SPI interrupt source to check. This parameter can be one of the following values:
SPI_IT_TXE: Tx buffer empty interrupt enable
SPI_IT_RXNE: RX buffer not empty interrupt enable
SPI_IT_ERR: Error interrupt enable
Return value:
The: new state of __IT__ (TRUE or FALSE).
Description:
Check whether the specified SPI flag is set or not.
Parameters:
__HANDLE__: specifies the SPI handle.
This parameter can be SPI where x: 1, 2, or
3 to select the SPI peripheral.
__FLAG__: specifies the flag to check. This parameter can be one of the following values:
SPI_FLAG_RXNE: Receive buffer not empty flag
SPI_FLAG_TXE: Transmit buffer empty flag
SPI_FLAG_CRCERR: CRC error flag
DOCID025834 Rev 3 821/963
822/963
__HAL_SPI_CLEAR_CRCERRFLAG
__HAL_SPI_CLEAR_MODFFLAG
__HAL_SPI_CLEAR_OVRFLAG
__HAL_SPI_CLEAR_FREFLAG
UM1725
SPI_FLAG_MODF: Mode fault flag
SPI_FLAG_OVR: Overrun flag
SPI_FLAG_BSY: Busy flag
SPI_FLAG_FRE: Frame format error flag
Return value:
The: new state of __FLAG__ (TRUE or
FALSE).
Description:
Clear the SPI CRCERR pending flag.
Parameters:
__HANDLE__: specifies the SPI handle.
This parameter can be SPI where x: 1, 2, or
3 to select the SPI peripheral.
Return value:
None
Description:
Clear the SPI MODF pending flag.
Parameters:
__HANDLE__: specifies the SPI handle.
This parameter can be SPI where x: 1, 2, or
3 to select the SPI peripheral.
Return value:
None
Description:
Clear the SPI OVR pending flag.
Parameters:
__HANDLE__: specifies the SPI handle.
This parameter can be SPI where x: 1, 2, or
3 to select the SPI peripheral.
Return value:
None
Description:
Clear the SPI FRE pending flag.
Parameters:
__HANDLE__: specifies the SPI handle.
This parameter can be SPI where x: 1, 2, or
3 to select the SPI peripheral.
Return value:
None
DOCID025834 Rev 3
UM1725
__HAL_SPI_ENABLE
__HAL_SPI_DISABLE
SPI Flags Definition
SPI_FLAG_RXNE
SPI_FLAG_TXE
SPI_FLAG_CRCERR
SPI_FLAG_MODF
SPI_FLAG_OVR
SPI_FLAG_BSY
SPI_FLAG_FRE
SPI Interrupt Definition
SPI_IT_TXE
SPI_IT_RXNE
SPI_IT_ERR
SPI Mode
SPI_MODE_SLAVE
SPI_MODE_MASTER
SPI MSB LSB Transsmission
SPI_FIRSTBIT_MSB
SPI_FIRSTBIT_LSB
SPI Private Macros
IS_SPI_MODE
IS_SPI_DIRECTION_MODE
IS_SPI_DIRECTION_2LINES_OR_1LINE
IS_SPI_DIRECTION_2LINES
IS_SPI_DATASIZE
Description:
Enable SPI.
Parameters:
__HANDLE__: specifies the SPI Handle.
Return value:
None
Description:
Disable SPI.
Parameters:
__HANDLE__: specifies the SPI Handle.
Return value:
None
DOCID025834 Rev 3 823/963
IS_SPI_CPOL
IS_SPI_CPHA
IS_SPI_NSS
IS_SPI_BAUDRATE_PRESCALER
IS_SPI_FIRST_BIT
IS_SPI_TIMODE
IS_SPI_CRC_CALCULATION
IS_SPI_CRC_POLYNOMIAL
SPI_1LINE_TX
SPI_1LINE_RX
SPI_RESET_CRC
SPI Slave Select Management
SPI_NSS_SOFT
SPI_NSS_HARD_INPUT
SPI_NSS_HARD_OUTPUT
SPI TI Mode
SPI_TIMODE_DISABLE
SPI_TIMODE_ENABLE
UM1725
824/963 DOCID025834 Rev 3
Preuzimanje
Reklama