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