Приведение примеров eeprom
This commit is contained in:
1 parent
c9f5563111
commit
52adac2b59
10 files changed
+88
-32
No files matched your search
@@ -16,7 +16,7 @@ void EEPROMClass:: begin()
|
||||
HAL_EEPROM_CalculateTimings(&heeprom, OSC_SYSTEM_VALUE);
|
||||
}
|
||||
|
||||
uint8_t EEPROMClass:: read( int idx )
|
||||
uint8_t read( int idx )
|
||||
{
|
||||
// Проверка адекватности адреса idx
|
||||
if (idx < 0)
|
||||
@@ -40,7 +40,7 @@ uint8_t EEPROMClass:: read( int idx )
|
||||
return (uint8_t)(( read_data_buf[word_idx] & (((uint32_t)0xFF) << ((EEPROM_WORD_SIZE - byte_idx - 1) * 8)) ) >> ((EEPROM_WORD_SIZE - byte_idx - 1) * 8));
|
||||
}
|
||||
|
||||
void EEPROMClass:: write( int idx, uint8_t val )
|
||||
void write( int idx, uint8_t val )
|
||||
{
|
||||
// Проверка адекватности адреса idx
|
||||
if (idx < 0)
|
||||
@@ -72,7 +72,7 @@ void EEPROMClass:: write( int idx, uint8_t val )
|
||||
}
|
||||
|
||||
// Делает то же, что и write, но записывает только если новый байт отличается от уже записанного
|
||||
void EEPROMClass:: update( int idx, uint8_t val )
|
||||
void update( int idx, uint8_t val )
|
||||
{
|
||||
// Проверка адекватности адреса idx
|
||||
if (idx < 0)
|
||||
@@ -107,10 +107,10 @@ void EEPROMClass:: update( int idx, uint8_t val )
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t EEPROMClass:: length( void )
|
||||
{
|
||||
return (uint16_t)EEPROM_LENGHT;
|
||||
}
|
||||
// uint16_t EEPROMClass:: length( void )
|
||||
// {
|
||||
// return (uint16_t)EEPROM_LENGHT;
|
||||
// }
|
||||
|
||||
void HAL_read(uint16_t addr, uint32_t * data)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user