annotate Common/Drivers/STM32F4xx_HAL_DRIVER_v120/Inc/stm32f4xx_hal_nand.h @ 101:83feba2ad1c3 kittz

globals
author Dmitry Romanov <kitt@bk.ru>
date Tue, 27 Nov 2018 13:18:59 +0300
parents 5f11787b4f42
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2 ******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3 * @file stm32f4xx_hal_nand.h
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4 * @author MCD Application Team
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5 * @version V1.2.0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6 * @date 26-December-2014
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7 * @brief Header file of NAND HAL module.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
8 ******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
9 * @attention
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
10 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
12 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
13 * Redistribution and use in source and binary forms, with or without modification,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
14 * are permitted provided that the following conditions are met:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
15 * 1. Redistributions of source code must retain the above copyright notice,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
16 * this list of conditions and the following disclaimer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
17 * 2. Redistributions in binary form must reproduce the above copyright notice,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
18 * this list of conditions and the following disclaimer in the documentation
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
19 * and/or other materials provided with the distribution.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
21 * may be used to endorse or promote products derived from this software
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
22 * without specific prior written permission.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
23 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
34 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
35 ******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
36 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
37
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
38 /* Define to prevent recursive inclusion -------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
39 #ifndef __STM32F4xx_HAL_NAND_H
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
40 #define __STM32F4xx_HAL_NAND_H
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
41
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
42 #ifdef __cplusplus
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
43 extern "C" {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
44 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
45
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
46 /* Includes ------------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
47 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx)|| defined(STM32F417xx)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
48 #include "stm32f4xx_ll_fsmc.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
49 #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
50
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
51 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
52 #include "stm32f4xx_ll_fmc.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
53 #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
54
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
55 /** @addtogroup STM32F4xx_HAL_Driver
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
56 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
57 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
58
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
59 /** @addtogroup NAND
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
60 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
61 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
62
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
63 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
64 /* Exported typedef ----------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
65 /* Exported types ------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
66 /** @defgroup NAND_Exported_Types NAND Exported Types
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
67 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
68 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
69
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
70 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
71 * @brief HAL NAND State structures definition
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
72 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
73 typedef enum
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
74 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
75 HAL_NAND_STATE_RESET = 0x00, /*!< NAND not yet initialized or disabled */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
76 HAL_NAND_STATE_READY = 0x01, /*!< NAND initialized and ready for use */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
77 HAL_NAND_STATE_BUSY = 0x02, /*!< NAND internal process is ongoing */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
78 HAL_NAND_STATE_ERROR = 0x03 /*!< NAND error state */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
79 }HAL_NAND_StateTypeDef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
80
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
81 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
82 * @brief NAND Memory electronic signature Structure definition
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
83 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
84 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
85 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
86 /*<! NAND memory electronic signature maker and device IDs */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
87
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
88 uint8_t Maker_Id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
89
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
90 uint8_t Device_Id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
91
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
92 uint8_t Third_Id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
93
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
94 uint8_t Fourth_Id;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
95 }NAND_IDTypeDef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
96
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
97 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
98 * @brief NAND Memory address Structure definition
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
99 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
100 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
101 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
102 uint16_t Page; /*!< NAND memory Page address */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
103
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
104 uint16_t Zone; /*!< NAND memory Zone address */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
105
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
106 uint16_t Block; /*!< NAND memory Block address */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
107
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
108 }NAND_AddressTypeDef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
109
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
110 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
111 * @brief NAND Memory info Structure definition
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
112 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
113 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
114 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
115 uint32_t PageSize; /*!< NAND memory page (without spare area) size measured in K. bytes */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
116
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
117 uint32_t SpareAreaSize; /*!< NAND memory spare area size measured in K. bytes */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
118
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
119 uint32_t BlockSize; /*!< NAND memory block size number of pages */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
120
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
121 uint32_t BlockNbr; /*!< NAND memory number of blocks */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
122
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
123 uint32_t ZoneSize; /*!< NAND memory zone size measured in number of blocks */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
124 }NAND_InfoTypeDef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
125
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
126 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
127 * @brief NAND handle Structure definition
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
128 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
129 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
130 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
131 FMC_NAND_TypeDef *Instance; /*!< Register base address */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
132
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
133 FMC_NAND_InitTypeDef Init; /*!< NAND device control configuration parameters */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
134
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
135 HAL_LockTypeDef Lock; /*!< NAND locking object */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
136
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
137 __IO HAL_NAND_StateTypeDef State; /*!< NAND device access state */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
138
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
139 NAND_InfoTypeDef Info; /*!< NAND characteristic information structure */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
140 }NAND_HandleTypeDef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
141 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
142 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
143 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
144
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
145 /* Exported constants --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
146 /* Exported macro ------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
147 /** @defgroup NAND_Exported_Macros NAND Exported Macros
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
148 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
149 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
150
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
151 /** @brief Reset NAND handle state
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
152 * @param __HANDLE__: specifies the NAND handle.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
153 * @retval None
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
154 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
155 #define __HAL_NAND_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_NAND_STATE_RESET)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
156
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
157 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
158 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
159 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
160
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
161 /* Exported functions --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
162 /** @addtogroup NAND_Exported_Functions NAND Exported Functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
163 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
164 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
165
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
166 /** @addtogroup NAND_Exported_Functions_Group1 Initialization and de-initialization functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
167 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
168 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
169
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
170 /* Initialization/de-initialization functions ********************************/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
171 HAL_StatusTypeDef HAL_NAND_Init(NAND_HandleTypeDef *hnand, FMC_NAND_PCC_TimingTypeDef *ComSpace_Timing, FMC_NAND_PCC_TimingTypeDef *AttSpace_Timing);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
172 HAL_StatusTypeDef HAL_NAND_DeInit(NAND_HandleTypeDef *hnand);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
173 void HAL_NAND_MspInit(NAND_HandleTypeDef *hnand);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
174 void HAL_NAND_MspDeInit(NAND_HandleTypeDef *hnand);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
175 void HAL_NAND_IRQHandler(NAND_HandleTypeDef *hnand);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
176 void HAL_NAND_ITCallback(NAND_HandleTypeDef *hnand);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
177
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
178 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
179 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
180 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
181
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
182 /** @addtogroup NAND_Exported_Functions_Group2 Input and Output functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
183 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
184 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
185
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
186 /* IO operation functions ****************************************************/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
187 HAL_StatusTypeDef HAL_NAND_Read_ID(NAND_HandleTypeDef *hnand, NAND_IDTypeDef *pNAND_ID);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
188 HAL_StatusTypeDef HAL_NAND_Reset(NAND_HandleTypeDef *hnand);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
189 HAL_StatusTypeDef HAL_NAND_Read_Page(NAND_HandleTypeDef *hnand, NAND_AddressTypeDef *pAddress, uint8_t *pBuffer, uint32_t NumPageToRead);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
190 HAL_StatusTypeDef HAL_NAND_Write_Page(NAND_HandleTypeDef *hnand, NAND_AddressTypeDef *pAddress, uint8_t *pBuffer, uint32_t NumPageToWrite);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
191 HAL_StatusTypeDef HAL_NAND_Read_SpareArea(NAND_HandleTypeDef *hnand, NAND_AddressTypeDef *pAddress, uint8_t *pBuffer, uint32_t NumSpareAreaToRead);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
192 HAL_StatusTypeDef HAL_NAND_Write_SpareArea(NAND_HandleTypeDef *hnand, NAND_AddressTypeDef *pAddress, uint8_t *pBuffer, uint32_t NumSpareAreaTowrite);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
193 HAL_StatusTypeDef HAL_NAND_Erase_Block(NAND_HandleTypeDef *hnand, NAND_AddressTypeDef *pAddress);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
194 uint32_t HAL_NAND_Read_Status(NAND_HandleTypeDef *hnand);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
195 uint32_t HAL_NAND_Address_Inc(NAND_HandleTypeDef *hnand, NAND_AddressTypeDef *pAddress);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
196
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
197 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
198 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
199 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
200
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
201 /** @addtogroup NAND_Exported_Functions_Group3 Peripheral Control functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
202 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
203 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
204
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
205 /* NAND Control functions ****************************************************/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
206 HAL_StatusTypeDef HAL_NAND_ECC_Enable(NAND_HandleTypeDef *hnand);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
207 HAL_StatusTypeDef HAL_NAND_ECC_Disable(NAND_HandleTypeDef *hnand);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
208 HAL_StatusTypeDef HAL_NAND_GetECC(NAND_HandleTypeDef *hnand, uint32_t *ECCval, uint32_t Timeout);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
209
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
210 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
211 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
212 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
213
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
214 /** @addtogroup NAND_Exported_Functions_Group4 Peripheral State functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
215 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
216 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
217 /* NAND State functions *******************************************************/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
218 HAL_NAND_StateTypeDef HAL_NAND_GetState(NAND_HandleTypeDef *hnand);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
219 uint32_t HAL_NAND_Read_Status(NAND_HandleTypeDef *hnand);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
220 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
221 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
222 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
223
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
224 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
225 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
226 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
227
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
228 /* Private types -------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
229 /* Private variables ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
230 /* Private constants ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
231 /** @defgroup NAND_Private_Constants NAND Private Constants
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
232 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
233 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
234 #define NAND_DEVICE1 ((uint32_t)0x70000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
235 #define NAND_DEVICE2 ((uint32_t)0x80000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
236 #define NAND_WRITE_TIMEOUT ((uint32_t)0x01000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
237
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
238 #define CMD_AREA ((uint32_t)(1<<16)) /* A16 = CLE high */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
239 #define ADDR_AREA ((uint32_t)(1<<17)) /* A17 = ALE high */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
240
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
241 #define NAND_CMD_AREA_A ((uint8_t)0x00)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
242 #define NAND_CMD_AREA_B ((uint8_t)0x01)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
243 #define NAND_CMD_AREA_C ((uint8_t)0x50)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
244 #define NAND_CMD_AREA_TRUE1 ((uint8_t)0x30)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
245
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
246 #define NAND_CMD_WRITE0 ((uint8_t)0x80)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
247 #define NAND_CMD_WRITE_TRUE1 ((uint8_t)0x10)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
248 #define NAND_CMD_ERASE0 ((uint8_t)0x60)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
249 #define NAND_CMD_ERASE1 ((uint8_t)0xD0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
250 #define NAND_CMD_READID ((uint8_t)0x90)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
251 #define NAND_CMD_STATUS ((uint8_t)0x70)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
252 #define NAND_CMD_LOCK_STATUS ((uint8_t)0x7A)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
253 #define NAND_CMD_RESET ((uint8_t)0xFF)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
254
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
255 /* NAND memory status */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
256 #define NAND_VALID_ADDRESS ((uint32_t)0x00000100)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
257 #define NAND_INVALID_ADDRESS ((uint32_t)0x00000200)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
258 #define NAND_TIMEOUT_ERROR ((uint32_t)0x00000400)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
259 #define NAND_BUSY ((uint32_t)0x00000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
260 #define NAND_ERROR ((uint32_t)0x00000001)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
261 #define NAND_READY ((uint32_t)0x00000040)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
262 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
263 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
264 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
265
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
266 /* Private macros ------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
267 /** @defgroup NAND_Private_Macros NAND Private Macros
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
268 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
269 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
270
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
271 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
272 * @brief NAND memory address computation.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
273 * @param __ADDRESS__: NAND memory address.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
274 * @param __HANDLE__ : NAND handle.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
275 * @retval NAND Raw address value
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
276 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
277 #define ARRAY_ADDRESS(__ADDRESS__ , __HANDLE__) ((__ADDRESS__)->Page + \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
278 (((__ADDRESS__)->Block + (((__ADDRESS__)->Zone) * ((__HANDLE__)->Info.ZoneSize)))* ((__HANDLE__)->Info.BlockSize)))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
279
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
280 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
281 * @brief NAND memory address cycling.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
282 * @param __ADDRESS__: NAND memory address.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
283 * @retval NAND address cycling value.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
284 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
285 #define ADDR_1ST_CYCLE(__ADDRESS__) (uint8_t)(__ADDRESS__) /* 1st addressing cycle */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
286 #define ADDR_2ND_CYCLE(__ADDRESS__) (uint8_t)((__ADDRESS__) >> 8) /* 2nd addressing cycle */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
287 #define ADDR_3RD_CYCLE(__ADDRESS__) (uint8_t)((__ADDRESS__) >> 16) /* 3rd addressing cycle */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
288 #define ADDR_4TH_CYCLE(__ADDRESS__) (uint8_t)((__ADDRESS__) >> 24) /* 4th addressing cycle */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
289 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
290 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
291 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
292 #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
293
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
294 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
295 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
296 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
297 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
298 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
299 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
300
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
301 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
302 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
303 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
304
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
305 #ifdef __cplusplus
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
306 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
307 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
308
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
309 #endif /* __STM32F4xx_HAL_NAND_H */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
310
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
311 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/