-
-
Notifications
You must be signed in to change notification settings - Fork 76
/
ee.h
98 lines (73 loc) · 2.97 KB
/
ee.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#ifndef _EE_H_
#define _EE_H_
/***********************************************************************************************************
Author: Nima Askari
Github: https://www.github.com/NimaLTD
LinkedIn: https://www.linkedin.com/in/nimaltd
Youtube: https://www.youtube.com/@nimaltd
Instagram: https://instagram.com/github.NimaLTD
Version: 3.2.2
History:
3.2.2
- Fixed Erasing L0, L1, Series
3.2.1
- Fixed Selecting BANK for STM32W Series
3.2.0
- Added Manual Configuration
3.1.3
- Fixed L0, L1 configuration
3.1.2
- Fixed H5 configuration
3.1.1
- Fixed formatting F4
3.1.0
- Added Verify after Writing
- Added Checking Pointer in Reading/Writing
- Removed erasing buffer and formating before write
3.0.2
- Fixed Writing for H7B
3.0.1
- Added comments
3.0.0
- Rewrite again
- Support STM32CubeMx Packet installer
***********************************************************************************************************/
#ifdef __cplusplus
extern "C"
{
#endif
/************************************************************************************************************
************** Include Headers
************************************************************************************************************/
#include <stdbool.h>
#include "main.h"
/************************************************************************************************************
************** Public Definitions
************************************************************************************************************/
// none
/************************************************************************************************************
************** Public struct/enum
************************************************************************************************************/
typedef struct
{
uint8_t *pData;
uint32_t Size;
uint32_t PageSectorSize;
uint32_t Address;
uint8_t PageSectorNumber;
#if (defined FLASH_BANK_1) || (defined FLASH_BANK_2)
uint8_t BankNumber;
#endif
} EE_HandleTypeDef;
/************************************************************************************************************
************** Public Functions
************************************************************************************************************/
bool EE_Init(void *pData, uint32_t Size);
uint32_t EE_Capacity(void);
bool EE_Format(void);
void EE_Read(void);
bool EE_Write(void);
#ifdef __cplusplus
}
#endif
#endif