|
STM32 core 3.0.1-dev
Arduino core for STM32 based boards: API reference
|
← STM32duino documentation
|
Provides emulated eeprom from flash. More...
Macros | |
| #define | EEPROM_FLASH_PAGE_NUMBER ((uint32_t)(((LL_GetFlashSize() * 1024) / FLASH_PAGE_SIZE) - 1)) |
| Flash bank used for the EEPROM emulation. | |
| #define | FLASH_BASE_ADDRESS ((uint32_t)((FLASH_END + 1) - FLASH_PAGE_SIZE)) |
| Address of the last byte of the flash area used for the EEPROM emulation. | |
Functions | |
| uint8_t | eeprom_read_byte (const uint32_t pos) |
| Read a byte from the emulated EEPROM (flash). | |
| void | eeprom_write_byte (uint32_t pos, uint8_t value) |
| Write a byte to the emulated EEPROM (flash). | |
| uint8_t | eeprom_buffered_read_byte (const uint32_t pos) |
| Read a byte from the EEPROM buffer, flash is not read. | |
| void | eeprom_buffered_write_byte (uint32_t pos, uint8_t value) |
| Write a byte to the EEPROM buffer, flash is not updated. | |
| void | eeprom_buffer_fill (void) |
| Copy the data from flash into the EEPROM buffer. | |
| void | eeprom_buffer_flush (void) |
| Write the EEPROM buffer content into flash. | |
| HAL_FLASH_Lock () | |
Variables | |
| static uint8_t | eeprom_buffer [E2END+1] = {0} |
| RAM copy of the emulated EEPROM, 8 bytes aligned for the flash programming. | |
Provides emulated eeprom from flash.
Copyright (c) 2016-2021, STMicroelectronics All rights reserved.
This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this file except in compliance with the License. You may obtain a copy of the License at: opensource.org/licenses/BSD-3-Clause
| #define EEPROM_FLASH_PAGE_NUMBER ((uint32_t)(((LL_GetFlashSize() * 1024) / FLASH_PAGE_SIZE) - 1)) |
Flash bank used for the EEPROM emulation.
Can be overridden before including this file.
Flash sector used for the EEPROM emulation. Can be overridden before including this file.
Flash page number used for the EEPROM emulation. Can be overridden before including this file.
| #define FLASH_BASE_ADDRESS ((uint32_t)((FLASH_END + 1) - FLASH_PAGE_SIZE)) |
Address of the last byte of the flash area used for the EEPROM emulation.
Can be overridden.
Start address of the flash area used for the EEPROM emulation. Can be overridden.
By default, use the last page of the flash to store data in order to prevent overwriting program data.
| void eeprom_buffer_fill | ( | ) |
Copy the data from flash into the EEPROM buffer.
| void eeprom_buffer_flush | ( | ) |
Write the EEPROM buffer content into flash.
| uint8_t eeprom_buffered_read_byte | ( | const uint32_t | pos | ) |
Read a byte from the EEPROM buffer, flash is not read.
| pos | Address to read. |
| void eeprom_buffered_write_byte | ( | uint32_t | pos, |
| uint8_t | value | ||
| ) |
Write a byte to the EEPROM buffer, flash is not updated.
| pos | Address to write. |
| value | Value to write. |
| uint8_t eeprom_read_byte | ( | const uint32_t | pos | ) |
Read a byte from the emulated EEPROM (flash).
With a real data EEPROM, pos is a relative address and 0 is returned if it is out of range. Otherwise the flash content is first copied into the EEPROM buffer.
| pos | Address to read. |
| void eeprom_write_byte | ( | uint32_t | pos, |
| uint8_t | value | ||
| ) |
Write a byte to the emulated EEPROM (flash).
With a real data EEPROM, pos is a relative address and the write is ignored if it is out of range. Otherwise the byte is written to the EEPROM buffer, then the whole buffer is written into flash.
| pos | Address to write. |
| value | Value to write. |