| Remote Access Control | |||||
00001 // This file has been prepared for Doxygen automatic documentation generation. 00051 #ifndef MEMORY_H 00052 #define MEMORY_H 00053 00054 #include "common.h" 00055 #include "config.h" 00056 00057 00058 00059 /* --- EEPROM memory contents --- */ 00060 00061 // Due to placement at absolute addresses, these variables 00062 // are defined in the header file without external declaration. 00063 // This means that every translation unit will have its own 00064 // copy of the variable, but since they occupy the same place in 00065 // memory, it doesn't give any extra memory usage. 00066 00068 __no_init SERIAL_NO_TYPE __eeprom serialNo @ SERIAL_NO_ADDRESS; 00070 __no_init SEQ_COUNTER_TYPE __eeprom nextCounterValue @ SEQ_COUNTER_ADDRESS; 00071 00073 __no_init byte __eeprom secretKey[ KEY_SIZE ] @ SECRET_KEY_ADDRESS; 00075 __no_init byte __eeprom sharedKey[ KEY_SIZE ] @ SHARED_KEY_ADDRESS; 00076 00077 00078 00079 /* --- SRAM memory contents --- */ 00080 00082 extern byte cryptoBlock[ BLOCK_SIZE + 1 ]; // Leave room for one appended end byte when using this buffer to transmit MAC bytes. 00083 00085 struct MessagePayload 00086 { 00087 byte preamble; 00088 SERIAL_NO_TYPE serialNo; 00089 SEQ_COUNTER_TYPE counterValue; 00090 COMMAND_CODE_TYPE commandCode; 00091 }; 00092 00093 union SharedBlock { 00094 struct MessagePayload messagePayload; 00095 byte cryptoBlock[ BLOCK_SIZE ]; 00096 }; 00097 00099 extern union SharedBlock sharedBlock; 00100 00101 00102 00103 /* --- Associated functions --- */ 00104 00105 00106 00108 void initializeMessage(void); 00110 void createMessage( COMMAND_CODE_TYPE commandCode ); 00112 void startCounterUpdate(); 00114 void waitForCounterUpdate(); 00115 00116 00117 00118 #endif 00119
Generated on Fri Aug 8 11:03:16 2008 for AVR411 Secure Rolling Code Algorithm (Transmitter) by 1.4.7
|