aboutsummaryrefslogtreecommitdiff
path: root/lib/chibios/os/hal/ports/STM32/STM32L4xx/hal_efl_lld.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chibios/os/hal/ports/STM32/STM32L4xx/hal_efl_lld.h')
-rw-r--r--lib/chibios/os/hal/ports/STM32/STM32L4xx/hal_efl_lld.h116
1 files changed, 116 insertions, 0 deletions
diff --git a/lib/chibios/os/hal/ports/STM32/STM32L4xx/hal_efl_lld.h b/lib/chibios/os/hal/ports/STM32/STM32L4xx/hal_efl_lld.h
new file mode 100644
index 000000000..5ee31c5b6
--- /dev/null
+++ b/lib/chibios/os/hal/ports/STM32/STM32L4xx/hal_efl_lld.h
@@ -0,0 +1,116 @@
1/*
2 ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17/**
18 * @file hal_efl_lld.h
19 * @brief STM32L4xx Embedded Flash subsystem low level driver header.
20 *
21 * @addtogroup HAL_EFL
22 * @{
23 */
24
25#ifndef HAL_EFL_LLD_H
26#define HAL_EFL_LLD_H
27
28#if (HAL_USE_EFL == TRUE) || defined(__DOXYGEN__)
29
30/*===========================================================================*/
31/* Driver constants. */
32/*===========================================================================*/
33
34/*===========================================================================*/
35/* Driver pre-compile time settings. */
36/*===========================================================================*/
37
38/**
39 * @name STM32L4xx configuration options
40 * @{
41 */
42/**
43 * @brief Suggested wait time during erase operations polling.
44 */
45#if !defined(STM32_FLASH_WAIT_TIME_MS) || defined(__DOXYGEN__)
46#define STM32_FLASH_WAIT_TIME_MS 5
47#endif
48/** @} */
49
50/*===========================================================================*/
51/* Derived constants and error checks. */
52/*===========================================================================*/
53
54#if !defined(STM32_FLASH_NUMBER_OF_BANKS)
55#error "STM32_FLASH_NUMBER_OF_BANKS not defined in registry"
56#endif
57
58#if !defined(STM32_FLASH_SECTORS_PER_BANK)
59#error "STM32_FLASH_SECTORS_PER_BANK not defined in registry"
60#endif
61
62/*===========================================================================*/
63/* Driver data structures and types. */
64/*===========================================================================*/
65
66/*===========================================================================*/
67/* Driver macros. */
68/*===========================================================================*/
69
70/**
71 * @brief Low level fields of the embedded flash driver structure.
72 */
73#define efl_lld_driver_fields \
74 /* Flash registers.*/ \
75 FLASH_TypeDef *flash
76
77/**
78 * @brief Low level fields of the embedded flash configuration structure.
79 */
80#define efl_lld_config_fields \
81 /* Dummy configuration, it is not needed.*/ \
82 uint32_t dummy
83
84/*===========================================================================*/
85/* External declarations. */
86/*===========================================================================*/
87
88#if !defined(__DOXYGEN__)
89extern EFlashDriver EFLD1;
90#endif
91
92#ifdef __cplusplus
93extern "C" {
94#endif
95 void efl_lld_init(void);
96 void efl_lld_start(EFlashDriver *eflp);
97 void efl_lld_stop(EFlashDriver *eflp);
98 const flash_descriptor_t *efl_lld_get_descriptor(void *instance);
99 flash_error_t efl_lld_read(void *instance, flash_offset_t offset,
100 size_t n, uint8_t *rp);
101 flash_error_t efl_lld_program(void *instance, flash_offset_t offset,
102 size_t n, const uint8_t *pp);
103 flash_error_t efl_lld_start_erase_all(void *instance);
104 flash_error_t efl_lld_start_erase_sector(void *instance,
105 flash_sector_t sector);
106 flash_error_t efl_lld_query_erase(void *instance, uint32_t *msec);
107 flash_error_t efl_lld_verify_erase(void *instance, flash_sector_t sector);
108#ifdef __cplusplus
109}
110#endif
111
112#endif /* HAL_USE_EFL == TRUE */
113
114#endif /* HAL_EFL_LLD_H */
115
116/** @} */