Subversion Repositories DashDisplay

Rev

Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 5
Line 1... Line 1...
1
/**
1
/**
2
  ******************************************************************************
2
  ******************************************************************************
3
  * @file    stm32f1xx_hal_flash.h
3
  * @file    stm32f1xx_hal_flash.h
4
  * @author  MCD Application Team
4
  * @author  MCD Application Team
5
  * @version V1.0.1
5
  * @version V1.0.4
6
  * @date    31-July-2015
6
  * @date    29-April-2016
7
  * @brief   Header file of Flash HAL module.
7
  * @brief   Header file of Flash HAL module.
8
  ******************************************************************************
8
  ******************************************************************************
9
  * @attention
9
  * @attention
10
  *
10
  *
11
  * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
11
  * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
12
  *
12
  *
13
  * Redistribution and use in source and binary forms, with or without modification,
13
  * Redistribution and use in source and binary forms, with or without modification,
14
  * are permitted provided that the following conditions are met:
14
  * are permitted provided that the following conditions are met:
15
  *   1. Redistributions of source code must retain the above copyright notice,
15
  *   1. Redistributions of source code must retain the above copyright notice,
16
  *      this list of conditions and the following disclaimer.
16
  *      this list of conditions and the following disclaimer.
Line 107... Line 107...
107
typedef struct
107
typedef struct
108
{
108
{
109
  __IO FLASH_ProcedureTypeDef ProcedureOnGoing; /*!< Internal variable to indicate which procedure is ongoing or not in IT context */
109
  __IO FLASH_ProcedureTypeDef ProcedureOnGoing; /*!< Internal variable to indicate which procedure is ongoing or not in IT context */
110
 
110
 
111
  __IO uint32_t               DataRemaining;    /*!< Internal variable to save the remaining pages to erase or half-word to program in IT context */
111
  __IO uint32_t               DataRemaining;    /*!< Internal variable to save the remaining pages to erase or half-word to program in IT context */
112
 
112
 
113
  __IO uint32_t               Address;          /*!< Internal variable to save address selected for program or erase */
113
  __IO uint32_t               Address;          /*!< Internal variable to save address selected for program or erase */
114
 
114
 
115
  __IO uint64_t               Data;             /*!< Internal variable to save data to be programmed */
115
  __IO uint64_t               Data;             /*!< Internal variable to save data to be programmed */
116
 
116
 
117
  HAL_LockTypeDef             Lock;             /*!< FLASH locking object                */
117
  HAL_LockTypeDef             Lock;             /*!< FLASH locking object                */
118
 
118
 
119
  __IO uint32_t               ErrorCode;        /*!< FLASH error code                    
119
  __IO uint32_t               ErrorCode;        /*!< FLASH error code                    
Line 134... Line 134...
134
  */
134
  */
135
 
135
 
136
#define HAL_FLASH_ERROR_NONE      ((uint32_t)0x00)  /*!< No error */
136
#define HAL_FLASH_ERROR_NONE      ((uint32_t)0x00)  /*!< No error */
137
#define HAL_FLASH_ERROR_PROG      ((uint32_t)0x01)  /*!< Programming error */
137
#define HAL_FLASH_ERROR_PROG      ((uint32_t)0x01)  /*!< Programming error */
138
#define HAL_FLASH_ERROR_WRP       ((uint32_t)0x02)  /*!< Write protection error */
138
#define HAL_FLASH_ERROR_WRP       ((uint32_t)0x02)  /*!< Write protection error */
139
#define HAL_FLASH_ERROR_OPTV      ((uint32_t)0x04)
139
#define HAL_FLASH_ERROR_OPTV      ((uint32_t)0x04)  /*!< Option validity error */
140
 
140
 
141
/**
141
/**
142
  * @}
142
  * @}
143
  */
143
  */
144
 
144
 
Line 218... Line 218...
218
 * @{
218
 * @{
219
 */
219
 */
220
 
220
 
221
/**
221
/**
222
  * @brief  Set the FLASH Latency.
222
  * @brief  Set the FLASH Latency.
223
  * @param  __LATENCY__: FLASH Latency                  
223
  * @param  __LATENCY__ FLASH Latency                  
224
  *         The value of this parameter depend on device used within the same series
224
  *         The value of this parameter depend on device used within the same series
225
  * @retval None
225
  * @retval None
226
  */
226
  */
227
#define __HAL_FLASH_SET_LATENCY(__LATENCY__)    (FLASH->ACR = (FLASH->ACR&(~FLASH_ACR_LATENCY)) | (__LATENCY__))
227
#define __HAL_FLASH_SET_LATENCY(__LATENCY__)    (FLASH->ACR = (FLASH->ACR&(~FLASH_ACR_LATENCY)) | (__LATENCY__))
228
 
228
 
229
 
229
 
230
/**
230
/**
231
  * @brief  Get the FLASH Latency.
231
  * @brief  Get the FLASH Latency.
232
  * @retval FLASH Latency                  
232
  * @retval FLASH Latency                  
233
  *          The value of this parameter depend on device used within the same series
233
  *         The value of this parameter depend on device used within the same series
234
  */
234
  */
235
#define __HAL_FLASH_GET_LATENCY()     (READ_BIT((FLASH->ACR), FLASH_ACR_LATENCY))
235
#define __HAL_FLASH_GET_LATENCY()     (READ_BIT((FLASH->ACR), FLASH_ACR_LATENCY))
236
 
236
 
237
/**
237
/**
238
  * @}
238
  * @}
Line 276... Line 276...
276
  */
276
  */
277
/* IO operation functions *****************************************************/
277
/* IO operation functions *****************************************************/
278
HAL_StatusTypeDef HAL_FLASH_Program(uint32_t TypeProgram, uint32_t Address, uint64_t Data);
278
HAL_StatusTypeDef HAL_FLASH_Program(uint32_t TypeProgram, uint32_t Address, uint64_t Data);
279
HAL_StatusTypeDef HAL_FLASH_Program_IT(uint32_t TypeProgram, uint32_t Address, uint64_t Data);
279
HAL_StatusTypeDef HAL_FLASH_Program_IT(uint32_t TypeProgram, uint32_t Address, uint64_t Data);
280
 
280
 
281
/* FLASH IRQ handler method */
281
/* FLASH IRQ handler function */
282
void       HAL_FLASH_IRQHandler(void);
282
void       HAL_FLASH_IRQHandler(void);
283
/* Callbacks in non blocking modes */
283
/* Callbacks in non blocking modes */
284
void       HAL_FLASH_EndOfOperationCallback(uint32_t ReturnValue);
284
void       HAL_FLASH_EndOfOperationCallback(uint32_t ReturnValue);
285
void       HAL_FLASH_OperationErrorCallback(uint32_t ReturnValue);
285
void       HAL_FLASH_OperationErrorCallback(uint32_t ReturnValue);
286
 
286