CM_I2C_L.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // CryptoMemory I2C Very Low Level Header File
  2. //
  3. // This library is used in all of the low level hardware interface for I2C communications.
  4. //
  5. // Revision Date Changes
  6. // -------- --------- -----------------------------------------------------------------
  7. // 0.1 07 Nov 04 First Release
  8. // Protect Library against multiple inclusion
  9. #ifndef CM_I2C_L_H
  10. #define CM_I2C_L_H
  11. // -------------------------------------------------------------------------------------------------
  12. // Other includes required by this header file
  13. // -------------------------------------------------------------------------------------------------
  14. #include "CM_LIB.h"
  15. #include "CM_I2C.h"
  16. #define CM_PWRON_CLKS (15)
  17. // Constants used in low level functions
  18. // Power on clocks (spec call for 5, but California Card uses 15)
  19. // Mid-Level Functions
  20. uint8_t cm_ReadCommand(uint8_t * pucInsBuff, uint8_t * pucRetVal, uint8_t ucLen);
  21. uint8_t cm_WriteCommand(uint8_t * pucInsBuff, uint8_t * pucSendVal, uint8_t ucLen);
  22. // Functions in CM_I2C.C used internally by other low level functions
  23. void cm_Clockhigh(void);
  24. void cm_Clocklow(void);
  25. void cm_ClockCycle(void);
  26. void cm_ClockCycles(uint8_t ucCount);
  27. void cm_Start(void);
  28. void cm_Stop(void);
  29. uint8_t cm_Write(uint8_t ucData);
  30. void cm_Ack(void);
  31. void cm_N_Ack(void);
  32. uint8_t cm_Read(void);
  33. void cm_WaitClock(uint8_t loop);
  34. uint8_t cm_SendCommand(uint8_t * pucInsBuff);
  35. uint8_t cm_ReceiveRet(uint8_t * pucRecBuf, uint8_t ucLen);
  36. uint8_t cm_SendDat(uint8_t * pucSendBuf, uint8_t ucLen);
  37. void cm_RandomGen(uint8_t * pucRanddat);
  38. void cm_Delay(uint8_t ucDelay);
  39. // end of multiple inclusion protection
  40. #endif