diff options
author | Nick Brassel <nick@tzarc.org> | 2022-06-08 09:42:35 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-08 09:42:35 +1000 |
commit | 1085500e894d9d31c4e97e7f1b74091bb9043a91 (patch) | |
tree | 83b8b73f034503c97238e6c65a0dc81e6bc78639 /platforms/chibios/drivers/eeprom/eeprom_stm32.h | |
parent | 6df5fce0732df5cf15f7c388040e6dadbaa476b0 (diff) |
Rework paths for eeprom locations. (#17326)
* Rework paths for eeprom locations.
* File relocation.
* Wrong file move.
* Fixup test paths.
Diffstat (limited to 'platforms/chibios/drivers/eeprom/eeprom_stm32.h')
-rw-r--r-- | platforms/chibios/drivers/eeprom/eeprom_stm32.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/platforms/chibios/drivers/eeprom/eeprom_stm32.h b/platforms/chibios/drivers/eeprom/eeprom_stm32.h new file mode 100644 index 0000000000..8fcfb556b8 --- /dev/null +++ b/platforms/chibios/drivers/eeprom/eeprom_stm32.h @@ -0,0 +1,33 @@ +/* + * This software is experimental and a work in progress. + * Under no circumstances should these files be used in relation to any critical system(s). + * Use of these files is at your own risk. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * This files are free to use from http://engsta.com/stm32-flash-memory-eeprom-emulator/ by + * Artur F. + * + * Modifications for QMK and STM32F303 by Yiancar + * + * This library assumes 8-bit data locations. To add a new MCU, please provide the flash + * page size and the total flash size in Kb. The number of available pages must be a multiple + * of 2. Only half of the pages account for the total EEPROM size. + * This library also assumes that the pages are not used by the firmware. + */ + +#pragma once + +uint16_t EEPROM_Init(void); +void EEPROM_Erase(void); +uint8_t EEPROM_WriteDataByte(uint16_t Address, uint8_t DataByte); +uint8_t EEPROM_WriteDataWord(uint16_t Address, uint16_t DataWord); +uint8_t EEPROM_ReadDataByte(uint16_t Address); +uint16_t EEPROM_ReadDataWord(uint16_t Address); + +void print_eeprom(void); |