VSF Documented
sthal_flash.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright(C)2009-2024 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 specific language governing permissions and *
14 * limitations under the License. *
15 * *
16 ****************************************************************************/
17
18#ifndef __ST_HAL_FLASH_H__
19#define __ST_HAL_FLASH_H__
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25/*============================ INCLUDES ======================================*/
26
27#include "sthal_def.h"
28
29/*============================ MACROS ========================================*/
30
31#define HAL_FLASH_ERROR_NONE 0x00000000U
32#define HAL_FLASH_ERROR_RD 0x00000001U
33#define HAL_FLASH_ERROR_PGS 0x00000002U
34#define HAL_FLASH_ERROR_PGP 0x00000004U
35#define HAL_FLASH_ERROR_PGA 0x00000008U
36#define HAL_FLASH_ERROR_WRP 0x00000010U
37#define HAL_FLASH_ERROR_OPERATION 0x00000020U
38
39/*============================ MACROFIED FUNCTIONS ===========================*/
40/*============================ TYPES =========================================*/
41
42typedef enum {
48
49typedef struct {
53 volatile uint32_t Sector;
54 volatile uint32_t Bank;
55 volatile uint32_t Address;
59
60/*============================ GLOBAL VARIABLES ==============================*/
61/*============================ PROTOTYPES ====================================*/
62
64 uint64_t Data);
66 uint64_t Data);
67void HAL_FLASH_IRQHandler(void);
77
78#ifdef __cplusplus
79}
80#endif
81
82#endif
unsigned uint32_t
Definition stdint.h:9
unsigned long long uint64_t
Definition stdint.h:11
unsigned char uint8_t
Definition stdint.h:5
HAL_StatusTypeDef
Definition sthal_def.h:65
HAL_LockTypeDef
Definition sthal_def.h:72
HAL_StatusTypeDef HAL_FLASH_OB_Launch(void)
Definition sthal_flash.c:71
void HAL_FLASH_IRQHandler(void)
Definition sthal_flash.c:37
uint32_t HAL_FLASH_GetError(void)
Definition sthal_flash.c:76
void HAL_FLASH_OperationErrorCallback(uint32_t ReturnValue)
Definition sthal_flash.c:46
HAL_StatusTypeDef HAL_FLASH_Unlock(void)
Definition sthal_flash.c:51
FLASH_ProcedureTypeDef
Definition sthal_flash.h:42
@ FLASH_PROC_MASSERASE
Definition sthal_flash.h:45
@ FLASH_PROC_NONE
Definition sthal_flash.h:43
@ FLASH_PROC_PROGRAM
Definition sthal_flash.h:46
@ FLASH_PROC_SECTERASE
Definition sthal_flash.h:44
HAL_StatusTypeDef HAL_FLASH_OB_Lock(void)
Definition sthal_flash.c:66
HAL_StatusTypeDef HAL_FLASH_OB_Unlock(void)
Definition sthal_flash.c:61
void HAL_FLASH_EndOfOperationCallback(uint32_t ReturnValue)
Definition sthal_flash.c:40
HAL_StatusTypeDef HAL_FLASH_Program_IT(uint32_t TypeProgram, uint32_t Address, uint64_t Data)
Definition sthal_flash.c:31
HAL_StatusTypeDef HAL_FLASH_Program(uint32_t TypeProgram, uint32_t Address, uint64_t Data)
Definition sthal_flash.c:25
HAL_StatusTypeDef HAL_FLASH_Lock(void)
Definition sthal_flash.c:56
HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout)
Definition sthal_flash.c:81
Definition sthal_flash.h:49
volatile uint32_t NbSectorsToErase
Definition sthal_flash.h:51
volatile uint32_t Sector
Definition sthal_flash.h:53
volatile FLASH_ProcedureTypeDef ProcedureOnGoing
Definition sthal_flash.h:50
volatile uint32_t Address
Definition sthal_flash.h:55
volatile uint32_t ErrorCode
Definition sthal_flash.h:57
volatile uint8_t VoltageForErase
Definition sthal_flash.h:52
HAL_LockTypeDef Lock
Definition sthal_flash.h:56
volatile uint32_t Bank
Definition sthal_flash.h:54