CM_BURNFUZE.c 652 B

1234567891011121314151617181920212223242526272829303132333435
  1. // Burn Fuze
  2. //
  3. // CryptoMemory Library Include Files
  4. #include "CM_LIB.h"
  5. #include "CM_I2C.h"
  6. #include "CM_I2C_L.h"
  7. #include <stdint.h>
  8. #include <stdio.h>
  9. uint8_t ucCmdWrFuze[4] = {0xb4, 0x01, 0x00, 0x00};
  10. // Burn Fuse
  11. uint8_t cm_BurnFuse(uint8_t ucFuze)
  12. {
  13. uint8_t ucReturn;
  14. // Burn Fuze
  15. ucCmdWrFuze[2] = ucFuze;
  16. if((ucReturn = CM_LOW_LEVEL.SendCommand(ucCmdWrFuze))!= SUCCESS)
  17. {
  18. printf("---> cm_BurnFuse log1\n");
  19. return ucReturn;
  20. }
  21. // done
  22. ucReturn = CM_LOW_LEVEL.ReceiveRet(NULL,0);
  23. if(ucReturn != SUCCESS)
  24. {
  25. printf("---> cm_BurnFuse log2\n");
  26. return ucReturn;
  27. }
  28. return SUCCESS;
  29. }