px-fwlib 0.10.0
Cross-platform embedded library and documentation for 8/16/32-bit microcontrollers generated with Doxygen 1.9.2
px_eeprom.h
1#ifndef __PX_EEPROM_H__
2#define __PX_EEPROM_H__
3/* =============================================================================
4 ____ ___ ____ ___ _ _ ___ __ __ ___ __ __ TM
5 | _ \ |_ _| / ___| / _ \ | \ | | / _ \ | \/ | |_ _| \ \/ /
6 | |_) | | | | | | | | | | \| | | | | | | |\/| | | | \ /
7 | __/ | | | |___ | |_| | | |\ | | |_| | | | | | | | / \
8 |_| |___| \____| \___/ |_| \_| \___/ |_| |_| |___| /_/\_\
9
10 Copyright (c) 2018 Pieter Conradie <https://piconomix.com>
11
12 License: MIT
13 https://github.com/piconomix/px-fwlib/blob/master/LICENSE.md
14
15 Title: px_eeprom.h : Internal EEPROM write routines
16 Author(s): Pieter Conradie
17 Creation Date: 2018-11-21
18
19============================================================================= */
20
21/**
22 * @ingroup STM32
23 * @defgroup STM32_EEPROM px_eeprom.h : Internal EEPROM write routines
24 *
25 * This module can erase a page and write a half page of internal EEPROM.
26 *
27 * File(s):
28 * - arch/arm/stm32/inc/px_eeprom.h
29 * - arch/arm/stm32/src/px_eeprom.c
30 *
31 * @note
32 * The flash erase and program functions must be executed from SRAM, not EEPROM.
33 *
34 * @{
35 */
36
37/* _____STANDARD INCLUDES____________________________________________________ */
38
39/* _____PROJECT INCLUDES_____________________________________________________ */
40#include "px_defs.h"
41#include "px_stm32cube.h"
42
43#ifdef __cplusplus
44extern "C" {
45#endif
46/* _____DEFINITIONS__________________________________________________________ */
47/// Start address of EEPROM
48#define PX_EEPROM_BASE_ADR DATA_EEPROM_BASE
49
50/* _____GLOBAL FUNCTION DECLARATIONS_________________________________________ */
51/**
52 * Unlock EEPROM for programming and erase.
53 *
54 */
55void px_eeprom_unlock(void);
56
57/**
58 * Lock EEPROM to prevent programming or erase.
59 *
60 */
61void px_eeprom_lock(void);
62
63/**
64 * Function to erase a word (not really required).
65 *
66 * @param address Page address
67 */
68void px_eeprom_erase_word(const uint32_t address);
69
70/* _____MACROS_______________________________________________________________ */
71
72#ifdef __cplusplus
73}
74#endif
75
76/// @}
77#endif
void px_eeprom_lock(void)
Lock EEPROM to prevent programming or erase.
Definition: px_eeprom.c:55
void px_eeprom_unlock(void)
Unlock EEPROM for programming and erase.
Definition: px_eeprom.c:40
void px_eeprom_erase_word(const uint32_t address)
Function to erase a word (not really required).
Definition: px_eeprom.c:69