STM32L4xx_HAL_Driver  1.14.0

Data transfers functions. More...

Functions

HAL_StatusTypeDef HAL_SPIEx_FlushRxFifo (SPI_HandleTypeDef *hspi)
 Flush the RX fifo. More...
 

Detailed Description

Data transfers functions.

  ==============================================================================
                      ##### IO operation functions #####
 ===============================================================================
 [..]
    This subsection provides a set of extended functions to manage the SPI
    data transfers.

    (#) Rx data flush function:
        (++) HAL_SPIEx_FlushRxFifo()

Function Documentation

◆ HAL_SPIEx_FlushRxFifo()

HAL_StatusTypeDef HAL_SPIEx_FlushRxFifo ( SPI_HandleTypeDef hspi)

Flush the RX fifo.

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

Definition at line 80 of file stm32l4xx_hal_spi_ex.c.

81 {
82  __IO uint32_t tmpreg;
83  uint8_t count = 0U;
84  while ((hspi->Instance->SR & SPI_FLAG_FRLVL) != SPI_FRLVL_EMPTY)
85  {
86  count++;
87  tmpreg = hspi->Instance->DR;
88  UNUSED(tmpreg); /* To avoid GCC warning */
89  if (count == SPI_FIFO_SIZE)
90  {
91  return HAL_TIMEOUT;
92  }
93  }
94  return HAL_OK;
95 }
return HAL_OK