Stima V4 Slave RAIN  4.2
flash.cpp
Go to the documentation of this file.
1 
31 #include "drivers/flash.h"
32 
33 /* QSPI IRQ CallBack for QSPI Class ---------------------------------------------------*/
34 
36 extern "C" void QUADSPI_IRQHandler(void)
37 {
38  /* USER CODE BEGIN QUADSPI_IRQn 0 */
39 
40  /* USER CODE END QUADSPI_IRQn 0 */
41  HAL_QSPI_IRQHandler(&hqspi);
42  /* USER CODE BEGIN QUADSPI_IRQn 1 */
43 
44  /* USER CODE END QUADSPI_IRQn 1 */
45 }
46 
47 // Flash Object Pointer IRQ_CallBACK Function
49 
52 extern "C" void HAL_QSPI_ErrorCallback(QSPI_HandleTypeDef *hqspi)
53 {
54  /* Prevent unused argument(s) compilation warning */
55  UNUSED(hqspi);
57 }
58 
61 extern "C" void HAL_QSPI_CmdCpltCallback(QSPI_HandleTypeDef *hqspi)
62 {
63  UNUSED(hqspi);
65 }
66 
69 extern "C" void HAL_QSPI_RxCpltCallback(QSPI_HandleTypeDef *hqspi)
70 {
71  UNUSED(hqspi);
73 }
74 
77 extern "C" void HAL_QSPI_TxCpltCallback(QSPI_HandleTypeDef *hqspi)
78 {
79  /* Prevent unused argument(s) compilation warning */
80  UNUSED(hqspi);
82 }
83 
86 extern "C" void HAL_QSPI_StatusMatchCallback(QSPI_HandleTypeDef *hqspi)
87 {
88  /* Prevent unused argument(s) compilation warning */
89  UNUSED(hqspi);
91 }
92 
93 /* Constructor Class ---------------------------------------------------------*/
94 
96 {
97 }
98 
99 Flash::Flash(QSPI_HandleTypeDef *hqspi)
100 {
101  _hqspi = hqspi;
103 }
104 
105 /* Implementation functions ---------------------------------------------------------*/
106 
110 {
111  /* Check if QSPI is initialized */
112  if (_FlashInfo.State == QSPI_READY)
113  return QSPI_OK;
114 
115  _hqspi->Instance = QUADSPI;
117 
118  /* Call the DeInit function to reset the driver */
119  if (HAL_QSPI_DeInit(_hqspi) != HAL_OK)
120  return QSPI_ERROR;
121 
122  /* QSPI initialization (done in MX_QUADSPI_Init() here rewrite only FlashSize) */
123  _hqspi->Init.FlashSize = POSITION_VAL(AT25SF161_FLASH_SIZE) - 1;
124 
125  if (HAL_QSPI_Init(_hqspi) != HAL_OK)
126  return QSPI_ERROR;
127 
128  /* Start Flash Get State */
130 
131  /* Exit from deep power down */
133  return QSPI_ERROR;
134 
135  /* Read flash status */
137  return QSPI_ERROR;
138 
139  /* Flash busy? */
141  return QSPI_BUSY;
142 
143  /* Device Quad mode enable */
145  uint32_t Flash_SR = _FlashInfo.StatusRegister | AT25SF161_SR_QE;
146  if (BSP_QSPI_WriteStatus(Flash_SR) != QSPI_OK)
147  return QSPI_ERROR;
148  }
149 
150  /* Read again flash status */
152  return QSPI_ERROR;
153 
154  /* QSPI memory reset */
155  if (QSPI_ResetMemory() != QSPI_OK)
156  return QSPI_NOT_SUPPORTED;
157 
158  /* Dummy cycles configuration on QSPI memory side */
159  if (QSPI_DummyCyclesCfg() != QSPI_OK)
160  return QSPI_NOT_SUPPORTED;
161 
162  /* Get Info State and Set Ready */
164 
166  return QSPI_OK;
167 }
168 
172 {
173  HAL_StatusTypeDef sts;
174  QSPI_StatusTypeDef qsts;
175 
176  if (_FlashInfo.State == 0 || _FlashInfo.State == QSPI_RESET)
177  return QSPI_OK;
178 
179  _hqspi->Instance = QUADSPI;
180 
181  /* Disable memory mapped mode */
183  return QSPI_ERROR;
184 
185  /* WakeUp */
186  if ((qsts = QSPI_SetDeepPowerDown()) != QSPI_OK)
187  return qsts;
188  HAL_Delay(1);
189 
190  /* Call the DeInit function to reset the driver */
191  if ((sts = HAL_QSPI_DeInit(_hqspi)) != HAL_OK)
192  return (QSPI_StatusTypeDef) sts;
193 
194  /* Init QSPI status flag */
195  _evtFlag->flag = 0;
196 
198 
199  return QSPI_OK;
200 }
201 
207 Flash::QSPI_StatusTypeDef Flash::BSP_QSPI_Read(uint8_t *pData, uint32_t ReadAddr, uint32_t Size)
208 {
209  HAL_StatusTypeDef sts;
210  QSPI_CommandTypeDef sCommand = {0};
211 
212  /* Disable memory mapped mode */
214  return QSPI_ERROR;
215 
216  /* Initialize the read command */
217  sCommand.InstructionMode = QSPI_INSTRUCTION_1_LINE;
218  sCommand.Instruction = QUAD_INOUT_FAST_READ_CMD;
219  sCommand.AddressMode = QSPI_ADDRESS_4_LINES;
220  sCommand.AddressSize = QSPI_ADDRESS_24_BITS;
221  sCommand.Address = ReadAddr;
222  sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_4_LINES;
223  sCommand.AlternateBytesSize = QSPI_ALTERNATE_BYTES_8_BITS;
224  sCommand.AlternateBytes = 0;
225  sCommand.DataMode = QSPI_DATA_4_LINES;
226  sCommand.DummyCycles = AT25SF161_DUMMY_CYCLES_READ_QUAD;
227  sCommand.NbData = Size;
228  sCommand.DdrMode = QSPI_DDR_MODE_DISABLE;
229  sCommand.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
230  sCommand.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
231 
232  /* Configure the command */
233  if ((sts = HAL_QSPI_Command(_hqspi, &sCommand, HAL_QSPI_TIMEOUT_DEFAULT_VALUE)) != HAL_OK)
234  return (QSPI_StatusTypeDef) sts;
235 
236  /* Reception of the data */
237  return BSP_QSPI_Receive(pData, HAL_QSPI_TIMEOUT_DEFAULT_VALUE);
238 }
239 
245 Flash::QSPI_StatusTypeDef Flash::BSP_QSPI_Write(uint8_t *pData, uint32_t WriteAddr, uint32_t Size)
246 {
247  HAL_StatusTypeDef sts;
248  QSPI_StatusTypeDef qsts;
249  QSPI_CommandTypeDef sCommand = {0};
250  uint32_t end_addr, current_size, current_addr;
251 
252  /* Calculation of the size between the write address and the end of the page */
253  current_size = AT25SF161_PAGE_SIZE - (WriteAddr % AT25SF161_PAGE_SIZE);
254 
255  /* Check if the size of the data is less than the remaining place in the page */
256  if (current_size > Size)
257  current_size = Size;
258 
259  /* Initialize the adress variables */
260  current_addr = WriteAddr;
261  end_addr = WriteAddr + Size;
262 
263  /* Disable memory mapped mode */
264  if ((qsts = BSP_QSPI_DisableMemoryMappedMode()) != QSPI_OK)
265  return qsts;
266 
267  /* Initialize the program command */
268  sCommand.InstructionMode = QSPI_INSTRUCTION_1_LINE;
269  sCommand.Instruction = PAGE_PROG_CMD;
270  sCommand.AddressMode = QSPI_ADDRESS_1_LINE;
271  sCommand.AddressSize = QSPI_ADDRESS_24_BITS;
272  sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
273  sCommand.DataMode = QSPI_DATA_1_LINE;
274  sCommand.DummyCycles = 0;
275  sCommand.DdrMode = QSPI_DDR_MODE_DISABLE;
276  sCommand.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
277  sCommand.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
278 
279  /* Perform the write page by page */
280  do {
281  sCommand.Address = current_addr;
282  sCommand.NbData = current_size;
283 
284  /* Enable write operations */
285  if ((qsts = QSPI_WriteEnable()) != QSPI_OK)
286  return qsts;
287 
288  /* Configure the command */
289  if ((sts = HAL_QSPI_Command(_hqspi, &sCommand, HAL_QSPI_TIMEOUT_DEFAULT_VALUE)) != HAL_OK)
290  return (QSPI_StatusTypeDef) sts;
291 
292  /* Transmission of the data */
293  if ((qsts = BSP_QSPI_Transmit(pData, HAL_QSPI_TIMEOUT_DEFAULT_VALUE)) != QSPI_OK)
294  return qsts;
295 
296  /* Configure automatic polling mode to wait for end of program */
297  if ((qsts = QSPI_AutoPollingMemReady(HAL_QSPI_TIMEOUT_DEFAULT_VALUE)) != QSPI_OK)
298  return qsts;
299 
300  /* Update the address and size variables for next page programming */
301  current_addr += current_size;
302  pData += current_size;
303  current_size = ((current_addr + AT25SF161_PAGE_SIZE) > end_addr) ? (end_addr - current_addr) : AT25SF161_PAGE_SIZE;
304  } while (current_addr < end_addr);
305 
306  return QSPI_OK;
307 }
308 
313 {
314  QSPI_CommandTypeDef sCommand = {0};
315 
316  /* Disable memory mapped mode */
318  return QSPI_ERROR;
319 
320  /* Initialize the erase command */
321  sCommand.InstructionMode = QSPI_INSTRUCTION_1_LINE;
322  sCommand.Instruction = BLOCK_ERASE_CMD;
323  sCommand.AddressMode = QSPI_ADDRESS_1_LINE;
324  sCommand.AddressSize = QSPI_ADDRESS_24_BITS;
325  sCommand.Address = (BlockAddress * AT25SF161_BLOCK_SIZE);
326  sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
327  sCommand.DataMode = QSPI_DATA_NONE;
328  sCommand.DummyCycles = 0;
329  sCommand.DdrMode = QSPI_DDR_MODE_DISABLE;
330  sCommand.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
331  sCommand.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
332 
333  /* Enable write operations */
334  if (QSPI_WriteEnable() != QSPI_OK)
335  return QSPI_ERROR;
336 
337  /* Send the command */
338  if (HAL_QSPI_Command(_hqspi, &sCommand, HAL_QSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
339  return QSPI_ERROR;
340 
341  /* Configure automatic polling mode to wait for end of erase */
343 }
344 
354 {
355  QSPI_CommandTypeDef sCommand = {0};
356 
357  if (Sector >= (uint32_t)(AT25SF161_FLASH_SIZE / AT25SF161_SECTOR_SIZE))
358  return QSPI_ERROR;
359 
360  /* Disable memory mapped mode */
362  return QSPI_ERROR;
363 
364  /* Initialize the erase command */
365  sCommand.InstructionMode = QSPI_INSTRUCTION_1_LINE;
366  sCommand.Instruction = SECTOR_ERASE_CMD;
367  sCommand.AddressMode = QSPI_ADDRESS_1_LINE;
368  sCommand.AddressSize = QSPI_ADDRESS_24_BITS;
369  sCommand.Address = (Sector * AT25SF161_SECTOR_SIZE);
370  sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
371  sCommand.DataMode = QSPI_DATA_NONE;
372  sCommand.DummyCycles = 0;
373  sCommand.DdrMode = QSPI_DDR_MODE_DISABLE;
374  sCommand.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
375  sCommand.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
376 
377  /* Enable write operations */
378  if (QSPI_WriteEnable() != QSPI_OK)
379  return QSPI_ERROR;
380 
381  /* Send the command */
382  if (HAL_QSPI_Command(_hqspi, &sCommand, HAL_QSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
383  return QSPI_ERROR;
384 
385  /* Configure automatic polling mode to wait for end of erase */
387 }
388 
392 {
393  QSPI_CommandTypeDef sCommand = {0};
394 
395  /* Disable memory mapped mode */
397  return QSPI_ERROR;
398 
399  /* Initialize the erase command */
400  sCommand.InstructionMode = QSPI_INSTRUCTION_1_LINE;
401  sCommand.Instruction = BULK_ERASE_CMD;
402  sCommand.AddressMode = QSPI_ADDRESS_NONE;
403  sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
404  sCommand.DataMode = QSPI_DATA_NONE;
405  sCommand.DummyCycles = 0;
406  sCommand.DdrMode = QSPI_DDR_MODE_DISABLE;
407  sCommand.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
408  sCommand.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
409 
410  /* Enable write operations */
411  if (QSPI_WriteEnable() != QSPI_OK)
412  return QSPI_ERROR;
413 
414  /* Send the command */
415  if (HAL_QSPI_Command(_hqspi, &sCommand, HAL_QSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
416  return QSPI_ERROR;
417 
418  /* Configure automatic polling mode to wait for end of erase */
420 }
421 
426 {
427  HAL_StatusTypeDef sts;
428  QSPI_CommandTypeDef sCommand = {0};
429  uint8_t reg1, reg2;
430 
431  /* Initialize the read status register byte 1 command */
432  sCommand.InstructionMode = QSPI_INSTRUCTION_1_LINE;
433  sCommand.Instruction = READ_STATUS_REG_CMD;
434  sCommand.AddressMode = QSPI_ADDRESS_NONE;
435  sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
436  sCommand.DataMode = QSPI_DATA_1_LINE;
437  sCommand.DummyCycles = 0;
438  sCommand.NbData = 1;
439  sCommand.DdrMode = QSPI_DDR_MODE_DISABLE;
440  sCommand.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
441  sCommand.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
442 
443  /* Configure the command */
444  if ((sts = HAL_QSPI_Command(_hqspi, &sCommand, HAL_QSPI_TIMEOUT_DEFAULT_VALUE)) != HAL_OK)
445  return (QSPI_StatusTypeDef) sts;
446 
447  /* Reception of the data byte 1*/
448  if ((sts = HAL_QSPI_Receive(_hqspi, &reg1, HAL_QSPI_TIMEOUT_DEFAULT_VALUE)) != HAL_OK)
449  return (QSPI_StatusTypeDef) sts;
450 
451  /* Initialize the read status register byte 2 command */
452  sCommand.Instruction = READ_STATUS2_REG_CMD;
453 
454  /* Configure the command */
455  if ((sts = HAL_QSPI_Command(_hqspi, &sCommand, HAL_QSPI_TIMEOUT_DEFAULT_VALUE)) != HAL_OK)
456  return (QSPI_StatusTypeDef) sts;
457 
458  /* Reception of the data byte 2*/
459  if ((sts = HAL_QSPI_Receive(_hqspi, &reg2, HAL_QSPI_TIMEOUT_DEFAULT_VALUE)) != HAL_OK)
460  return (QSPI_StatusTypeDef) sts;
461 
462  *Reg = (reg2 << 8) + reg1;
463  return QSPI_OK;
464 }
465 
470 {
471  HAL_StatusTypeDef sts;
472  QSPI_StatusTypeDef qsts;
473  QSPI_CommandTypeDef sCommand = {0};
474  uint8_t reg[2];
475  reg[0] = Reg & 0xFF;
476  reg[1] = Reg >> 8;
477 
478  /* Enable Volatile Status Register mode */
479  if ((qsts = QSPI_WriteEnableVolat())!= QSPI_OK)
480  return qsts;
481 #if 0
482  /* Enable write operations (NON CI VUOLE!) */
483  if ((qsts = QSPI_WriteEnable()) != QSPI_OK)
484  return qsts;
485 #endif
486 
487  /* Initialize the write status register command */
488  sCommand.InstructionMode = QSPI_INSTRUCTION_1_LINE;
489  sCommand.Instruction = WRITE_STATUS_REG_CMD;
490  sCommand.AddressMode = QSPI_ADDRESS_NONE;
491  sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
492  sCommand.DataMode = QSPI_DATA_1_LINE;
493  sCommand.DummyCycles = 0;
494  sCommand.NbData = 2;
495  sCommand.DdrMode = QSPI_DDR_MODE_DISABLE;
496  sCommand.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
497  sCommand.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
498 
499  /* Configure the command */
500  if ((sts = HAL_QSPI_Command(_hqspi, &sCommand, HAL_QSPI_TIMEOUT_DEFAULT_VALUE)) != HAL_OK)
501  return (QSPI_StatusTypeDef) sts;
502 
503  /* Transmission of the status data */
504  return BSP_QSPI_Transmit(reg, HAL_QSPI_TIMEOUT_DEFAULT_VALUE);
505 }
506 
510 {
511  uint32_t sts;
512 
513  if (BSP_QSPI_ReadStatus(&sts) != QSPI_OK)
514  return QSPI_ERROR;
515 
516  if ((sts & AT25SF161_FS_ERSUS) == AT25SF161_FS_ERSUS)
517  return QSPI_SUSPENDED;
518  else if ((sts & AT25SF161_SR_BUSY) == AT25SF161_SR_BUSY)
519  return QSPI_BUSY;
520  else
521  return QSPI_OK;
522 }
523 
528 {
529  /* Configure the structure with the memory configuration */
535 
536  return QSPI_OK;
537 }
538 
542 {
543  QSPI_CommandTypeDef sCommand = {0};
544  QSPI_MemoryMappedTypeDef sMemMappedCfg = {0};
545 
546  /* Is already in memory mapped mode? */
547  if (_hqspi->State == HAL_QSPI_STATE_BUSY_MEM_MAPPED)
548  return QSPI_OK;
549 
550  /* Configure the command for the read instruction */
551  sCommand.InstructionMode = QSPI_INSTRUCTION_1_LINE;
552  sCommand.Instruction = QUAD_INOUT_FAST_READ_CMD;
553  sCommand.AddressMode = QSPI_ADDRESS_4_LINES;
554  sCommand.AddressSize = QSPI_ADDRESS_24_BITS;
555  sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_4_LINES;
556  sCommand.AlternateBytesSize = QSPI_ALTERNATE_BYTES_8_BITS;
557  sCommand.AlternateBytes = 0x20;
558 
559  sCommand.DataMode = QSPI_DATA_4_LINES;
560  sCommand.DummyCycles = AT25SF161_DUMMY_CYCLES_READ_QUAD;
561  sCommand.DdrMode = QSPI_DDR_MODE_DISABLE;
562  sCommand.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
563  sCommand.SIOOMode = QSPI_SIOO_INST_ONLY_FIRST_CMD;
564 
565  /* Configure the memory mapped mode */
566  sMemMappedCfg.TimeOutActivation = QSPI_TIMEOUT_COUNTER_DISABLE;
567 
568  return (QSPI_StatusTypeDef) HAL_QSPI_MemoryMapped(_hqspi, &sCommand, &sMemMappedCfg);
569 }
570 
574 {
575  if (__HAL_QSPI_GET_FLAG(_hqspi, QSPI_FLAG_BUSY) == SET) {
576  if (HAL_QSPI_Abort(_hqspi) != HAL_OK)
577  return QSPI_ERROR;
579  return QSPI_ERROR;
580  }
581  return QSPI_OK;
582 }
583 
587 {
588  QSPI_CommandTypeDef sCommand = {0};
589 
590  /* Check whether the device is busy (erase operation is
591  in progress).
592  */
593  if (BSP_QSPI_GetStatus() == QSPI_BUSY) {
594  /* Initialize the erase command */
595  sCommand.InstructionMode = QSPI_INSTRUCTION_1_LINE;
596  sCommand.Instruction = PROG_ERASE_SUSPEND_CMD;
597  sCommand.AddressMode = QSPI_ADDRESS_NONE;
598  sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
599  sCommand.DataMode = QSPI_DATA_NONE;
600  sCommand.DummyCycles = 0;
601  sCommand.DdrMode = QSPI_DDR_MODE_DISABLE;
602  sCommand.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
603  sCommand.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
604 
605  /* Enable write operations */
606  if (QSPI_WriteEnable() != QSPI_OK)
607  return QSPI_ERROR;
608 
609  /* Send the command */
610  if (HAL_QSPI_Command(_hqspi, &sCommand, HAL_QSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
611  return QSPI_ERROR;
612 
614  return QSPI_OK;
615 
616  return QSPI_ERROR;
617  }
618 
619  return QSPI_OK;
620 }
621 
625 {
626  QSPI_CommandTypeDef sCommand = {0};
627 
628  /* Check whether the device is in suspended state */
630  /* Initialize the erase command */
631  sCommand.InstructionMode = QSPI_INSTRUCTION_1_LINE;
632  sCommand.Instruction = PROG_ERASE_RESUME_CMD;
633  sCommand.AddressMode = QSPI_ADDRESS_NONE;
634  sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
635  sCommand.DataMode = QSPI_DATA_NONE;
636  sCommand.DummyCycles = 0;
637  sCommand.DdrMode = QSPI_DDR_MODE_DISABLE;
638  sCommand.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
639  sCommand.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
640 
641  /* Enable write operations */
642  if (QSPI_WriteEnable() != QSPI_OK)
643  return QSPI_ERROR;
644 
645  /* Send the command */
646  if (HAL_QSPI_Command(_hqspi, &sCommand, HAL_QSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
647  return QSPI_ERROR;
648 
649  /*
650  When this command is executed, the status register write in progress bit is set to 1, and
651  the flag status register program erase controller bit is set to 0. This command is ignored
652  if the device is not in a suspended state.
653  */
654 
655  if (BSP_QSPI_GetStatus() == QSPI_BUSY)
656  return QSPI_OK;
657 
658  return QSPI_ERROR;
659  }
660 
661  return QSPI_OK;
662 }
663 
669 Flash::QSPI_StatusTypeDef Flash::BSP_QSPI_Receive(uint8_t *pData, uint32_t Timeout)
670 {
671  /* Try Match QSPI status flag */
672  _evtFlag->flag = 0;
675  if (HAL_QSPI_Receive_IT(_hqspi, pData) != HAL_OK)
676  return QSPI_ERROR;
677  return BSP_QSPI_WaitingForEvent(Timeout);
678 }
679 
685 Flash::QSPI_StatusTypeDef Flash::BSP_QSPI_Transmit(uint8_t *pData, uint32_t Timeout)
686 {
687  /* Try Match QSPI status flag */
688  _evtFlag->flag = 0;
691  if (HAL_QSPI_Transmit_IT(_hqspi, pData) != HAL_OK)
692  return QSPI_ERROR;
693  return BSP_QSPI_WaitingForEvent(Timeout);
694 }
695 
702 Flash::QSPI_StatusTypeDef Flash::BSP_QSPI_AutoPolling(QSPI_CommandTypeDef *cmd, QSPI_AutoPollingTypeDef *cfg, uint32_t Timeout)
703 {
704  /* Try Match QSPI status flag */
705  _evtFlag->flag = 0;
708  if (HAL_QSPI_AutoPolling_IT(_hqspi, cmd, cfg) != HAL_OK)
709  return QSPI_ERROR;
710  return BSP_QSPI_WaitingForEvent(Timeout);
711 }
712 
717  bool bSetOFlag = false;
718  bool bTimeOut = false;
719  bool bMatchField = false;
720  Timeout += millis();
721  if( Timeout < millis()) bSetOFlag = true;
722  while((!bTimeOut)&&(!bMatchField)) {
723  // Switch Task
724  taskYIELD();
725  // Test Flag
726  if(_evtFlag->flagBit.match_SM && _evtFlag->flagBit.flag_SM) bMatchField = true;
727  if(_evtFlag->flagBit.match_TC && _evtFlag->flagBit.flag_TC) bMatchField = true;
728  if(_evtFlag->flagBit.match_TE && _evtFlag->flagBit.flag_TE) bMatchField = true;
729  // Check Timeout
730  if(bSetOFlag) {
731  if(millis() < Timeout) bSetOFlag = false;
732  } else {
733  if(millis() > Timeout) bTimeOut = true;
734  }
735  }
736  if(bTimeOut) return QSPI_TIMEOUT;
739  return QSPI_ERROR;
740 }
741 
745 {
746  QSPI_CommandTypeDef sCommand = {0};
747 
748  /* Enable write operations */
749  sCommand.InstructionMode = QSPI_INSTRUCTION_1_LINE;
750  sCommand.Instruction = DEEP_POWER_DOWN_CMD;
751  sCommand.AddressMode = QSPI_ADDRESS_NONE;
752  sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
753  sCommand.DataMode = QSPI_DATA_NONE;
754  sCommand.DummyCycles = 0;
755  sCommand.DdrMode = QSPI_DDR_MODE_DISABLE;
756  sCommand.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
757  sCommand.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
758 
759  return (QSPI_StatusTypeDef) HAL_QSPI_Command(_hqspi, &sCommand, HAL_QSPI_TIMEOUT_DEFAULT_VALUE);
760 }
761 
765 {
766  QSPI_CommandTypeDef sCommand = {0};
767 
768  /* Enable write operations */
769  sCommand.InstructionMode = QSPI_INSTRUCTION_1_LINE;
770  sCommand.Instruction = RESUME_FROM_DEEP_PWD_CMD;
771  sCommand.AddressMode = QSPI_ADDRESS_NONE;
772  sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
773  sCommand.DataMode = QSPI_DATA_NONE;
774  sCommand.DummyCycles = 0;
775  sCommand.DdrMode = QSPI_DDR_MODE_DISABLE;
776  sCommand.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
777  sCommand.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
778 
779  return (QSPI_StatusTypeDef) HAL_QSPI_Command(_hqspi, &sCommand, HAL_QSPI_TIMEOUT_DEFAULT_VALUE);
780 }
781 
785 {
786 #ifdef __AT25SF161_H
787  return QSPI_OK;
788 #else
789  QSPI_CommandTypeDef sCommand = {0};
790 
791  /* Initialize the reset enable command */
792  sCommand.InstructionMode = QSPI_INSTRUCTION_1_LINE;
793  sCommand.Instruction = RESET_ENABLE_CMD;
794  sCommand.AddressMode = QSPI_ADDRESS_NONE;
795  sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
796  sCommand.DataMode = QSPI_DATA_NONE;
797  sCommand.DummyCycles = 0;
798  sCommand.DdrMode = QSPI_DDR_MODE_DISABLE;
799  sCommand.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
800  sCommand.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
801 
802  /* Send the command */
803  if (HAL_QSPI_Command(_hqspi, &sCommand, HAL_QSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
804  return QSPI_ERROR;
805 
806  /* Send the reset memory command */
807  sCommand.Instruction = RESET_MEMORY_CMD;
808  if (HAL_QSPI_Command(_hqspi, &sCommand, HAL_QSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
809  return QSPI_ERROR;
810 
811  /* Configure automatic polling mode to wait the memory is ready */
812  if (QSPI_AutoPollingMemReady(HAL_QSPI_TIMEOUT_DEFAULT_VALUE) != QSPI_OK)
813  return QSPI_ERROR;
814 
815  return QSPI_OK;
816 #endif
817 }
818 
824 {
825 #ifdef __AT25SF161_H
826  return QSPI_OK;
827 #else
828 
829  QSPI_CommandTypeDef sCommand = {0};
830  uint8_t reg;
831 
832  /* Initialize the read volatile configuration register command */
833  sCommand.InstructionMode = QSPI_INSTRUCTION_1_LINE;
834  sCommand.Instruction = READ_VOL_CFG_REG_CMD;
835  sCommand.AddressMode = QSPI_ADDRESS_NONE;
836  sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
837  sCommand.DataMode = QSPI_DATA_1_LINE;
838  sCommand.DummyCycles = 0;
839  sCommand.NbData = 1;
840  sCommand.DdrMode = QSPI_DDR_MODE_DISABLE;
841  sCommand.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
842  sCommand.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
843 
844  /* Configure the command */
845  if (HAL_QSPI_Command(_hqspi, &sCommand, HAL_QSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
846  return QSPI_ERROR;
847 
848  /* Reception of the data */
849  if (HAL_QSPI_Receive(_hqspi, &reg, HAL_QSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
850  return QSPI_ERROR;
851 
852  /* Enable write operations */
853  if (QSPI_WriteEnable() != QSPI_OK)
854  return QSPI_ERROR;
855 
856  /* Update volatile configuration register (with new dummy cycles) */
857  sCommand.Instruction = WRITE_VOL_CFG_REG_CMD;
858  MODIFY_REG(reg, AT25SF161_VCR_NB_DUMMY, (AT25SF161_DUMMY_CYCLES_READ_QUAD << POSITION_VAL(AT25SF161_VCR_NB_DUMMY)));
859 
860  /* Configure the write volatile configuration register command */
861  if (HAL_QSPI_Command(_hqspi, &sCommand, HAL_QSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
862  return QSPI_ERROR;
863 
864  /* Transmission of the data */
865  if (HAL_QSPI_Transmit(_hqspi, &reg, HAL_QSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
866  return QSPI_ERROR;
867 
868  return QSPI_OK;
869 #endif
870 }
871 
875 {
876  QSPI_CommandTypeDef sCommand = {0};
877 
878  /* Enable write volatile operations */
879  sCommand.InstructionMode = QSPI_INSTRUCTION_1_LINE;
880  sCommand.Instruction = WRITE_EN_VOLAT_STATUS_REG_CMD;
881  sCommand.AddressMode = QSPI_ADDRESS_NONE;
882  sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
883  sCommand.DataMode = QSPI_DATA_NONE;
884  sCommand.DummyCycles = 0;
885  sCommand.DdrMode = QSPI_DDR_MODE_DISABLE;
886  sCommand.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
887  sCommand.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
888 
889  return (QSPI_StatusTypeDef) HAL_QSPI_Command(_hqspi, &sCommand, HAL_QSPI_TIMEOUT_DEFAULT_VALUE);
890 }
891 
895 {
896  HAL_StatusTypeDef sts;
897  QSPI_CommandTypeDef sCommand = {0};
898  QSPI_AutoPollingTypeDef sConfig = {0};
899 
900  /* Enable write operations */
901  sCommand.InstructionMode = QSPI_INSTRUCTION_1_LINE;
902  sCommand.Instruction = WRITE_ENABLE_CMD;
903  sCommand.AddressMode = QSPI_ADDRESS_NONE;
904  sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
905  sCommand.DataMode = QSPI_DATA_NONE;
906  sCommand.DummyCycles = 0;
907  sCommand.DdrMode = QSPI_DDR_MODE_DISABLE;
908  sCommand.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
909  sCommand.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
910 
911  if ((sts = HAL_QSPI_Command(_hqspi, &sCommand, HAL_QSPI_TIMEOUT_DEFAULT_VALUE)) != HAL_OK)
912  return (QSPI_StatusTypeDef) sts;
913 
914  /* Configure automatic polling mode to wait for write enabling */
915  sConfig.Match = AT25SF161_SR_WEL;
916  sConfig.Mask = AT25SF161_SR_WEL;
917  sConfig.MatchMode = QSPI_MATCH_MODE_AND;
918  sConfig.StatusBytesSize = 1;
919  sConfig.Interval = 0x10;
920  sConfig.AutomaticStop = QSPI_AUTOMATIC_STOP_ENABLE;
921 
922  sCommand.Instruction = READ_STATUS_REG_CMD;
923  sCommand.DataMode = QSPI_DATA_1_LINE;
924 
925  return BSP_QSPI_AutoPolling(&sCommand, &sConfig, HAL_QSPI_TIMEOUT_DEFAULT_VALUE);
926 }
927 
931 {
932  HAL_StatusTypeDef sts;
933  QSPI_CommandTypeDef sCommand = {0};
934  QSPI_AutoPollingTypeDef sConfig = {0};
935 
936  /* Disable write operations */
937  sCommand.InstructionMode = QSPI_INSTRUCTION_1_LINE;
938  sCommand.Instruction = WRITE_DISABLE_CMD;
939  sCommand.AddressMode = QSPI_ADDRESS_NONE;
940  sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
941  sCommand.DataMode = QSPI_DATA_NONE;
942  sCommand.DummyCycles = 0;
943  sCommand.DdrMode = QSPI_DDR_MODE_DISABLE;
944  sCommand.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
945  sCommand.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
946 
947  if ((sts = HAL_QSPI_Command(_hqspi, &sCommand, HAL_QSPI_TIMEOUT_DEFAULT_VALUE)) != HAL_OK)
948  return (QSPI_StatusTypeDef) sts;
949 
950  /* Configure automatic polling mode to wait for write disabling */
951  sConfig.Match = RESET;
952  sConfig.Mask = AT25SF161_SR_WEL;
953  sConfig.MatchMode = QSPI_MATCH_MODE_AND;
954  sConfig.StatusBytesSize = 1;
955  sConfig.Interval = 0x10;
956  sConfig.AutomaticStop = QSPI_AUTOMATIC_STOP_ENABLE;
957 
958  sCommand.Instruction = READ_STATUS_REG_CMD;
959  sCommand.DataMode = QSPI_DATA_1_LINE;
960 
961  return BSP_QSPI_AutoPolling(&sCommand, &sConfig, HAL_QSPI_TIMEOUT_DEFAULT_VALUE);
962 }
963 
967 {
968  QSPI_CommandTypeDef sCommand = {0};
969 
970  /* Enable write volatile operations */
971  sCommand.InstructionMode = QSPI_INSTRUCTION_1_LINE;
972  sCommand.Instruction = QUAD_CONTINUOUS_READ_MODE_RESET;
973  sCommand.AddressMode = QSPI_ADDRESS_NONE;
974  sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
975  sCommand.DataMode = QSPI_DATA_NONE;
976  sCommand.DummyCycles = 0;
977  sCommand.DdrMode = QSPI_DDR_MODE_DISABLE;
978  sCommand.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
979  sCommand.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
980 
981  return (QSPI_StatusTypeDef) HAL_QSPI_Command(_hqspi, &sCommand, HAL_QSPI_TIMEOUT_DEFAULT_VALUE);
982 }
983 
988 {
989  QSPI_CommandTypeDef sCommand = {0};
990  QSPI_AutoPollingTypeDef sConfig = {0};
991 
992  /* Configure automatic polling mode to wait for memory ready */
993  sCommand.InstructionMode = QSPI_INSTRUCTION_1_LINE;
994  sCommand.Instruction = READ_STATUS_REG_CMD;
995  sCommand.AddressMode = QSPI_ADDRESS_NONE;
996  sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
997  sCommand.DataMode = QSPI_DATA_1_LINE;
998  sCommand.DummyCycles = 0;
999  sCommand.DdrMode = QSPI_DDR_MODE_DISABLE;
1000  sCommand.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
1001  sCommand.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
1002 
1003  sConfig.Match = RESET;
1004  sConfig.Mask = AT25SF161_SR_BUSY;
1005  sConfig.MatchMode = QSPI_MATCH_MODE_AND;
1006  sConfig.StatusBytesSize = 1;
1007  sConfig.Interval = 0x10;
1008  sConfig.AutomaticStop = QSPI_AUTOMATIC_STOP_ENABLE;
1009 
1010  return BSP_QSPI_AutoPolling(&sCommand, &sConfig, Timeout);
1011 }
1012 
1013 
#define QUAD_CONTINUOUS_READ_MODE_RESET
Definition: AT25SF161.h:78
#define WRITE_DISABLE_CMD
Definition: AT25SF161.h:82
#define PROG_ERASE_SUSPEND_CMD
Definition: AT25SF161.h:99
#define AT25SF161_SECTOR_ERASE_MAX_TIME
Definition: AT25SF161.h:53
#define DEEP_POWER_DOWN_CMD
Definition: AT25SF161.h:108
#define AT25SF161_SR_WEL
Definition: AT25SF161.h:117
#define PROG_ERASE_RESUME_CMD
Definition: AT25SF161.h:98
#define AT25SF161_SR_QE
Definition: AT25SF161.h:123
#define AT25SF161_FLASH_SIZE
AT25SF161 Configuration.
Definition: AT25SF161.h:43
#define AT25SF161_FS_ERSUS
Definition: AT25SF161.h:126
#define BULK_ERASE_CMD
Definition: AT25SF161.h:97
#define PAGE_PROG_CMD
Definition: AT25SF161.h:91
#define AT25SF161_BLOCK_SIZE
Definition: AT25SF161.h:46
#define AT25SF161_DUMMY_CYCLES_READ_QUAD
Definition: AT25SF161.h:50
#define WRITE_ENABLE_CMD
Definition: AT25SF161.h:81
#define QUAD_INOUT_FAST_READ_CMD
Definition: AT25SF161.h:77
#define WRITE_STATUS_REG_CMD
Definition: AT25SF161.h:87
#define BLOCK_ERASE_CMD
Definition: AT25SF161.h:94
#define WRITE_EN_VOLAT_STATUS_REG_CMD
Definition: AT25SF161.h:88
#define READ_STATUS_REG_CMD
Definition: AT25SF161.h:85
#define RESUME_FROM_DEEP_PWD_CMD
Definition: AT25SF161.h:109
#define AT25SF161_BULK_ERASE_MAX_TIME
Definition: AT25SF161.h:52
#define READ_STATUS2_REG_CMD
Definition: AT25SF161.h:86
#define AT25SF161_BLOCK_ERASE_MAX_TIME
Definition: AT25SF161.h:54
#define AT25SF161_PAGE_SIZE
Definition: AT25SF161.h:47
#define AT25SF161_SECTOR_SIZE
Definition: AT25SF161.h:45
#define AT25SF161_SR_BUSY
AT25SF161 Registers.
Definition: AT25SF161.h:116
#define SECTOR_ERASE_CMD
Definition: AT25SF161.h:95
QSPI_StatusTypeDef BSP_QSPI_Erase_Chip(void)
Erases the entire QSPI memory.
Definition: flash.cpp:391
QSPI_StatusTypeDef BSP_QSPI_EnableMemoryMappedMode(void)
Configure the QSPI in memory-mapped mode.
Definition: flash.cpp:541
QSPI_StatusTypeDef
Definition: flash.h:64
@ QSPI_RESET
Definition: flash.h:73
@ QSPI_TIMEOUT
Definition: flash.h:69
@ QSPI_OK
Definition: flash.h:66
@ QSPI_READY
Definition: flash.h:72
@ QSPI_ERROR
Definition: flash.h:67
@ QSPI_NOT_SUPPORTED
Definition: flash.h:70
@ QSPI_BUSY
Definition: flash.h:68
@ QSPI_KO_INIT
Definition: flash.h:65
@ QSPI_SUSPENDED
Definition: flash.h:71
QSPI_StatusTypeDef BSP_QSPI_DeInit(void)
De-Initializes the QSPI interface.
Definition: flash.cpp:171
QSPI_StatusTypeDef BSP_QSPI_ReadStatus(uint32_t *Reg)
Reads current full status registers (byte1 and 2) of the QSPI memory.
Definition: flash.cpp:425
Flash()
Definition: flash.cpp:95
uint8_t BSP_QSPI_ResumeErase(void)
This function resumes a paused erase command.
Definition: flash.cpp:624
QSPI_StatusTypeDef BSP_QSPI_GetInfo(QSPI_Info *pInfo)
Return the configuration of the QSPI memory.
Definition: flash.cpp:527
QSPI_StatusTypeDef QSPI_DisableContinuousMode(void)
This function disable Continuous Read Mode Reset - Quad.
Definition: flash.cpp:966
QSPI_StatusTypeDef QSPI_SetDeepPowerDown(void)
This function enter in deep power down the QSPI memory.
Definition: flash.cpp:744
QSPI_StatusTypeDef QSPI_ExitDeepPowerDown(void)
This function exit from deep power down the QSPI memory.
Definition: flash.cpp:764
QSPI_StatusTypeDef BSP_QSPI_DisableMemoryMappedMode(void)
Disable the QSPI memory-mapped mode.
Definition: flash.cpp:573
QSPI_StatusTypeDef BSP_QSPI_Init(void)
Initializes the QSPI interface.
Definition: flash.cpp:109
QSPI_StatusTypeDef BSP_QSPI_Read(uint8_t *pData, uint32_t ReadAddr, uint32_t Size)
Reads an amount of data from the QSPI memory.
Definition: flash.cpp:207
QSPI_StatusTypeDef BSP_QSPI_Transmit(uint8_t *pData, uint32_t Timeout)
Transmit an amount of data in interrupt mode.
Definition: flash.cpp:685
QSPI_StatusTypeDef QSPI_DummyCyclesCfg(void)
This function configure the dummy cycles on memory side.
Definition: flash.cpp:823
static QSPI_IT_EventFlag * _evtFlag
Definition: flash.h:138
QSPI_StatusTypeDef BSP_QSPI_WaitingForEvent(uint32_t Timeout)
Waiting event for QSPI Module.
Definition: flash.cpp:716
QSPI_StatusTypeDef BSP_QSPI_AutoPolling(QSPI_CommandTypeDef *cmd, QSPI_AutoPollingTypeDef *cfg, uint32_t Timeout)
Configure the QSPI Automatic Polling Mode in interrupt mode.
Definition: flash.cpp:702
QSPI_StatusTypeDef BSP_QSPI_Receive(uint8_t *pData, uint32_t Timeout)
Receive an amount of data in interrupt mode.
Definition: flash.cpp:669
QSPI_StatusTypeDef BSP_QSPI_Erase_Sector(uint32_t Sector)
Erases the specified sector of the QSPI memory.
Definition: flash.cpp:353
QSPI_StatusTypeDef QSPI_WriteEnableVolat(void)
This function enable the write for Volatile Status Register only.
Definition: flash.cpp:874
QSPI_StatusTypeDef QSPI_AutoPollingMemReady(uint32_t Timeout)
This function read the SR of the memory and wait the EOP.
Definition: flash.cpp:987
QSPI_StatusTypeDef BSP_QSPI_Write(uint8_t *pData, uint32_t WriteAddr, uint32_t Size)
Writes an amount of data to the QSPI memory.
Definition: flash.cpp:245
QSPI_StatusTypeDef QSPI_WriteEnable(void)
This function set Write Enable Latch bit and wait it is effective.
Definition: flash.cpp:894
static QSPI_Info _FlashInfo
Definition: flash.h:137
QSPI_StatusTypeDef QSPI_WriteDisable(void)
This function clear Write Enable Latch bit and wait it is effective.
Definition: flash.cpp:930
QSPI_StatusTypeDef QSPI_ResetMemory(void)
This function reset the QSPI memory.
Definition: flash.cpp:784
QSPI_StatusTypeDef BSP_QSPI_WriteStatus(uint32_t Reg)
Write status registers of the QSPI memory.
Definition: flash.cpp:469
QSPI_StatusTypeDef BSP_QSPI_Erase_Block(uint32_t BlockAddress)
Erases the specified block of the QSPI memory.
Definition: flash.cpp:312
QSPI_StatusTypeDef BSP_QSPI_GetStatus(void)
Reads current status (RDY/BUSY, WEL and SUS bits) of the QSPI memory.
Definition: flash.cpp:509
uint8_t BSP_QSPI_SuspendErase(void)
This function suspends an ongoing erase command.
Definition: flash.cpp:586
QSPI_HandleTypeDef * _hqspi
Definition: flash.h:136
void QUADSPI_IRQHandler(void)
This function handles QUADSPI global interrupt.
Definition: flash.cpp:36
void HAL_QSPI_TxCpltCallback(QSPI_HandleTypeDef *hqspi)
Tx Transfer completed callback.
Definition: flash.cpp:77
void HAL_QSPI_StatusMatchCallback(QSPI_HandleTypeDef *hqspi)
Status Match callback.
Definition: flash.cpp:86
void HAL_QSPI_CmdCpltCallback(QSPI_HandleTypeDef *hqspi)
Command completed callback.
Definition: flash.cpp:61
void HAL_QSPI_RxCpltCallback(QSPI_HandleTypeDef *hqspi)
Rx Transfer completed callback.
Definition: flash.cpp:69
void HAL_QSPI_ErrorCallback(QSPI_HandleTypeDef *hqspi)
Transfer Error callback.
Definition: flash.cpp:52
Flash::QSPI_IT_EventFlag QSPI_IRQ_Flag
Definition: flash.cpp:48
flash QSPI ETH452 AT256F161 header file
Interface STM32 hardware_hal STIMAV4 Header config.
__IO QSPI_StatusTypeDef State
Definition: flash.h:98
uint32_t ProgPageSize
Definition: flash.h:95
uint32_t FlashSize
Definition: flash.h:92
uint32_t EraseBlockNumber
Definition: flash.h:94
uint32_t ProgPagesNumber
Definition: flash.h:96
uint32_t StatusRegister
Definition: flash.h:97
uint32_t EraseBlockSize
Definition: flash.h:93
struct Flash::QSPI_IT_EventFlag::@2 flagBit