Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef EEPROM_WL_H
00019 #define EEPROM_WL_H
00020
00021 #include "config-params.h"
00022
00050 #define EE_PARAM_BUFFER_SIZE (8)
00051 #define EE_STATUS_BUFFER_SIZE EE_PARAM_BUFFER_SIZE
00052
00055 #define EE_BYTE_SIZE (1)
00056 #define EE_WORD_SIZE (2)
00057 #define EE_DWORD_SIZE (4)
00058
00062 #define EE_STATIC_PARAM_1 (0)
00063 #define EE_STATIC_PARAM_2 (EE_STATIC_PARAM_1 + EE_STATIC_PARAM_1_SIZE)
00064 #define EE_STATIC_PARAM_3 (EE_STATIC_PARAM_2 + EE_STATIC_PARAM_2_SIZE)
00065 #define EE_STATIC_PARAM_4 (EE_STATIC_PARAM_3 + EE_STATIC_PARAM_3_SIZE)
00066 #define EE_STATIC_PARAM_5 (EE_STATIC_PARAM_4 + EE_STATIC_PARAM_4_SIZE)
00067 #define EE_STATIC_PARAM_6 (EE_STATIC_PARAM_5 + EE_STATIC_PARAM_5_SIZE)
00068 #define EE_STATIC_PARAM_7 (EE_STATIC_PARAM_6 + EE_STATIC_PARAM_6_SIZE)
00069 #define EE_STATIC_PARAM_LAST (EE_STATIC_PARAM_7 + EE_STATIC_PARAM_7_SIZE)
00070
00073 #define EE_PARAM_BUFFER_START (64)
00074
00077 #define EE_PARAM_1 EE_PARAM_BUFFER_START
00078 #define EE_PARAM_2 (EE_PARAM_1 + EE_PARAM_1_SIZE * EE_PARAM_BUFFER_SIZE + EE_STATUS_BUFFER_SIZE)
00079 #define EE_PARAM_3 (EE_PARAM_2 + EE_PARAM_2_SIZE * EE_PARAM_BUFFER_SIZE + EE_STATUS_BUFFER_SIZE)
00080 #define EE_PARAM_4 (EE_PARAM_3 + EE_PARAM_3_SIZE * EE_PARAM_BUFFER_SIZE + EE_STATUS_BUFFER_SIZE)
00081 #define EE_PARAM_5 (EE_PARAM_4 + EE_PARAM_4_SIZE * EE_PARAM_BUFFER_SIZE + EE_STATUS_BUFFER_SIZE)
00082 #define EE_PARAM_6 (EE_PARAM_5 + EE_PARAM_5_SIZE * EE_PARAM_BUFFER_SIZE + EE_STATUS_BUFFER_SIZE)
00083 #define EE_PARAM_7 (EE_PARAM_6 + EE_PARAM_6_SIZE * EE_PARAM_BUFFER_SIZE + EE_STATUS_BUFFER_SIZE)
00084 #define EE_PARAM_LAST (EE_PARAM_7 + EE_PARAM_7_SIZE * EE_PARAM_BUFFER_SIZE + EE_STATUS_BUFFER_SIZE)
00085
00087 #if (EE_STATIC_PARAM_LAST + EE_STATIC_PARAM_LAST_SIZE) > EE_PARAM_BUFFER_START
00088 #error "Memory space needed for static config parameters exceeds reserved size!"
00089 #endif
00090
00091 #if EE_PARAM_LAST > E2END
00092 #error "Memory space needed for config parameters exceeds size of EEPROM!"
00093 #endif
00094
00099 #define EE_ECHO (1)
00100
00103 #define EE_WRITE (1)
00104
00106 typedef uint8_t * ee_addr_t;
00107
00118 uint8_t read_config_byte (ee_addr_t parameter, ee_addr_t *address);
00119 uint16_t read_config_word (ee_addr_t parameter, ee_addr_t *address);
00120 uint32_t read_config_dword (ee_addr_t parameter, ee_addr_t *address);
00121
00132 void write_config_byte (ee_addr_t parameter, ee_addr_t *address, uint8_t data);
00133 void write_config_word (ee_addr_t parameter, ee_addr_t *address, uint16_t data);
00134 void write_config_dword (ee_addr_t parameter, ee_addr_t *address, uint32_t data);
00135
00136
00143 void ee_find_current_buffer_address (ee_addr_t parameter, ee_addr_t *EeBufPtr, uint8_t param_size);
00144
00151 void ee_read_buffer (ee_addr_t address, void *data, uint8_t param_size);
00152
00158 void ee_write_byte (ee_addr_t address, uint8_t data);
00159
00167 void ee_write_buffer (ee_addr_t parameter, ee_addr_t *address, void *data, uint8_t param_size);
00168
00169 #endif