main.c 604 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #include <stdarg.h>
  2. #include "yc11xx.h"
  3. #include "yc11xx_gpio.h"
  4. #include "yc11xx_uart.h"
  5. #include "yc_timer.h"
  6. #include "yc_otp.h"
  7. #include "system.h"
  8. #include "btreg.h"
  9. void otp_read_test(void)
  10. {
  11. uint8_t tmp[100];
  12. uint32_t i = 0;;
  13. MyPrintf("tmp=%p\r\n",tmp);
  14. read_otp_data(0x1fe0, tmp, 16);
  15. for (i = 0; i < 16; i++)
  16. {
  17. MyPrintf("%02x ",tmp[i]);
  18. }
  19. }
  20. int main(void)
  21. {
  22. #ifdef DEBUG_OTP
  23. printport_init();
  24. MyPrintf("This is YC11XX otp read demo v1.0. \n");
  25. #endif
  26. SYS_TimerInit();
  27. SYS_delay_ms(100);
  28. OS_ENTER_CRITICAL();
  29. otp_read_test();
  30. OS_EXIT_CRITICAL();
  31. while(1)
  32. {
  33. }
  34. }