STM32 OSPI四线读取 SST26VF064B ID

STM32 OSPI四线读取 SST26VF064B ID_第1张图片读取时序

代码:

 OSPI_RegularCmdTypeDef sCommand;  
   
  HAL_GPIO_WritePin(OCTOSPIM_P1_NSS1_GPIO_Port, OCTOSPIM_P1_NSS1_Pin, GPIO_PIN_RESET);  
  sCommand.OperationType = HAL_OSPI_OPTYPE_COMMON_CFG;  
  sCommand.FlashId = HAL_OSPI_FLASH_ID_1;  
  sCommand.Instruction =0XAF;  
  sCommand.InstructionMode = HAL_OSPI_INSTRUCTION_4_LINES;  
  sCommand.InstructionSize = HAL_OSPI_INSTRUCTION_8_BITS;  
  
  
  sCommand.AddressMode = HAL_OSPI_ADDRESS_NONE;  
  sCommand.AddressSize = HAL_OSPI_ADDRESS_24_BITS; 
  
  sCommand.DataDtrMode = HAL_OSPI_DATA_DTR_DISABLE;   
  sCommand.DataMode = HAL_OSPI_DATA_4_LINES;  
  sCommand.NbData = 3; 
  
  sCommand.AlternateBytesMode = HAL_OSPI_ALTERNATE_BYTES_NONE;  

  sCommand.DummyCycles = 2;  
  sCommand.DQSMode = HAL_OSPI_DQS_DISABLE;  
  sCommand.SIOOMode = HAL_OSPI_SIOO_INST_EVERY_CMD;    
  sCommand.InstructionDtrMode = HAL_OSPI_INSTRUCTION_DTR_DISABLE;  
  
  if(HAL_OSPI_Command(&hospi1,&sCommand,1000)==HAL_OK){

        HAL_OSPI_Receive(&hospi1, ID, 1000); 
  }
  
  HAL_GPIO_WritePin(OCTOSPIM_P1_NSS1_GPIO_Port, OCTOSPIM_P1_NSS1_Pin, GPIO_PIN_SET);  

你可能感兴趣的:(STM32,stm32)