Mistake on this page?
Report an issue in GitHub or email us
pal_flash.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file
4  *
5  * \brief PAL flash driver.
6  *
7  * Copyright (c) 2018-2019 Arm Ltd. All Rights Reserved.
8  *
9  * Copyright (c) 2019 Packetcraft, Inc.
10  *
11  * Licensed under the Apache License, Version 2.0 (the "License");
12  * you may not use this file except in compliance with the License.
13  * You may obtain a copy of the License at
14  *
15  * http://www.apache.org/licenses/LICENSE-2.0
16  *
17  * Unless required by applicable law or agreed to in writing, software
18  * distributed under the License is distributed on an "AS IS" BASIS,
19  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  * See the License for the specific language governing permissions and
21  * limitations under the License.
22  */
23 /*************************************************************************************************/
24 
25 #ifndef PAL_FLASH_H
26 #define PAL_FLASH_H
27 
28 #include "pal_types.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 /*! \addtogroup PAL_FLASH
35  * \{ */
36 
37 /**************************************************************************************************
38  Data Types
39 **************************************************************************************************/
40 
41 /*! \brief Callback. This may be returned in interrupt context. */
42 typedef void (*PalFlashCback_t)(bool_t status);
43 
44 /*! \brief Operational states. */
45 typedef enum
46 {
47  PAL_FLASH_STATE_UNINIT = 0, /*!< Uninitialized state. */
48  PAL_FLASH_STATE_ERROR = 0, /*!< Error state. */
49  PAL_FLASH_STATE_READY, /*!< Ready state. */
50  PAL_FLASH_STATE_BUSY /*!< Busy state. */
52 
53 /**************************************************************************************************
54  Function Declarations
55 **************************************************************************************************/
56 
57 /* Initialization */
58 void PalFlashInit(PalFlashCback_t actCback);
59 void PalFlashDeInit(void);
60 
61 /* Control and Status */
62 PalFlashState_t PalNvmGetState(void);
63 uint32_t PalNvmGetTotalSize(void);
64 uint32_t PalNvmGetSectorSize(void);
65 
66 /* Data Transfer */
67 void PalFlashRead(void *pBuf, uint32_t size, uint32_t srcAddr);
68 void PalFlashWrite(void *pBuf, uint32_t size, uint32_t dstAddr);
69 void PalFlashEraseSector(uint32_t size, uint32_t startAddr);
70 void PalFlashEraseChip(void);
71 
72 /*! \} */ /* PAL_FLASH */
73 
74 #ifdef __cplusplus
75 };
76 #endif
77 
78 #endif /* PAL_FLASH_H */
void(* PalFlashCback_t)(uint8_t status)
Callback. This may be returned in interrupt context.
Definition: pal_flash.h:42
Platform-independent data types.
PalFlashState_t
Operational states.
Definition: pal_flash.h:45
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.