STM/STM32_LIBRARIES/tm_stm32_qspiflash.c
static uint8_t QSPI_ResetMemory(QSPI_HandleTypeDef *hqspi)
{
  QSPI_CommandTypeDef s_command;

  /* Initialize the reset enable command */
  s_command.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
  s_command.Instruction       = RESET_ENABLE_CMD;
  s_command.AddressMode       = QSPI_ADDRESS_NONE;
  s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
  s_command.DataMode          = QSPI_DATA_NONE;
  s_command.DummyCycles       = 0;
  s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
  s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
  s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;

  /* Send the command */
  if (HAL_QSPI_Command(hqspi, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
  {
    return QSPI_ERROR;
  }

  /* Send the reset memory command */
  s_command.Instruction = RESET_MEMORY_CMD;
  if (HAL_QSPI_Command(hqspi, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
  {
    return QSPI_ERROR;
  }

  /* Configure automatic polling mode to wait the memory is ready */  
  if (QSPI_AutoPollingMemReady(hqspi, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != QSPI_OK)
  {
    return QSPI_ERROR;
  }

  return QSPI_OK;
}
/**
  * @brief  This function reset the QSPI memory.
  * @param  hqspi: QSPI handle
  * @retval None
  */
@brief  This function reset the QSPI memory.
@param  hqspi: QSPI handle
@retval None
@brief This function reset the QSPI memory . @param hqspi : QSPI handle @retval None
static uint8_t QSPI_ResetMemory(QSPI_HandleTypeDef *hqspi)
{
  QSPI_CommandTypeDef s_command;
  s_command.InstructionMode   = QSPI_INSTRUCTION_1_LINE;
  s_command.Instruction       = RESET_ENABLE_CMD;
  s_command.AddressMode       = QSPI_ADDRESS_NONE;
  s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
  s_command.DataMode          = QSPI_DATA_NONE;
  s_command.DummyCycles       = 0;
  s_command.DdrMode           = QSPI_DDR_MODE_DISABLE;
  s_command.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
  s_command.SIOOMode          = QSPI_SIOO_INST_EVERY_CMD;
  if (HAL_QSPI_Command(hqspi, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
  {
    return QSPI_ERROR;
  }
  s_command.Instruction = RESET_MEMORY_CMD;
  if (HAL_QSPI_Command(hqspi, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
  {
    return QSPI_ERROR;
  }
  if (QSPI_AutoPollingMemReady(hqspi, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != QSPI_OK)
  {
    return QSPI_ERROR;
  }
  return QSPI_OK;
}
static uint8_t QSPI_ResetMemory ( QSPI_HandleTypeDef * hqspi ) { QSPI_CommandTypeDef s_command ; s_command . InstructionMode = QSPI_INSTRUCTION_1_LINE ; s_command . Instruction = RESET_ENABLE_CMD ; s_command . AddressMode = QSPI_ADDRESS_NONE ; s_command . AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE ; s_command . DataMode = QSPI_DATA_NONE ; s_command . DummyCycles = 0 ; s_command . DdrMode = QSPI_DDR_MODE_DISABLE ; s_command . DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY ; s_command . SIOOMode = QSPI_SIOO_INST_EVERY_CMD ; if ( HAL_QSPI_Command ( hqspi , & s_command , HAL_QPSI_TIMEOUT_DEFAULT_VALUE ) != HAL_OK ) { return QSPI_ERROR ; } s_command . Instruction = RESET_MEMORY_CMD ; if ( HAL_QSPI_Command ( hqspi , & s_command , HAL_QPSI_TIMEOUT_DEFAULT_VALUE ) != HAL_OK ) { return QSPI_ERROR ; } if ( QSPI_AutoPollingMemReady ( hqspi , HAL_QPSI_TIMEOUT_DEFAULT_VALUE ) != QSPI_OK ) { return QSPI_ERROR ; } return QSPI_OK ; }
@brief  This function reset the QSPI memory.
@brief This function reset the QSPI memory .
/* Initialize the reset enable command */ /* Send the command */ /* Send the reset memory command */ /* Configure automatic polling mode to wait the memory is ready */