1 /**
2   ******************************************************************************
3   * @file    low_level_flash.h
4   * @author  MCD Application Team
5   * @brief   This file contains device definition for low_level_flash driver
6   ******************************************************************************
7   * @attention
8   *
9   * <h2><center>&copy; Copyright (c) 2020-2021 STMicroelectronics.
10   * All rights reserved.</center></h2>
11   *
12   * This software component is licensed by ST under BSD 3-Clause license,
13   * the "License"; You may not use this file except in compliance with the
14   * License. You may obtain a copy of the License at:
15   *                        opensource.org/licenses/BSD-3-Clause
16   *
17   ******************************************************************************
18   */
19 #ifndef __LOW_LEVEL_FLASH_H
20 #define __LOW_LEVEL_FLASH_H
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 #include "stm32hal.h"
26 
27 struct flash_range
28 {
29   uint32_t base;
30   uint32_t limit;
31 };
32 struct flash_vect
33 {
34   uint32_t nb;
35   struct flash_range *range;
36 };
37 struct low_level_device
38 {
39   struct flash_vect erase;
40   struct flash_vect write;
41 #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) && !defined(LOCAL_LOADER_CONFIG)
42   struct flash_vect secure;
43 #endif
44 #if !defined(LOCAL_LOADER_CONFIG)
45   uint32_t read_error;
46 #endif
47 };
48 
49 extern struct low_level_device FLASH0_DEV;
50 
51 #if !defined(LOCAL_LOADER_CONFIG)
52 void NMI_Handler(void);
53 #endif
54 
55 #endif /* __LOW_LEVEL_FLASH_H */
56 
57 
58