1234567891011121314151617181920212223242526272829303132333435 |
-
- #include "CM_LIB.h"
- #include "CM_I2C.h"
- #include "CM_I2C_L.h"
- #include "CM_GPA.h"
- char cm_WriteLargeZone(uint32_t uiCryptoAddr, uint8_t* pucBuffer, uint8_t ucCount)
- {
- uint8_t ucReturn;
-
- ucCM_InsBuff[0] = 0xb0;
- ucCM_InsBuff[1] = (uint8_t)(uiCryptoAddr>>8);
- ucCM_InsBuff[2] = (uint8_t)uiCryptoAddr;
- ucCM_InsBuff[3] = ucCount;
-
- cm_GPAcmd3(ucCM_InsBuff);
-
-
- cm_GPAencrypt(ucCM_Encrypt, pucBuffer, ucCount);
- ucReturn = cm_WriteCommand(ucCM_InsBuff, pucBuffer, ucCount);
-
- if (ucCM_AntiTearing) CM_LOW_LEVEL.WaitClock(100);
-
- return ucReturn;
- }
|