mbed library sources. Supersedes mbed-src.
Dependents: Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more
Diff: targets/TARGET_STM/TARGET_STM32F2/device/stm32f2xx_hal_flash.h
- Revision:
- 167:e84263d55307
- Parent:
- 149:156823d33999
--- a/targets/TARGET_STM/TARGET_STM32F2/device/stm32f2xx_hal_flash.h Thu Jun 08 15:02:37 2017 +0100 +++ b/targets/TARGET_STM/TARGET_STM32F2/device/stm32f2xx_hal_flash.h Wed Jun 21 17:46:44 2017 +0100 @@ -2,13 +2,13 @@ ****************************************************************************** * @file stm32f2xx_hal_flash.h * @author MCD Application Team - * @version V1.1.3 - * @date 29-June-2016 + * @version V1.2.1 + * @date 14-April-2017 * @brief Header file of FLASH HAL module. ****************************************************************************** * @attention * - * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> + * <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2> * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -105,12 +105,12 @@ * @brief FLASH Error Code * @{ */ -#define HAL_FLASH_ERROR_NONE ((uint32_t)0x00000000U) /*!< No error */ -#define HAL_FLASH_ERROR_PGS ((uint32_t)0x00000001U) /*!< Programming Sequence error */ -#define HAL_FLASH_ERROR_PGP ((uint32_t)0x00000002U) /*!< Programming Parallelism error */ -#define HAL_FLASH_ERROR_PGA ((uint32_t)0x00000004U) /*!< Programming Alignment error */ -#define HAL_FLASH_ERROR_WRP ((uint32_t)0x00000008U) /*!< Write protection error */ -#define HAL_FLASH_ERROR_OPERATION ((uint32_t)0x00000010U) /*!< Operation Error */ +#define HAL_FLASH_ERROR_NONE 0x00000000U /*!< No error */ +#define HAL_FLASH_ERROR_PGS 0x00000001U /*!< Programming Sequence error */ +#define HAL_FLASH_ERROR_PGP 0x00000002U /*!< Programming Parallelism error */ +#define HAL_FLASH_ERROR_PGA 0x00000004U /*!< Programming Alignment error */ +#define HAL_FLASH_ERROR_WRP 0x00000008U /*!< Write protection error */ +#define HAL_FLASH_ERROR_OPERATION 0x00000010U /*!< Operation Error */ /** * @} */ @@ -118,10 +118,10 @@ /** @defgroup FLASH_Type_Program FLASH Type Program * @{ */ -#define FLASH_TYPEPROGRAM_BYTE ((uint32_t)0x00U) /*!< Program byte (8-bit) at a specified address */ -#define FLASH_TYPEPROGRAM_HALFWORD ((uint32_t)0x01U) /*!< Program a half-word (16-bit) at a specified address */ -#define FLASH_TYPEPROGRAM_WORD ((uint32_t)0x02U) /*!< Program a word (32-bit) at a specified address */ -#define FLASH_TYPEPROGRAM_DOUBLEWORD ((uint32_t)0x03U) /*!< Program a double word (64-bit) at a specified address */ +#define FLASH_TYPEPROGRAM_BYTE 0x00U /*!< Program byte (8-bit) at a specified address */ +#define FLASH_TYPEPROGRAM_HALFWORD 0x01U /*!< Program a half-word (16-bit) at a specified address */ +#define FLASH_TYPEPROGRAM_WORD 0x02U /*!< Program a word (32-bit) at a specified address */ +#define FLASH_TYPEPROGRAM_DOUBLEWORD 0x03U /*!< Program a double word (64-bit) at a specified address */ /** * @} */ @@ -146,7 +146,7 @@ * @{ */ #define FLASH_IT_EOP FLASH_CR_EOPIE /*!< End of FLASH Operation Interrupt source */ -#define FLASH_IT_ERR ((uint32_t)0x02000000U) /*!< Error Interrupt source */ +#define FLASH_IT_ERR 0x02000000U /*!< Error Interrupt source */ /** * @} */ @@ -154,11 +154,11 @@ /** @defgroup FLASH_Program_Parallelism FLASH Program Parallelism * @{ */ -#define FLASH_PSIZE_BYTE ((uint32_t)0x00000000U) -#define FLASH_PSIZE_HALF_WORD ((uint32_t)0x00000100U) -#define FLASH_PSIZE_WORD ((uint32_t)0x00000200U) -#define FLASH_PSIZE_DOUBLE_WORD ((uint32_t)0x00000300U) -#define CR_PSIZE_MASK ((uint32_t)0xFFFFFCFFU) +#define FLASH_PSIZE_BYTE 0x00000000U +#define FLASH_PSIZE_HALF_WORD 0x00000100U +#define FLASH_PSIZE_WORD 0x00000200U +#define FLASH_PSIZE_DOUBLE_WORD 0x00000300U +#define CR_PSIZE_MASK 0xFFFFFCFFU /** * @} */ @@ -166,11 +166,11 @@ /** @defgroup FLASH_Keys FLASH Keys * @{ */ -#define RDP_KEY ((uint16_t)0x00A5U) -#define FLASH_KEY1 ((uint32_t)0x45670123U) -#define FLASH_KEY2 ((uint32_t)0xCDEF89ABU) -#define FLASH_OPT_KEY1 ((uint32_t)0x08192A3BU) -#define FLASH_OPT_KEY2 ((uint32_t)0x4C5D6E7FU) +#define RDP_KEY ((uint16_t)0x00A5) +#define FLASH_KEY1 0x45670123U +#define FLASH_KEY2 0xCDEF89ABU +#define FLASH_OPT_KEY1 0x08192A3BU +#define FLASH_OPT_KEY2 0x4C5D6E7FU /** * @} */ @@ -241,7 +241,7 @@ */ #define __HAL_FLASH_INSTRUCTION_CACHE_RESET() do {FLASH->ACR |= FLASH_ACR_ICRST; \ FLASH->ACR &= ~FLASH_ACR_ICRST; \ - }while(0) + }while(0U) /** * @brief Resets the FLASH data Cache. @@ -250,7 +250,7 @@ */ #define __HAL_FLASH_DATA_CACHE_RESET() do {FLASH->ACR |= FLASH_ACR_DCRST; \ FLASH->ACR &= ~FLASH_ACR_DCRST; \ - }while(0) + }while(0U) /** * @brief Enable the specified FLASH interrupt. * @param __INTERRUPT__ : FLASH interrupt @@ -273,8 +273,8 @@ /** * @brief Get the specified FLASH flag status. - * @param __FLAG__: specifies the FLASH flag to check. - * This parameter can be one of the following values: + * @param __FLAG__: specifies the FLASH flags to check. + * This parameter can be any combination of the following values: * @arg FLASH_FLAG_EOP : FLASH End of Operation flag * @arg FLASH_FLAG_OPERR : FLASH operation Error flag * @arg FLASH_FLAG_WRPERR: FLASH Write protected error flag @@ -284,10 +284,10 @@ * @arg FLASH_FLAG_BSY : FLASH Busy flag * @retval The new state of __FLAG__ (SET or RESET). */ -#define __HAL_FLASH_GET_FLAG(__FLAG__) ((FLASH->SR & (__FLAG__)) == (__FLAG__)) +#define __HAL_FLASH_GET_FLAG(__FLAG__) ((FLASH->SR & (__FLAG__))) /** - * @brief Clear the specified FLASH flag. + * @brief Clear the specified FLASH flags. * @param __FLAG__: specifies the FLASH flags to clear. * This parameter can be any combination of the following values: * @arg FLASH_FLAG_EOP : FLASH End of Operation flag @@ -369,23 +369,23 @@ /** * @brief ACR register byte 0 (Bits[7:0]) base address */ -#define ACR_BYTE0_ADDRESS ((uint32_t)0x40023C00U) +#define ACR_BYTE0_ADDRESS 0x40023C00U /** * @brief OPTCR register byte 0 (Bits[7:0]) base address */ -#define OPTCR_BYTE0_ADDRESS ((uint32_t)0x40023C14U) +#define OPTCR_BYTE0_ADDRESS 0x40023C14U /** * @brief OPTCR register byte 1 (Bits[15:8]) base address */ -#define OPTCR_BYTE1_ADDRESS ((uint32_t)0x40023C15U) +#define OPTCR_BYTE1_ADDRESS 0x40023C15U /** * @brief OPTCR register byte 2 (Bits[23:16]) base address */ -#define OPTCR_BYTE2_ADDRESS ((uint32_t)0x40023C16U) +#define OPTCR_BYTE2_ADDRESS 0x40023C16U /** * @brief OPTCR register byte 3 (Bits[31:24]) base address */ -#define OPTCR_BYTE3_ADDRESS ((uint32_t)0x40023C17U) +#define OPTCR_BYTE3_ADDRESS 0x40023C17U /** * @}