Classes | Macros | Typedefs | Enumerations | Functions
stm32f7xx_hal_spi.h File Reference

Header file of SPI HAL module. More...

#include "stm32f7xx_hal_def.h"
#include "stm32f7xx_hal_spi_ex.h"
Include dependency graph for stm32f7xx_hal_spi.h:

Go to the source code of this file.

Classes

struct  __SPI_HandleTypeDef
 SPI handle Structure definition. More...
 
struct  SPI_InitTypeDef
 SPI Configuration Structure definition. More...
 

Macros

#define __HAL_SPI_CLEAR_CRCERRFLAG(__HANDLE__)   ((__HANDLE__)->Instance->SR = (uint16_t)(~SPI_FLAG_CRCERR))
 Clear the SPI CRCERR pending flag. More...
 
#define __HAL_SPI_CLEAR_FREFLAG(__HANDLE__)
 Clear the SPI FRE pending flag. More...
 
#define __HAL_SPI_CLEAR_MODFFLAG(__HANDLE__)
 Clear the SPI MODF pending flag. More...
 
#define __HAL_SPI_CLEAR_OVRFLAG(__HANDLE__)
 Clear the SPI OVR pending flag. More...
 
#define __HAL_SPI_DISABLE(__HANDLE__)   CLEAR_BIT((__HANDLE__)->Instance->CR1, SPI_CR1_SPE)
 Disable the SPI peripheral. More...
 
#define __HAL_SPI_DISABLE_IT(__HANDLE__, __INTERRUPT__)   CLEAR_BIT((__HANDLE__)->Instance->CR2, (__INTERRUPT__))
 Disable the specified SPI interrupts. More...
 
#define __HAL_SPI_ENABLE(__HANDLE__)   SET_BIT((__HANDLE__)->Instance->CR1, SPI_CR1_SPE)
 Enable the SPI peripheral. More...
 
#define __HAL_SPI_ENABLE_IT(__HANDLE__, __INTERRUPT__)   SET_BIT((__HANDLE__)->Instance->CR2, (__INTERRUPT__))
 Enable the specified SPI interrupts. More...
 
#define __HAL_SPI_GET_FLAG(__HANDLE__, __FLAG__)   ((((__HANDLE__)->Instance->SR) & (__FLAG__)) == (__FLAG__))
 Check whether the specified SPI flag is set or not. More...
 
#define __HAL_SPI_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__)   ((((__HANDLE__)->Instance->CR2 & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)
 Check whether the specified SPI interrupt source is enabled or not. More...
 
#define __HAL_SPI_RESET_HANDLE_STATE(__HANDLE__)   ((__HANDLE__)->State = HAL_SPI_STATE_RESET)
 Reset SPI handle state. More...
 
#define HAL_SPI_ERROR_ABORT   (0x00000040U)
 
#define HAL_SPI_ERROR_CRC   (0x00000002U)
 
#define HAL_SPI_ERROR_DMA   (0x00000010U)
 
#define HAL_SPI_ERROR_FLAG   (0x00000020U)
 
#define HAL_SPI_ERROR_FRE   (0x00000008U)
 
#define HAL_SPI_ERROR_MODF   (0x00000001U)
 
#define HAL_SPI_ERROR_NONE   (0x00000000U)
 
#define HAL_SPI_ERROR_OVR   (0x00000004U)
 
#define IS_SPI_BAUDRATE_PRESCALER(__PRESCALER__)
 Checks if SPI Baudrate prescaler parameter is in allowed range. More...
 
#define IS_SPI_CPHA(__CPHA__)
 Checks if SPI Clock Phase parameter is in allowed range. More...
 
#define IS_SPI_CPOL(__CPOL__)
 Checks if SPI Serial clock steady state parameter is in allowed range. More...
 
#define IS_SPI_CRC_CALCULATION(__CALCULATION__)
 Checks if SPI CRC calculation enabled state is in allowed range. More...
 
#define IS_SPI_CRC_LENGTH(__LENGTH__)
 Checks if SPI CRC length is in allowed range. More...
 
#define IS_SPI_CRC_POLYNOMIAL(__POLYNOMIAL__)   (((__POLYNOMIAL__) >= 0x1U) && ((__POLYNOMIAL__) <= 0xFFFFU) && (((__POLYNOMIAL__)&0x1U) != 0U))
 Checks if SPI polynomial value to be used for the CRC calculation, is in allowed range. More...
 
#define IS_SPI_DATASIZE(__DATASIZE__)
 Checks if SPI Data Size parameter is in allowed range. More...
 
#define IS_SPI_DIRECTION(__MODE__)
 Checks if SPI Direction Mode parameter is in allowed range. More...
 
