STM32L4xx_HAL_Driver  1.14.0
Peripheral State functions

Peripheral State functions. More...

Functions

HAL_NAND_StateTypeDef HAL_NAND_GetState (NAND_HandleTypeDef *hnand)
 Return the NAND state. More...
 
uint32_t HAL_NAND_Read_Status (NAND_HandleTypeDef *hnand)
 NAND memory read status. More...
 

Detailed Description

Peripheral State functions.

  ==============================================================================
                         ##### NAND State functions #####
  ==============================================================================
  [..]
    This subsection permits to get in run-time the status of the NAND controller
    and the data flow.

Function Documentation

◆ HAL_NAND_GetState()

HAL_NAND_StateTypeDef HAL_NAND_GetState ( NAND_HandleTypeDef hnand)

Return the NAND state.

Parameters
hnandpointer to a NAND_HandleTypeDef structure that contains the configuration information for NAND module.
Return values
HALstate

Definition at line 1785 of file stm32l4xx_hal_nand.c.

1786 {
1787  /* Return NAND handle state */
1788  return hnand->State;
1789 }
__IO HAL_NAND_StateTypeDef State

◆ HAL_NAND_Read_Status()

uint32_t HAL_NAND_Read_Status ( NAND_HandleTypeDef hnand)

NAND memory read status.

Parameters
hnandpointer to a NAND_HandleTypeDef structure that contains the configuration information for NAND module.
Return values
NANDstatus

Definition at line 1797 of file stm32l4xx_hal_nand.c.

1798 {
1799  uint32_t data = 0;
1800  uint32_t DeviceAddress = 0;
1801 
1802  /* Identify the device address */
1803  DeviceAddress = NAND_DEVICE;
1804 
1805  /* Send Read status operation command */
1806  *(__IO uint8_t *)((uint32_t)(DeviceAddress | CMD_AREA)) = NAND_CMD_STATUS;
1807 
1808  /* Read status register data */
1809  data = *(__IO uint8_t *)DeviceAddress;
1810 
1811  /* Return the status */
1812  if ((data & NAND_ERROR) == NAND_ERROR)
1813  {
1814  return NAND_ERROR;
1815  }
1816  else if ((data & NAND_READY) == NAND_READY)
1817  {
1818  return NAND_READY;
1819  }
1820 
1821  return NAND_BUSY;
1822 }