stm32f7xx_hal_nor.h
Go to the documentation of this file.
1 
20 /* Define to prevent recursive inclusion -------------------------------------*/
21 #ifndef __STM32F7xx_HAL_NOR_H
22 #define __STM32F7xx_HAL_NOR_H
23 
24 #ifdef __cplusplus
25  extern "C" {
26 #endif
27 
28 /* Includes ------------------------------------------------------------------*/
29 #include "stm32f7xx_ll_fmc.h"
30 
31 
40 /* Exported typedef ----------------------------------------------------------*/
48 typedef enum
49 {
56 
60 typedef enum
61 {
67 
71 typedef struct
72 {
73  uint16_t Manufacturer_Code;
75  uint16_t Device_Code1;
76 
77  uint16_t Device_Code2;
78 
79  uint16_t Device_Code3;
84 
88 typedef struct
89 {
94  uint16_t CFI_1;
95 
96  uint16_t CFI_2;
97 
98  uint16_t CFI_3;
99 
100  uint16_t CFI_4;
102 
106 #if (USE_HAL_NOR_REGISTER_CALLBACKS == 1)
107 typedef struct __NOR_HandleTypeDef
108 #else
109 typedef struct
110 #endif /* USE_HAL_NOR_REGISTER_CALLBACKS */
111 
112 {
123 #if (USE_HAL_NOR_REGISTER_CALLBACKS == 1)
124  void (* MspInitCallback) ( struct __NOR_HandleTypeDef * hnor);
125  void (* MspDeInitCallback) ( struct __NOR_HandleTypeDef * hnor);
126 #endif
128 
129 #if (USE_HAL_NOR_REGISTER_CALLBACKS == 1)
130 
133 typedef enum
134 {
135  HAL_NOR_MSP_INIT_CB_ID = 0x00U,
136  HAL_NOR_MSP_DEINIT_CB_ID = 0x01U
137 }HAL_NOR_CallbackIDTypeDef;
138 
142 typedef void (*pNOR_CallbackTypeDef)(NOR_HandleTypeDef *hnor);
143 #endif
144 
148 /* Exported constants --------------------------------------------------------*/
149 /* Exported macro ------------------------------------------------------------*/
157 #if (USE_HAL_NOR_REGISTER_CALLBACKS == 1)
158 #define __HAL_NOR_RESET_HANDLE_STATE(__HANDLE__) do { \
159  (__HANDLE__)->State = HAL_NOR_STATE_RESET; \
160  (__HANDLE__)->MspInitCallback = NULL; \
161  (__HANDLE__)->MspDeInitCallback = NULL; \
162  } while(0)
163 #else
164 #define __HAL_NOR_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_NOR_STATE_RESET)
165 #endif
166 
170 /* Exported functions --------------------------------------------------------*/
179 /* Initialization/de-initialization functions ********************************/
184 void HAL_NOR_MspWait(NOR_HandleTypeDef *hnor, uint32_t Timeout);
193 /* I/O operation functions ***************************************************/
196 HAL_StatusTypeDef HAL_NOR_Read(NOR_HandleTypeDef *hnor, uint32_t *pAddress, uint16_t *pData);
197 HAL_StatusTypeDef HAL_NOR_Program(NOR_HandleTypeDef *hnor, uint32_t *pAddress, uint16_t *pData);
198 
199 HAL_StatusTypeDef HAL_NOR_ReadBuffer(NOR_HandleTypeDef *hnor, uint32_t uwAddress, uint16_t *pData, uint32_t uwBufferSize);
200 HAL_StatusTypeDef HAL_NOR_ProgramBuffer(NOR_HandleTypeDef *hnor, uint32_t uwAddress, uint16_t *pData, uint32_t uwBufferSize);
201 
202 HAL_StatusTypeDef HAL_NOR_Erase_Block(NOR_HandleTypeDef *hnor, uint32_t BlockAddress, uint32_t Address);
205 
206 #if (USE_HAL_NOR_REGISTER_CALLBACKS == 1)
207 /* NOR callback registering/unregistering */
208 HAL_StatusTypeDef HAL_NOR_RegisterCallback(NOR_HandleTypeDef *hnor, HAL_NOR_CallbackIDTypeDef CallbackId, pNOR_CallbackTypeDef pCallback);
209 HAL_StatusTypeDef HAL_NOR_UnRegisterCallback(NOR_HandleTypeDef *hnor, HAL_NOR_CallbackIDTypeDef CallbackId);
210 #endif
211 
219 /* NOR Control functions *****************************************************/
230 /* NOR State functions ********************************************************/
232 HAL_NOR_StatusTypeDef HAL_NOR_GetStatus(NOR_HandleTypeDef *hnor, uint32_t Address, uint32_t Timeout);
241 /* Private types -------------------------------------------------------------*/
242 /* Private variables ---------------------------------------------------------*/
243 /* Private constants ---------------------------------------------------------*/
247 /* NOR device IDs addresses */
248 #define MC_ADDRESS ((uint16_t)0x0000U)
249 #define DEVICE_CODE1_ADDR ((uint16_t)0x0001U)
250 #define DEVICE_CODE2_ADDR ((uint16_t)0x000EU)
251 #define DEVICE_CODE3_ADDR ((uint16_t)0x000FU)
252 
253 /* NOR CFI IDs addresses */
254 #define CFI1_ADDRESS ((uint16_t)0x61U)
255 #define CFI2_ADDRESS ((uint16_t)0x62U)
256 #define CFI3_ADDRESS ((uint16_t)0x63U)
257 #define CFI4_ADDRESS ((uint16_t)0x64U)
258 
259 /* NOR operation wait timeout */
260 #define NOR_TMEOUT ((uint16_t)0xFFFFU)
261 
262 /* NOR memory data width */
263 #define NOR_MEMORY_8B ((uint8_t)0x0U)
264 #define NOR_MEMORY_16B ((uint8_t)0x1U)
265 
266 /* NOR memory device read/write start address */
267 #define NOR_MEMORY_ADRESS1 ((uint32_t)0x60000000U)
268 #define NOR_MEMORY_ADRESS2 ((uint32_t)0x64000000U)
269 #define NOR_MEMORY_ADRESS3 ((uint32_t)0x68000000U)
270 #define NOR_MEMORY_ADRESS4 ((uint32_t)0x6C000000U)
271 
275 /* Private macros ------------------------------------------------------------*/
286 #define NOR_ADDR_SHIFT(__NOR_ADDRESS, __NOR_MEMORY_WIDTH_, __ADDRESS__) \
287  ((uint32_t)(((__NOR_MEMORY_WIDTH_) == NOR_MEMORY_16B)? \
288  ((uint32_t)((__NOR_ADDRESS) + (2 * (__ADDRESS__)))): \
289  ((uint32_t)((__NOR_ADDRESS) + (__ADDRESS__)))))
290 
297 #define NOR_WRITE(__ADDRESS__, __DATA__) do{ \
298  (*(__IO uint16_t *)((uint32_t)(__ADDRESS__)) = (__DATA__)); \
299  __DSB(); \
300  } while(0)
301 
314 #ifdef __cplusplus
315 }
316 #endif
317 
318 #endif /* __STM32F7xx_HAL_NOR_H */
319 
320 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
NOR_IDTypeDef::Device_Code1
uint16_t Device_Code1
Definition: stm32f7xx_hal_nor.h:75
NOR_IDTypeDef::Device_Code3
uint16_t Device_Code3
Definition: stm32f7xx_hal_nor.h:79
__IO
#define __IO
Definition: imxrt1050/imxrt1050-evkb/CMSIS/core_cm7.h:237
NOR_HandleTypeDef
NOR handle Structure definition.
Definition: stm32f7xx_hal_nor.h:109
HAL_StatusTypeDef
HAL_StatusTypeDef
HAL Status structures definition
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:40
NOR_CFITypeDef::CFI_3
uint16_t CFI_3
Definition: stm32f7xx_hal_nor.h:98
Timing
static FMC_SDRAM_TimingTypeDef Timing
Definition: stm32f769i_discovery_sdram.c:124
HAL_NOR_Erase_Block
HAL_StatusTypeDef HAL_NOR_Erase_Block(NOR_HandleTypeDef *hnor, uint32_t BlockAddress, uint32_t Address)
HAL_NOR_STATE_PROTECTED
@ HAL_NOR_STATE_PROTECTED
Definition: stm32f7xx_hal_nor.h:54
NOR_HandleTypeDef::State
__IO HAL_NOR_StateTypeDef State
Definition: stm32f7xx_hal_nor.h:121
NOR_HandleTypeDef::Extended
FMC_NORSRAM_EXTENDED_TypeDef * Extended
Definition: stm32f7xx_hal_nor.h:115
HAL_NOR_DeInit
HAL_StatusTypeDef HAL_NOR_DeInit(NOR_HandleTypeDef *hnor)
HAL_LockTypeDef
HAL_LockTypeDef
HAL Lock structures definition
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:51
FMC_NORSRAM_TypeDef
#define FMC_NORSRAM_TypeDef
Definition: stm32f7xx_ll_fmc.h:383
NOR_HandleTypeDef::Instance
FMC_NORSRAM_TypeDef * Instance
Definition: stm32f7xx_hal_nor.h:113
FMC_NORSRAM_TimingTypeDef
FMC NORSRAM Timing parameters structure definition
Definition: stm32f7xx_ll_fmc.h:460
HAL_NOR_Read_ID
HAL_StatusTypeDef HAL_NOR_Read_ID(NOR_HandleTypeDef *hnor, NOR_IDTypeDef *pNOR_ID)
NOR_CFITypeDef
FMC NOR CFI typedef.
Definition: stm32f7xx_hal_nor.h:88
HAL_NOR_ReadBuffer
HAL_StatusTypeDef HAL_NOR_ReadBuffer(NOR_HandleTypeDef *hnor, uint32_t uwAddress, uint16_t *pData, uint32_t uwBufferSize)
HAL_NOR_StateTypeDef
HAL_NOR_StateTypeDef
HAL SRAM State structures definition
Definition: stm32f7xx_hal_nor.h:48
NOR_CFITypeDef::CFI_1
uint16_t CFI_1
Definition: stm32f7xx_hal_nor.h:94
NOR_IDTypeDef
FMC NOR ID typedef.
Definition: stm32f7xx_hal_nor.h:71
HAL_NOR_GetStatus
HAL_NOR_StatusTypeDef HAL_NOR_GetStatus(NOR_HandleTypeDef *hnor, uint32_t Address, uint32_t Timeout)
HAL_NOR_Erase_Chip
HAL_StatusTypeDef HAL_NOR_Erase_Chip(NOR_HandleTypeDef *hnor, uint32_t Address)
NOR_HandleTypeDef::Init
FMC_NORSRAM_InitTypeDef Init
Definition: stm32f7xx_hal_nor.h:117
HAL_NOR_STATE_ERROR
@ HAL_NOR_STATE_ERROR
Definition: stm32f7xx_hal_nor.h:53
NOR_CFITypeDef::CFI_4
uint16_t CFI_4
Definition: stm32f7xx_hal_nor.h:100
HAL_NOR_ProgramBuffer
HAL_StatusTypeDef HAL_NOR_ProgramBuffer(NOR_HandleTypeDef *hnor, uint32_t uwAddress, uint16_t *pData, uint32_t uwBufferSize)
HAL_NOR_Init
HAL_StatusTypeDef HAL_NOR_Init(NOR_HandleTypeDef *hnor, FMC_NORSRAM_TimingTypeDef *Timing, FMC_NORSRAM_TimingTypeDef *ExtTiming)
NOR_IDTypeDef::Manufacturer_Code
uint16_t Manufacturer_Code
Definition: stm32f7xx_hal_nor.h:73
HAL_NOR_STATUS_ONGOING
@ HAL_NOR_STATUS_ONGOING
Definition: stm32f7xx_hal_nor.h:63
HAL_NOR_STATUS_TIMEOUT
@ HAL_NOR_STATUS_TIMEOUT
Definition: stm32f7xx_hal_nor.h:65
HAL_NOR_Program
HAL_StatusTypeDef HAL_NOR_Program(NOR_HandleTypeDef *hnor, uint32_t *pAddress, uint16_t *pData)
HAL_NOR_STATE_READY
@ HAL_NOR_STATE_READY
Definition: stm32f7xx_hal_nor.h:51
HAL_NOR_StatusTypeDef
HAL_NOR_StatusTypeDef
FMC NOR Status typedef.
Definition: stm32f7xx_hal_nor.h:60
HAL_NOR_WriteOperation_Enable
HAL_StatusTypeDef HAL_NOR_WriteOperation_Enable(NOR_HandleTypeDef *hnor)
HAL_NOR_MspInit
void HAL_NOR_MspInit(NOR_HandleTypeDef *hnor)
NOR_HandleTypeDef::Lock
HAL_LockTypeDef Lock
Definition: stm32f7xx_hal_nor.h:119
HAL_NOR_ReturnToReadMode
HAL_StatusTypeDef HAL_NOR_ReturnToReadMode(NOR_HandleTypeDef *hnor)
NOR_IDTypeDef::Device_Code2
uint16_t Device_Code2
Definition: stm32f7xx_hal_nor.h:77
HAL_NOR_WriteOperation_Disable
HAL_StatusTypeDef HAL_NOR_WriteOperation_Disable(NOR_HandleTypeDef *hnor)
HAL_NOR_Read_CFI
HAL_StatusTypeDef HAL_NOR_Read_CFI(NOR_HandleTypeDef *hnor, NOR_CFITypeDef *pNOR_CFI)
FMC_NORSRAM_InitTypeDef
FMC NORSRAM Configuration Structure definition.
Definition: stm32f7xx_ll_fmc.h:396
stm32f7xx_ll_fmc.h
Header file of FMC HAL module.
HAL_NOR_STATUS_SUCCESS
@ HAL_NOR_STATUS_SUCCESS
Definition: stm32f7xx_hal_nor.h:62
FMC_NORSRAM_EXTENDED_TypeDef
#define FMC_NORSRAM_EXTENDED_TypeDef
Definition: stm32f7xx_ll_fmc.h:384
HAL_NOR_Read
HAL_StatusTypeDef HAL_NOR_Read(NOR_HandleTypeDef *hnor, uint32_t *pAddress, uint16_t *pData)
HAL_NOR_STATUS_ERROR
@ HAL_NOR_STATUS_ERROR
Definition: stm32f7xx_hal_nor.h:64
NOR_CFITypeDef::CFI_2
uint16_t CFI_2
Definition: stm32f7xx_hal_nor.h:96
HAL_NOR_MspWait
void HAL_NOR_MspWait(NOR_HandleTypeDef *hnor, uint32_t Timeout)
HAL_NOR_GetState
HAL_NOR_StateTypeDef HAL_NOR_GetState(NOR_HandleTypeDef *hnor)
HAL_NOR_MspDeInit
void HAL_NOR_MspDeInit(NOR_HandleTypeDef *hnor)
HAL_NOR_STATE_RESET
@ HAL_NOR_STATE_RESET
Definition: stm32f7xx_hal_nor.h:50
HAL_NOR_STATE_BUSY
@ HAL_NOR_STATE_BUSY
Definition: stm32f7xx_hal_nor.h:52


picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:14:53