#define IS_SPI_DIRECTION_2LINES(__MODE__)   ((__MODE__) == SPI_DIRECTION_2LINES)
 Checks if SPI Direction Mode parameter is 2 lines. More...
 
#define IS_SPI_DIRECTION_2LINES_OR_1LINE(__MODE__)
 Checks if SPI Direction Mode parameter is 1 or 2 lines. More...
 
#define IS_SPI_DMA_HANDLE(__HANDLE__)   ((__HANDLE__) != NULL)
 Checks if DMA handle is valid. More...
 
#define IS_SPI_FIRST_BIT(__BIT__)
 Checks if SPI MSB LSB transmission parameter is in allowed range. More...
 
#define IS_SPI_MODE(__MODE__)
 Checks if SPI Mode parameter is in allowed range. More...
 
#define IS_SPI_NSS(__NSS__)
 Checks if SPI Slave Select parameter is in allowed range. More...
 
#define IS_SPI_NSSP(__NSSP__)
 Checks if SPI NSS Pulse parameter is in allowed range. More...
 
#define IS_SPI_TIMODE(__MODE__)
 Checks if SPI TI mode parameter is in allowed range. More...
 
#define SPI_1LINE_RX(__HANDLE__)   CLEAR_BIT((__HANDLE__)->Instance->CR1, SPI_CR1_BIDIOE)
 Set the SPI receive-only mode. More...
 
#define SPI_1LINE_TX(__HANDLE__)   SET_BIT((__HANDLE__)->Instance->CR1, SPI_CR1_BIDIOE)
 Set the SPI transmit-only mode. More...
 
#define SPI_BAUDRATEPRESCALER_128   (SPI_CR1_BR_2 | SPI_CR1_BR_1)
 
#define SPI_BAUDRATEPRESCALER_16   (SPI_CR1_BR_1 | SPI_CR1_BR_0)
 
#define SPI_BAUDRATEPRESCALER_2   (0x00000000U)
 
#define SPI_BAUDRATEPRESCALER_256   (SPI_CR1_BR_2 | SPI_CR1_BR_1 | SPI_CR1_BR_0)
 
#define SPI_BAUDRATEPRESCALER_32   (SPI_CR1_BR_2)
 
#define SPI_BAUDRATEPRESCALER_4   (SPI_CR1_BR_0)
 
#define SPI_BAUDRATEPRESCALER_64   (SPI_CR1_BR_2 | SPI_CR1_BR_0)
 
#define SPI_BAUDRATEPRESCALER_8   (SPI_CR1_BR_1)
 
#define SPI_CHECK_FLAG(__SR__, __FLAG__)   ((((__SR__) & ((__FLAG__) & SPI_FLAG_MASK)) == ((__FLAG__) & SPI_FLAG_MASK)) ? SET : RESET)
 Check whether the specified SPI flag is set or not. More...
 
#define SPI_CHECK_IT_SOURCE(__CR2__, __INTERRUPT__)   ((((__CR2__) & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)
 Check whether the specified SPI Interrupt is set or not. More...
 
#define SPI_CRC_LENGTH_16BIT   (0x00000002U)
 
#define SPI_CRC_LENGTH_8BIT   (0x00000001U)
 
#define SPI_CRC_LENGTH_DATASIZE   (0x00000000U)
 
#define SPI_CRCCALCULATION_DISABLE   (0x00000000U)
 
#define SPI_CRCCALCULATION_ENABLE   SPI_CR1_CRCEN
 
#define SPI_DATASIZE_10BIT   (0x00000900U)
 
#define SPI_DATASIZE_11BIT   (0x00000A00U)
 
#define SPI_DATASIZE_12BIT   (0x00000B00U)
 
#define SPI_DATASIZE_13BIT   (0x00000C00U)
 
#define SPI_DATASIZE_14BIT   (0x00000D00U)
 
#define SPI_DATASIZE_15BIT   (0x00000E00U)
 
#define SPI_DATASIZE_16BIT   (0x00000F00U)
 
#define SPI_DATASIZE_4BIT   (0x00000300U)
 
#define SPI_DATASIZE_5BIT   (0x00000400U)
 
#define SPI_DATASIZE_6BIT   (0x00000500U)
 
#define SPI_DATASIZE_7BIT   (0x00000600U)
 
#define SPI_DATASIZE_8BIT   (0x00000700U)
 
#define SPI_DATASIZE_9BIT   (0x00000800U)
 
#define SPI_DIRECTION_1LINE   SPI_CR1_BIDIMODE
 
#define SPI_DIRECTION_2LINES   (0x00000000U)
 
#define SPI_DIRECTION_2LINES_RXONLY   SPI_CR1_RXONLY
 
#define SPI_FIRSTBIT_LSB   SPI_CR1_LSBFIRST
 
