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