main.c 754 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #include <stdarg.h>
  2. #include "yc11xx.h"
  3. #include "ycdef.h"
  4. #include "yc11xx_uart.h"
  5. #include "yc11xx_gpio.h"
  6. #include "yc11xx_qspi.h"
  7. #include "system.h"
  8. uint8_t test_data[16]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
  9. void QSPI_TEST();
  10. void QSPI_TEST()
  11. {
  12. uint8_t Rdbuf[16];
  13. memset(Rdbuf,0,16);
  14. uint32_t ID=0;
  15. int i=10000;
  16. while(i--);
  17. ID=qspi_flash_ManufactureID();
  18. MyPrintf("\r\n ID=%x \r\n",ID);
  19. QSPI_SectorEraseFlash(0x7f000);
  20. QSPI_WriteFlashData(0x7f000,16,test_data);
  21. QSPI_ReadFlashData(0x7f000,16,Rdbuf);
  22. for(int i=0;i<16;i++)
  23. {
  24. MyPrintf("Rdbuf[%d]=%d \r\n",i,Rdbuf[i]);
  25. }
  26. }
  27. int main(void)
  28. {
  29. #ifdef DEBUG_QSPI
  30. printport_init();
  31. MyPrintf("\r\n**********This is QSPI Test Demo**********\r\n");
  32. #endif
  33. QSPI_TEST();
  34. }