#define SPI_FIRSTBIT_MSB   (0x00000000U)
 
#define SPI_FLAG_BSY   SPI_SR_BSY /* SPI status flag: Busy flag */
 
#define SPI_FLAG_CRCERR   SPI_SR_CRCERR /* SPI Error flag: CRC error flag */
 
#define SPI_FLAG_FRE   SPI_SR_FRE /* SPI Error flag: TI mode frame format error flag */
 
#define SPI_FLAG_FRLVL   SPI_SR_FRLVL /* SPI fifo reception level */
 
#define SPI_FLAG_FTLVL   SPI_SR_FTLVL /* SPI fifo transmission level */
 
#define SPI_FLAG_MASK   (SPI_SR_RXNE | SPI_SR_TXE | SPI_SR_BSY | SPI_SR_CRCERR | SPI_SR_MODF | SPI_SR_OVR | SPI_SR_FRE | SPI_SR_FTLVL | SPI_SR_FRLVL)
 
#define SPI_FLAG_MODF   SPI_SR_MODF /* SPI Error flag: Mode fault flag */
 
#define SPI_FLAG_OVR   SPI_SR_OVR /* SPI Error flag: Overrun flag */
 
#define SPI_FLAG_RXNE   SPI_SR_RXNE /* SPI status flag: Rx buffer not empty flag */
 
#define SPI_FLAG_TXE   SPI_SR_TXE /* SPI status flag: Tx buffer empty flag */
 
#define SPI_FRLVL_EMPTY   (0x00000000U)
 
#define SPI_FRLVL_FULL   (0x00000600U)
 
#define SPI_FRLVL_HALF_FULL   (0x00000400U)
 
#define SPI_FRLVL_QUARTER_FULL   (0x00000200U)
 
#define SPI_FTLVL_EMPTY   (0x00000000U)
 
#define SPI_FTLVL_FULL   (0x00001800U)
 
#define SPI_FTLVL_HALF_FULL   (0x00001000U)
 
#define SPI_FTLVL_QUARTER_FULL   (0x00000800U)
 
#define SPI_IT_ERR   SPI_CR2_ERRIE
 
#define SPI_IT_RXNE   SPI_CR2_RXNEIE
 
#define SPI_IT_TXE   SPI_CR2_TXEIE
 
#define SPI_MODE_MASTER   (SPI_CR1_MSTR | SPI_CR1_SSI)
 
#define SPI_MODE_SLAVE   (0x00000000U)
 
#define SPI_NSS_HARD_INPUT   (0x00000000U)
 
#define SPI_NSS_HARD_OUTPUT   (SPI_CR2_SSOE << 16U)
 
#define SPI_NSS_PULSE_DISABLE   (0x00000000U)
 
#define SPI_NSS_PULSE_ENABLE   SPI_CR2_NSSP
 
#define SPI_NSS_SOFT   SPI_CR1_SSM
 
#define SPI_PHASE_1EDGE   (0x00000000U)
 
#define SPI_PHASE_2EDGE   SPI_CR1_CPHA
 
#define SPI_POLARITY_HIGH   SPI_CR1_CPOL
 
#define SPI_POLARITY_LOW   (0x00000000U)
 
#define SPI_RESET_CRC(__HANDLE__)
 Reset the CRC calculation of the SPI. More...
 
#define SPI_RXFIFO_THRESHOLD   SPI_CR2_FRXTH
 
#define SPI_RXFIFO_THRESHOLD_HF   (0x00000000U)
 
#define SPI_RXFIFO_THRESHOLD_QF   SPI_CR2_FRXTH
 
#define SPI_TIMODE_DISABLE   (0x00000000U)
 
#define SPI_TIMODE_ENABLE   SPI_CR2_FRF
 

Typedefs

typedef struct __SPI_HandleTypeDef SPI_HandleTypeDef
 SPI handle Structure definition. More...
 

Enumerations

