CM_DATA.c 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Data and Configuration for the CryptoMemory Library
  2. #include "CM_LIB.h"
  3. #include "CM_I2C.h"
  4. // Data Structures that configure the low level CryptoMemory functions
  5. // CryptoMemory Low Level Linkage
  6. //
  7. cm_low_level CM_LOW_LEVEL = {
  8. cm_TRUE, // Carddetect
  9. cm_PowerOff, // PowerOff
  10. cm_PowerOn, // PowerOn
  11. cm_SendCommand, // SendCommand
  12. cm_ReceiveData, // ReceiveRet
  13. cm_SendData, // SendData
  14. cm_RandGen, // RandomGen
  15. cm_WaitClock, // WaitClock
  16. cm_SendCmdByte // SendCmdByte
  17. };
  18. // CryptoMemory Low Level Configuration
  19. //
  20. // Note: the port address is included in a manner that does not require a chip
  21. // specific header file. Note, the address of the port is the LAST address
  22. // of the group of three addresses of the port (the port output register).
  23. //
  24. cm_port_cfg CM_PORT_CFG = {
  25. 0xb0, // ucChipSelect (0xb0 is default address for CryptoMemory)
  26. 0x32, // ucClockPort (0x32 is PORTD)
  27. 0, // ucClockPin (SCL on bit 0)
  28. 0x32, // ucDataPort (0x32 is PORTD)
  29. 2, // ucDataPin (SDA on bit 2)
  30. 0x32, // ucCardSensePort (0x32 is PORTD)
  31. 1, // ucCardSensePin (card sense switch, if any, on bit 2)
  32. TRUE, // ucCardSensePolarity (TRUE -> "1" on bit in register means card is inserted)
  33. 0x32, // ucPowerPort (0x32 is PORTD)
  34. 3, // ucPowerPin (power control, if any, on bit 3)
  35. TRUE, // ucPowerPolarity (TRUE -> "1" on bit in register supplies power)
  36. 100, // ucDelayCount
  37. 10 // ucStartTries
  38. };