Add files via upload
This commit is contained in:
parent
92ee76c3ce
commit
2b58fbceb4
23
README.md
23
README.md
|
@ -1,18 +1,13 @@
|
||||||
# EEPROM emulation STM32 series library
|
# EEPROM emulation STM32 series library
|
||||||
<br />
|
|
||||||
I hope use it and enjoy.
|
|
||||||
<br />
|
|
||||||
I use Stm32f103C8 and Keil Compiler and Stm32CubeMX wizard.
|
|
||||||
<br />
|
|
||||||
I only test On this chip yet.
|
|
||||||
<br />
|
|
||||||
Please Do This ...
|
|
||||||
<br />
|
|
||||||
<br />
|
|
||||||
1) Select "General peripheral Initalizion as a pair of '.c/.h' file per peripheral" on project settings.
|
|
||||||
<br />
|
|
||||||
2) Config your EEPROMConfig.h file.
|
|
||||||
<br />
|
|
||||||
|
|
||||||
|
* 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".
|
||||||
|
|
||||||
|
|
2
eeprom.c
2
eeprom.c
|
@ -37,7 +37,7 @@
|
||||||
#if (_EEPROM_F030x4_F030x6_F070x6_F030x8==1)
|
#if (_EEPROM_F030x4_F030x6_F070x6_F030x8==1)
|
||||||
#define _EEPROM_FLASH_PAGE_SIZE 1024
|
#define _EEPROM_FLASH_PAGE_SIZE 1024
|
||||||
/* Base address of the Flash sectors */
|
/* 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))
|
#define _EEPROM_FLASH_PAGE_ADDRESS (ADDR_FLASH_PAGE_0|(_EEPROM_FLASH_PAGE_SIZE*_EEPROM_USE_FLASH_PAGE))
|
||||||
#if (_EEPROM_USE_FLASH_PAGE>63)
|
#if (_EEPROM_USE_FLASH_PAGE>63)
|
||||||
#error "Please Enter currect value _EEPROM_USE_FLASH_PAGE (0 to 63)"
|
#error "Please Enter currect value _EEPROM_USE_FLASH_PAGE (0 to 63)"
|
||||||
|
|
25
eeprom.h
25
eeprom.h
|
@ -1,6 +1,27 @@
|
||||||
#ifndef __EEPROM_H
|
#ifndef __EEPROM_H
|
||||||
#define __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 <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include "gpio.h"
|
#include "gpio.h"
|
||||||
|
|
||||||
|
@ -14,4 +35,8 @@ bool EE_Writes(uint16_t StartVirtualAddress,uint16_t HowMuchToWrite,uint32_t*
|
||||||
uint16_t EE_GetSize(void);
|
uint16_t EE_GetSize(void);
|
||||||
//################################################################################################################
|
//################################################################################################################
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
#ifndef __EEPROMCONFIG_H
|
#ifndef __EEPROMCONFIG_H
|
||||||
#define __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_F030x4_F030x6_F070x6_F030x8 (1)
|
||||||
#define _EEPROM_F1_LOW_DESTINY (0)
|
#define _EEPROM_F1_LOW_DESTINY (0)
|
||||||
#define _EEPROM_F1_MEDIUM_DESTINY (0)
|
#define _EEPROM_F1_MEDIUM_DESTINY (0)
|
||||||
#define _EEPROM_F1_HIGH_DESTINY (0)
|
#define _EEPROM_F1_HIGH_DESTINY (0)
|
||||||
|
|
||||||
#define _EEPROM_USE_FLASH_PAGE (31)
|
#define _EEPROM_USE_FLASH_PAGE (15)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue
Block a user