enum  HAL_SPI_StateTypeDef {
  HAL_SPI_STATE_RESET = 0x00U, HAL_SPI_STATE_READY = 0x01U, HAL_SPI_STATE_BUSY = 0x02U, HAL_SPI_STATE_BUSY_TX = 0x03U,
  HAL_SPI_STATE_BUSY_RX = 0x04U, HAL_SPI_STATE_BUSY_TX_RX = 0x05U, HAL_SPI_STATE_ERROR = 0x06U, HAL_SPI_STATE_ABORT = 0x07U,
  HAL_SPI_STATE_RESET = 0x00U, HAL_SPI_STATE_READY = 0x01U, HAL_SPI_STATE_BUSY = 0x02U, HAL_SPI_STATE_BUSY_TX = 0x03U,
  HAL_SPI_STATE_BUSY_RX = 0x04U, HAL_SPI_STATE_BUSY_TX_RX = 0x05U, HAL_SPI_STATE_ERROR = 0x06U, HAL_SPI_STATE_ABORT = 0x07U,
  HAL_SPI_STATE_RESET = 0x00U, HAL_SPI_STATE_READY = 0x01U, HAL_SPI_STATE_BUSY = 0x02U, HAL_SPI_STATE_BUSY_TX = 0x03U,
  HAL_SPI_STATE_BUSY_RX = 0x04U, HAL_SPI_STATE_BUSY_TX_RX = 0x05U, HAL_SPI_STATE_ERROR = 0x06U, HAL_SPI_STATE_ABORT = 0x07U,
  HAL_SPI_STATE_RESET = 0x00UL, HAL_SPI_STATE_READY = 0x01UL, HAL_SPI_STATE_BUSY = 0x02UL, HAL_SPI_STATE_BUSY_TX = 0x03UL,
  HAL_SPI_STATE_BUSY_RX = 0x04UL, HAL_SPI_STATE_BUSY_TX_RX = 0x05UL, HAL_SPI_STATE_ERROR = 0x06UL, HAL_SPI_STATE_ABORT = 0x07UL
}
 HAL SPI State structure definition. More...
 

Functions

HAL_StatusTypeDef HAL_SPI_Abort (SPI_HandleTypeDef *hspi)
 
HAL_StatusTypeDef HAL_SPI_Abort_IT (SPI_HandleTypeDef *hspi)
 
void HAL_SPI_AbortCpltCallback (SPI_HandleTypeDef *hspi)
 
HAL_StatusTypeDef HAL_SPI_DeInit (SPI_HandleTypeDef *hspi)
 
HAL_StatusTypeDef HAL_SPI_DMAPause (SPI_HandleTypeDef *hspi)
 
HAL_StatusTypeDef HAL_SPI_DMAResume (SPI_HandleTypeDef *hspi)
 
HAL_StatusTypeDef HAL_SPI_DMAStop (SPI_HandleTypeDef *hspi)
 
void HAL_SPI_ErrorCallback (SPI_HandleTypeDef *hspi)
 
uint32_t HAL_SPI_GetError (SPI_HandleTypeDef *hspi)
 
HAL_SPI_StateTypeDef HAL_SPI_GetState (SPI_HandleTypeDef *hspi)
 
HAL_StatusTypeDef HAL_SPI_Init (SPI_HandleTypeDef *hspi)
 
void HAL_SPI_IRQHandler (SPI_HandleTypeDef *hspi)
 
void HAL_SPI_MspDeInit (SPI_HandleTypeDef *hspi)
 
void HAL_SPI_MspInit (SPI_HandleTypeDef *hspi)
 
HAL_StatusTypeDef HAL_SPI_Receive (SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size, uint32_t Timeout)
 
HAL_StatusTypeDef HAL_SPI_Receive_DMA (SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size)
 
HAL_StatusTypeDef HAL_SPI_Receive_IT (SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size)
 
void HAL_SPI_RxCpltCallback (SPI_HandleTypeDef *hspi)
 
void HAL_SPI_RxHalfCpltCallback (SPI_HandleTypeDef *hspi)
 
HAL_StatusTypeDef HAL_SPI_Transmit (SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size, uint32_t Timeout)
 
HAL_StatusTypeDef HAL_SPI_Transmit_DMA (SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size)
 
HAL_StatusTypeDef HAL_SPI_Transmit_IT (SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size)
 
HAL_StatusTypeDef HAL_SPI_TransmitReceive (SPI_HandleTypeDef *hspi, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size, uint32_t Timeout)
 
HAL_StatusTypeDef HAL_SPI_TransmitReceive_DMA (SPI_HandleTypeDef *hspi, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size)
 
HAL_StatusTypeDef HAL_SPI_TransmitReceive_IT (SPI_HandleTypeDef *hspi, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size)
 
void HAL_SPI_TxCpltCallback (SPI_HandleTypeDef *hspi)
 
void HAL_SPI_TxHalfCpltCallback (SPI_HandleTypeDef *hspi)
 
void HAL_SPI_TxRxCpltCallback (SPI_HandleTypeDef *hspi)
 
void HAL_SPI_TxRxHalfCpltCallback (SPI_HandleTypeDef *hspi)
 

Detailed Description

Header file of SPI HAL module.

Author
MCD Application Team
Attention

© Copyright (c) 2017 STMicroelectronics. All rights reserved.

This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this file except in compliance with the License. You may obtain a copy of the License at: opensource.org/licenses/BSD-3-Clause

Definition in file stm32f7xx_hal_spi.h.



picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:15:02