VSF Documented
flash.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright(C)2009-2022 by VSF Team *
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 flashecific language governing permissions and *
14 * limitations under the License. *
15 * *
16 ****************************************************************************/
17
18#ifndef __HAL_DRIVER_GIGADEVICE_GD32H7XX_FLASH_H__
19#define __HAL_DRIVER_GIGADEVICE_GD32H7XX_FLASH_H__
20
21/*============================ INCLUDES ======================================*/
22
23#include "hal/vsf_hal_cfg.h"
24
25#if VSF_HAL_USE_FLASH == ENABLED
26
27#include "../../__device.h"
28
29/*\note Refer to template/README.md for usage cases.
30 * For peripheral drivers, blackbox mode is recommended but not required, reimplementation part MUST be open.
31 * For IPCore drivers, class structure, MULTI_CLASS configuration, reimplementation and class APIs should be open to user.
32 * For emulated drivers, **** No reimplementation ****.
33 */
34
35/*\note Includes CAN ONLY be put here. */
36
37#ifdef __cplusplus
38extern "C" {
39#endif
40
41/*============================ MACROS ========================================*/
42
43#define VSF_FLASH_CFG_REIMPLEMENT_TYPE_IRQ_MASK ENABLED
44
45/*============================ TYPES =========================================*/
46
48 // 16: EOPIE(16) IN FLASH_CR
50 // 15: EOPIE(16) IN FLASH_CR, shift right by 1 to avoid conflict with VSF_FLASH_IRQ_ERASE_MASK
51 VSF_FLASH_IRQ_WRITE_MASK = (1 << 16) >> 1,
52 // 14
54
55 // 22: OPERRIE(22) IN FLASH_CR
57 // 17..19, 21, 22: WRPERRIE(17), PGSERRIE(18), STRBERRIE(19), INCERRIE(21), OPERRIE(22) IN FLASH_CR
58 VSF_FLASH_IRQ_WRITE_ERROR_MASK = (1 << 17) | (1 << 18) | (1 << 19) | (1 << 21) | (1 << 22),
59 // 23..24: RDPERRIE(23), RDSERRIE(24) IN FLASH_CR
60 VSF_FLASH_IRQ_READ_ERROR_MASK = (1 << 24) | (1 << 23),
61
69
70/*============================ GLOBAL VARIABLES ==============================*/
71/*============================ PROTOTYPES ====================================*/
72
73#ifdef __cplusplus
74}
75#endif
76
77#endif // VSF_HAL_USE_FLASH
78#endif // __HAL_DRIVER_GIGADEVICE_GD32H7XX_FLASH_H__
79/* EOF */
vsf_flash_irq_mask_t
Definition flash.h:47
@ VSF_FLASH_IRQ_ERASE_MASK
Definition flash.h:49
@ VSF_FLASH_IRQ_READ_MASK
Definition flash.h:53
@ VSF_FLASH_IRQ_WRITE_ERROR_MASK
Definition flash.h:58
@ __VSF_HW_FLASH_IRQ_MASK
Definition flash.h:65
@ __VSF_HW_FLASH_ERR_IRQ_MASK
Definition flash.h:62
@ VSF_FLASH_IRQ_WRITE_MASK
Definition flash.h:51
@ VSF_FLASH_IRQ_ERASE_ERROR_MASK
Definition flash.h:56
@ VSF_FLASH_IRQ_READ_ERROR_MASK
Definition flash.h:60
vsf_flash_irq_mask_t
Definition vsf_template_flash.h:113