From 2b58fbceb40aaa5eacd1c2bb03da62dc97250794 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nima=20Askari=20-----=20=D9=86=DB=8C=D9=85=D8=A7=20=D8=B9?= =?UTF-8?q?=D8=B3=DA=A9=D8=B1=DB=8C?= Date: Sat, 11 Jan 2020 12:27:06 +0330 Subject: [PATCH] Add files via upload --- README.md | 23 +++++++++-------------- eeprom.c | 2 +- eeprom.h | 25 +++++++++++++++++++++++++ eepromConfig.h | 12 ++++++------ 4 files changed, 41 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index b0e80ff..2901087 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,13 @@ # EEPROM emulation STM32 series library -
-I hope use it and enjoy. -
-I use Stm32f103C8 and Keil Compiler and Stm32CubeMX wizard. -
- I only test On this chip yet. -
-Please Do This ... -
-
-1) Select "General peripheral Initalizion as a pair of '.c/.h' file per peripheral" on project settings. -
-2) Config your EEPROMConfig.h file. -
+* http://www.github.com/NimaLTD +* https://www.instagram.com/github.nimaltd/ +* https://www.youtube.com/channel/UCUhY7qY1klJm1d2kulr9ckw +This is the EEPROM emulation STM32 HAL Library + +How to use this Library: +* Select "General peripheral Initalizion as a pair of '.c/.h' file per peripheral" on project settings. +* Include Header and source into your project. +* Config "EepromConfig.h". diff --git a/eeprom.c b/eeprom.c index 407c1f9..02bc314 100644 --- a/eeprom.c +++ b/eeprom.c @@ -37,7 +37,7 @@ #if (_EEPROM_F030x4_F030x6_F070x6_F030x8==1) #define _EEPROM_FLASH_PAGE_SIZE 1024 /* Base address of the Flash sectors */ -#define ADDR_FLASH_PAGE_0 ((uint32_t)0x08000000) /* Base @ of Page 0, 2 Kbytes */ +#define ADDR_FLASH_PAGE_0 ((uint32_t)0x08000000) /* Base @ of Page 0, 1 Kbytes */ #define _EEPROM_FLASH_PAGE_ADDRESS (ADDR_FLASH_PAGE_0|(_EEPROM_FLASH_PAGE_SIZE*_EEPROM_USE_FLASH_PAGE)) #if (_EEPROM_USE_FLASH_PAGE>63) #error "Please Enter currect value _EEPROM_USE_FLASH_PAGE (0 to 63)" diff --git a/eeprom.h b/eeprom.h index d2af508..ea444e0 100644 --- a/eeprom.h +++ b/eeprom.h @@ -1,6 +1,27 @@ #ifndef __EEPROM_H #define __EEPROM_H +/* + Author: Nima Askari + WebSite: http://www.github.com/NimaLTD + Instagram: http://instagram.com/github.NimaLTD + Youtube: https://www.youtube.com/channel/UCUhY7qY1klJm1d2kulr9ckw + + Version: 1.1.0 + + + Reversion History: + (1.1.0) + Add f0 devices. + + (1.0.0) + First Release. + +*/ +#ifdef __cplusplus + extern "C" { +#endif + #include #include "gpio.h" @@ -14,4 +35,8 @@ bool EE_Writes(uint16_t StartVirtualAddress,uint16_t HowMuchToWrite,uint32_t* uint16_t EE_GetSize(void); //################################################################################################################ +#ifdef __cplusplus +} +#endif + #endif diff --git a/eepromConfig.h b/eepromConfig.h index 1f6073a..f0ca836 100644 --- a/eepromConfig.h +++ b/eepromConfig.h @@ -1,13 +1,13 @@ #ifndef __EEPROMCONFIG_H #define __EEPROMCONFIG_H -#define _EEPROM_AUTO_ERASE___NEED_MORE_RAM (0) // store old data +#define _EEPROM_AUTO_ERASE___NEED_MORE_RAM (0) // store old data -#define _EEPROM_F030x4_F030x6_F070x6_F030x8 (1) -#define _EEPROM_F1_LOW_DESTINY (0) -#define _EEPROM_F1_MEDIUM_DESTINY (0) -#define _EEPROM_F1_HIGH_DESTINY (0) +#define _EEPROM_F030x4_F030x6_F070x6_F030x8 (1) +#define _EEPROM_F1_LOW_DESTINY (0) +#define _EEPROM_F1_MEDIUM_DESTINY (0) +#define _EEPROM_F1_HIGH_DESTINY (0) -#define _EEPROM_USE_FLASH_PAGE (31) +#define _EEPROM_USE_FLASH_PAGE (15) #endif