ВходНаше всё Теги codebook 无线电组件 Поиск Опросы Закон Четверг
21 ноября
412058 Топик полностью
SciFi (24.05.2013 12:23, просмотров: 362) ответил Vladimir Ljaschko на А в чем проблема формата? Разве как union структуры EEPROM с массивом не катит? Размер подгоняется под размер блоков флэша, и все. Или?
Если бы всё было так просто. 
/**
 * @file  eeprom.c
 * @brief EEPROM Emulation
 *
 * Stored data format description follows.
 * First 4 bytes of sector: magic value.
 * Byte 5 - active sector marker 0x5A.
 * Byte 6 - closed sector marker 0xA5.
 * Stored data is contained in byte 7 and onwards.
 * Data is written in 4-bit records (nibbles). Init code replays stored
 * data by interpreting the nibbles one by one and writing into RAM mirror
 * accordingly. The interpreter maintains 'RAM cursor' that can be moved by
 * instructions in stored data.
 * If 4 <= nibble <= 11, then (nibble - 3) nibbles of literal data follow,
 * that is between 1 and 8 nibbles.
 * If 0 <= nibble <= 3, then RAM cursor is moved (2 * nibble + 2) positions back
 * and (2 * nibble + 2) nibbles of data follow, that is between 2 and 8 nibbles.
 * If 12 <= nibble <= 14, then (nibble - 11) nibbles of RAM cursor movement
 * instructions follow. The instruction is a signed number, MSB first. The
 * cursor is moved the according number of positions forward or back.
 * When nibble = 15, the meaning depends on whether the nibble is first (LSB)
 * or second (MSB) in byte. If it's first, this means end of data. If it's
 * second, this means more data follow.
 */
ส็็็็็็็็็็็็็็็็็็็็็็็็็༼ ຈل͜ຈ༽ส้้้้้้้้้้้้้้้้้้้้้้้