QSPI control and State functions.
More...
QSPI control and State functions.
===============================================================================
##### Peripheral Control and State functions #####
===============================================================================
[..]
This subsection provides a set of functions allowing to :
(+) Check in run-time the state of the driver.
(+) Check the error code set during last operation.
(+) Abort any operation.
◆ HAL_QSPI_Abort()
Abort the current transmission.
- Parameters
-
- Return values
-
Definition at line 2285 of file stm32l4xx_hal_qspi.c.
2287 HAL_StatusTypeDef status =
HAL_OK;
2291 if (((uint32_t)hqspi->State & 0x2U) != 0U)
2296 if ((hqspi->Instance->CR & QUADSPI_CR_DMAEN) != 0U)
2299 CLEAR_BIT(hqspi->Instance->CR, QUADSPI_CR_DMAEN);
2305 hqspi->ErrorCode |= HAL_QSPI_ERROR_DMA;
2310 SET_BIT(hqspi->Instance->CR, QUADSPI_CR_ABORT);
2317 __HAL_QSPI_CLEAR_FLAG(hqspi, QSPI_FLAG_TC);
2326 CLEAR_BIT(hqspi->Instance->CCR, QUADSPI_CCR_FMODE);
uint32_t HAL_GetTick(void)
Provide a tick value in millisecond.
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)
HAL_StatusTypeDef HAL_DMA_Abort(DMA_HandleTypeDef *hdma)
Abort the DMA Transfer.
static HAL_StatusTypeDef QSPI_WaitFlagStateUntilTimeout(QSPI_HandleTypeDef *hqspi, uint32_t Flag, FlagStatus State, uint32_t Tickstart, uint32_t Timeout)
Wait for a flag state until timeout.
◆ HAL_QSPI_Abort_IT()
Abort the current transmission (non-blocking function)
- Parameters
-
- Return values
-
Definition at line 2341 of file stm32l4xx_hal_qspi.c.
2343 HAL_StatusTypeDef status =
HAL_OK;
2346 if (((uint32_t)hqspi->State & 0x2U) != 0U)
2355 __HAL_QSPI_DISABLE_IT(hqspi, (QSPI_IT_TO | QSPI_IT_SM | QSPI_IT_FT | QSPI_IT_TC | QSPI_IT_TE));
2357 if ((hqspi->Instance->CR & QUADSPI_CR_DMAEN) != 0U)
2360 CLEAR_BIT(hqspi->Instance->CR, QUADSPI_CR_DMAEN);
2370 #if (USE_HAL_QSPI_REGISTER_CALLBACKS == 1) 2371 hqspi->AbortCpltCallback(hqspi);
2380 __HAL_QSPI_CLEAR_FLAG(hqspi, QSPI_FLAG_TC);
2383 __HAL_QSPI_ENABLE_IT(hqspi, QSPI_IT_TC);
2386 SET_BIT(hqspi->Instance->CR, QUADSPI_CR_ABORT);
HAL_StatusTypeDef HAL_DMA_Abort_IT(DMA_HandleTypeDef *hdma)
Aborts the DMA Transfer in Interrupt mode.
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)
static void QSPI_DMAAbortCplt(DMA_HandleTypeDef *hdma)
DMA QSPI abort complete callback.
void HAL_QSPI_AbortCpltCallback(QSPI_HandleTypeDef *hqspi)
Abort completed callback.
◆ HAL_QSPI_GetError()
Return the QSPI error code.
- Parameters
-
- Return values
-
Definition at line 2275 of file stm32l4xx_hal_qspi.c.
2277 return hqspi->ErrorCode;
◆ HAL_QSPI_GetFifoThreshold()
Get QSPI Fifo threshold.
- Parameters
-
- Return values
-
| Fifo | threshold (value between 1 and 16) |
Definition at line 2439 of file stm32l4xx_hal_qspi.c.
2441 return ((READ_BIT(hqspi->Instance->CR, QUADSPI_CR_FTHRES) >> QUADSPI_CR_FTHRES_Pos) + 1U);
◆ HAL_QSPI_GetState()
Return the QSPI handle state.
- Parameters
-
- Return values
-
Definition at line 2264 of file stm32l4xx_hal_qspi.c.
2267 return hqspi->State;
◆ HAL_QSPI_SetFifoThreshold()
| HAL_StatusTypeDef HAL_QSPI_SetFifoThreshold |
( |
QSPI_HandleTypeDef * |
hqspi, |
|
|
uint32_t |
Threshold |
|
) |
| |
Set QSPI Fifo threshold.
- Parameters
-
| hqspi | : QSPI handle. |
| Threshold | : Threshold of the Fifo (value between 1 and 16). |
- Return values
-
Definition at line 2407 of file stm32l4xx_hal_qspi.c.
2409 HAL_StatusTypeDef status =
HAL_OK;
2417 hqspi->Init.FifoThreshold = Threshold;
2420 MODIFY_REG(hqspi->Instance->CR, QUADSPI_CR_FTHRES,
2421 ((hqspi->Init.FifoThreshold - 1U) << QUADSPI_CR_FTHRES_Pos));
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)
◆ HAL_QSPI_SetFlashID()
Set FlashID.
- Parameters
-
| hqspi | : QSPI handle. |
| FlashID | : Index of the flash memory to be accessed. This parameter can be a value of QSPI Flash Select. |
- Note
- The FlashID is ignored when dual flash mode is enabled.
- Return values
-
Definition at line 2452 of file stm32l4xx_hal_qspi.c.
2454 HAL_StatusTypeDef status =
HAL_OK;
2465 hqspi->Init.FlashID = FlashID;
2468 MODIFY_REG(hqspi->Instance->CR, QUADSPI_CR_FSEL, FlashID);
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))
◆ HAL_QSPI_SetTimeout()
Set QSPI timeout.
- Parameters
-
| hqspi | : QSPI handle. |
| Timeout | : Timeout for the QSPI memory access. |
- Return values
-
Definition at line 2397 of file stm32l4xx_hal_qspi.c.
2399 hqspi->Timeout = Timeout;