[NUCLEO_F401RE] Update STM32CubeF4 driver V1.0.0 (part 1/4)

pull/189/head
bcostm 2014-02-25 16:44:12 +01:00
parent 330d1a96b0
commit 3a74e3f9e3
29 changed files with 285 additions and 214 deletions

View File

@ -1,31 +1,43 @@
; STM32F40xx/41xx devices vector table for MDK-ARM MICRO toolchain ;******************** (C) COPYRIGHT 2014 STMicroelectronics ********************
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;* File Name : startup_stm32f401xe.s
; Copyright (c) 2014, STMicroelectronics ;* Author : MCD Application Team
; All rights reserved. ;* Version : V2.0.0
; ;* Date : 18-February-2014
; Redistribution and use in source and binary forms, with or without ;* Description : STM32F401xe devices vector table for MDK-ARM toolchain.
; modification, are permitted provided that the following conditions are met: ;* This module performs:
; ;* - Set the initial SP
; 1. Redistributions of source code must retain the above copyright notice, ;* - Set the initial PC == Reset_Handler
; this list of conditions and the following disclaimer. ;* - Set the vector table entries with the exceptions ISR address
; 2. Redistributions in binary form must reproduce the above copyright notice, ;* - Branches to __main in the C library (which eventually
; this list of conditions and the following disclaimer in the documentation ;* calls main()).
; and/or other materials provided with the distribution. ;* After Reset the CortexM4 processor is in Thread mode,
; 3. Neither the name of STMicroelectronics nor the names of its contributors ;* priority is Privileged, and the Stack is set to Main.
; may be used to endorse or promote products derived from this software ;* <<< Use Configuration Wizard in Context Menu >>>
; without specific prior written permission. ;*******************************************************************************
; ;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ;* Redistribution and use in source and binary forms, with or without modification,
; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ;* are permitted provided that the following conditions are met:
; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE ;* 1. Redistributions of source code must retain the above copyright notice,
; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE ;* this list of conditions and the following disclaimer.
; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ;* 2. Redistributions in binary form must reproduce the above copyright notice,
; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR ;* this list of conditions and the following disclaimer in the documentation
; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER ;* and/or other materials provided with the distribution.
; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, ;* 3. Neither the name of STMicroelectronics nor the names of its contributors
; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ;* may be used to endorse or promote products derived from this software
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;* without specific prior written permission.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;*
;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;
;*******************************************************************************
; Amount of memory (in bytes) allocated for Stack ; Amount of memory (in bytes) allocated for Stack
; Tailor this value to your application needs ; Tailor this value to your application needs

View File

@ -1,31 +1,43 @@
; STM32F40xx/41xx devices vector table for MDK-ARM toolchain ;******************** (C) COPYRIGHT 2014 STMicroelectronics ********************
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;* File Name : startup_stm32f401xe.s
; Copyright (c) 2014, STMicroelectronics ;* Author : MCD Application Team
; All rights reserved. ;* Version : V2.0.0
; ;* Date : 18-February-2014
; Redistribution and use in source and binary forms, with or without ;* Description : STM32F401xe devices vector table for MDK-ARM toolchain.
; modification, are permitted provided that the following conditions are met: ;* This module performs:
; ;* - Set the initial SP
; 1. Redistributions of source code must retain the above copyright notice, ;* - Set the initial PC == Reset_Handler
; this list of conditions and the following disclaimer. ;* - Set the vector table entries with the exceptions ISR address
; 2. Redistributions in binary form must reproduce the above copyright notice, ;* - Branches to __main in the C library (which eventually
; this list of conditions and the following disclaimer in the documentation ;* calls main()).
; and/or other materials provided with the distribution. ;* After Reset the CortexM4 processor is in Thread mode,
; 3. Neither the name of STMicroelectronics nor the names of its contributors ;* priority is Privileged, and the Stack is set to Main.
; may be used to endorse or promote products derived from this software ;* <<< Use Configuration Wizard in Context Menu >>>
; without specific prior written permission. ;*******************************************************************************
; ;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ;* Redistribution and use in source and binary forms, with or without modification,
; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ;* are permitted provided that the following conditions are met:
; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE ;* 1. Redistributions of source code must retain the above copyright notice,
; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE ;* this list of conditions and the following disclaimer.
; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ;* 2. Redistributions in binary form must reproduce the above copyright notice,
; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR ;* this list of conditions and the following disclaimer in the documentation
; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER ;* and/or other materials provided with the distribution.
; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, ;* 3. Neither the name of STMicroelectronics nor the names of its contributors
; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ;* may be used to endorse or promote products derived from this software
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;* without specific prior written permission.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;*
;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;
;*******************************************************************************
__initial_sp EQU 0x20018000 ; Top of RAM __initial_sp EQU 0x20018000 ; Top of RAM

View File

@ -1,8 +1,8 @@
;/******************** (C) COPYRIGHT 2014 STMicroelectronics ******************** ;/******************** (C) COPYRIGHT 2014 STMicroelectronics ********************
;* File Name : startup_stm32f401xe.s ;* File Name : startup_stm32f401xe.s
;* Author : MCD Application Team ;* Author : MCD Application Team
;* Version : V2.0.0RC6 ;* Version : V2.0.0
;* Date : 03-February-2014 ;* Date : 18-February-2014
;* Description : STM32F401xExx devices vector table for EWARM toolchain. ;* Description : STM32F401xExx devices vector table for EWARM toolchain.
;* This module performs: ;* This module performs:
;* - Set the initial SP ;* - Set the initial SP

View File

@ -2,8 +2,8 @@
****************************************************************************** ******************************************************************************
* @file stm32f401xe.h * @file stm32f401xe.h
* @author MCD Application Team * @author MCD Application Team
* @version V2.0.0RC6 * @version V2.0.0
* @date 03-February-2014 * @date 18-February-2014
* @brief CMSIS STM32F401xExx Device Peripheral Access Layer Header File. * @brief CMSIS STM32F401xExx Device Peripheral Access Layer Header File.
* *
* This file contains: * This file contains:

View File

@ -2,8 +2,8 @@
****************************************************************************** ******************************************************************************
* @file stm32f4xx.h * @file stm32f4xx.h
* @author MCD Application Team * @author MCD Application Team
* @version V2.0.0RC6 * @version V2.0.0
* @date 03-February-2014 * @date 18-February-2014
* @brief CMSIS STM32F4xx Device Peripheral Access Layer Header File. * @brief CMSIS STM32F4xx Device Peripheral Access Layer Header File.
* *
* The file is the unique include file that the application programmer * The file is the unique include file that the application programmer
@ -94,16 +94,16 @@
In this case, these drivers will not be included and the application code will In this case, these drivers will not be included and the application code will
be based on direct access to peripherals registers be based on direct access to peripherals registers
*/ */
/*#define USE_HAL_DRIVER */ #define USE_HAL_DRIVER
#endif /* USE_HAL_DRIVER */ #endif /* USE_HAL_DRIVER */
/** /**
* @brief CMSIS Device version number V2.0.0RC6 * @brief CMSIS Device version number V2.0.0
*/ */
#define __STM32F4xx_CMSIS_DEVICE_VERSION_MAIN (0x02) /*!< [31:24] main version */ #define __STM32F4xx_CMSIS_DEVICE_VERSION_MAIN (0x02) /*!< [31:24] main version */
#define __STM32F4xx_CMSIS_DEVICE_VERSION_SUB1 (0x00) /*!< [23:16] sub1 version */ #define __STM32F4xx_CMSIS_DEVICE_VERSION_SUB1 (0x00) /*!< [23:16] sub1 version */
#define __STM32F4xx_CMSIS_DEVICE_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */ #define __STM32F4xx_CMSIS_DEVICE_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */
#define __STM32F4xx_CMSIS_DEVICE_VERSION_RC (0x06) /*!< [7:0] release candidate */ #define __STM32F4xx_CMSIS_DEVICE_VERSION_RC (0x00) /*!< [7:0] release candidate */
#define __STM32F4xx_CMSIS_DEVICE_VERSION ((__CMSIS_DEVICE_VERSION_MAIN << 24)\ #define __STM32F4xx_CMSIS_DEVICE_VERSION ((__CMSIS_DEVICE_VERSION_MAIN << 24)\
|(__CMSIS_DEVICE_HAL_VERSION_SUB1 << 16)\ |(__CMSIS_DEVICE_HAL_VERSION_SUB1 << 16)\
|(__CMSIS_DEVICE_HAL_VERSION_SUB2 << 8 )\ |(__CMSIS_DEVICE_HAL_VERSION_SUB2 << 8 )\

View File

@ -2,8 +2,8 @@
****************************************************************************** ******************************************************************************
* @file stm32f4xx_hal.c * @file stm32f4xx_hal.c
* @author MCD Application Team * @author MCD Application Team
* @version V1.0.0RC2 * @version V1.0.0
* @date 04-February-2014 * @date 18-February-2014
* @brief HAL module driver. * @brief HAL module driver.
* This is the common part of the HAL initialization * This is the common part of the HAL initialization
* *
@ -62,17 +62,15 @@
* @{ * @{
*/ */
#ifdef HAL_MODULE_ENABLED
/* Private typedef -----------------------------------------------------------*/ /* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/
/** /**
* @brief STM32F4xx HAL Driver version number V1.0.0RC1 * @brief STM32F4xx HAL Driver version number V1.0.0
*/ */
#define __STM32F4xx_HAL_VERSION_MAIN (0x01) /*!< [31:24] main version */ #define __STM32F4xx_HAL_VERSION_MAIN (0x01) /*!< [31:24] main version */
#define __STM32F4xx_HAL_VERSION_SUB1 (0x00) /*!< [23:16] sub1 version */ #define __STM32F4xx_HAL_VERSION_SUB1 (0x00) /*!< [23:16] sub1 version */
#define __STM32F4xx_HAL_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */ #define __STM32F4xx_HAL_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */
#define __STM32F4xx_HAL_VERSION_RC (0x01) /*!< [7:0] release candidate */ #define __STM32F4xx_HAL_VERSION_RC (0x00) /*!< [7:0] release candidate */
#define __STM32F4xx_HAL_VERSION ((__STM32F4xx_HAL_VERSION_MAIN << 24)\ #define __STM32F4xx_HAL_VERSION ((__STM32F4xx_HAL_VERSION_MAIN << 24)\
|(__STM32F4xx_HAL_VERSION_SUB1 << 16)\ |(__STM32F4xx_HAL_VERSION_SUB1 << 16)\
|(__STM32F4xx_HAL_VERSION_SUB2 << 8 )\ |(__STM32F4xx_HAL_VERSION_SUB2 << 8 )\
@ -96,6 +94,7 @@
/* Private macro -------------------------------------------------------------*/ /* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/
static __IO uint32_t uwTick; static __IO uint32_t uwTick;
/* Private function prototypes -----------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/ /* Private functions ---------------------------------------------------------*/
@ -121,18 +120,20 @@ static __IO uint32_t uwTick;
*/ */
/** /**
* @brief This function configures the Flash prefetch, instruction and Data caches, * @brief This function is used to initialize the HAL Library; it must be the first
* Configures systick, NVIC and Low level hardware * instruction to be executed in the main program (before to call any other
* * HAL function), it performs the following:
* @note This function is called at the beginning of program after reset and before * - Configure the Flash prefetch, instruction and Data caches
* the clock configuration * - Configures the SysTick to generate an interrupt each 1 millisecond,
* * which is clocked by the HSI (at this stage, the clock is not yet
* @note The Systick configuration is based on HSI clock, as HSI is the clock * configured and thus the system is running from the internal HSI at 16 MHz)
* used after a system Reset and the NVIC configuration is set to Priority group 4 * - Set NVIC Group Priority to 4
* - Calls the HAL_MspInit() callback function defined in user file
* stm32f4xx_hal_msp.c to do the global low level hardware initialization
* *
* @note The Systick Interrupt is defined with the lowest priority in "core_cm4.h" file * @note SysTick is used as time base for the HAL_Delay() function, the application
* In this case HAL_Delay() must not be used under interrupt with higher priority. * need to ensure that the SysTick time base is always set to 1 millisecond
* * to have correct HAL operation.
* @note * @note
* @param None * @param None
* @retval HAL status * @retval HAL status
@ -247,8 +248,8 @@ __weak void HAL_MspDeInit(void)
*/ */
/** /**
* @brief This function is used when systick configuration should be changed. * @brief This function is called from SysTick ISR each 1 millisecond, to increment
* It is used to provide the HAL a timer base service. * a global variable "uwTick" used as time base.
* @param None * @param None
* @retval None * @retval None
*/ */
@ -258,7 +259,7 @@ void HAL_IncTick(void)
} }
/** /**
* @brief This method used to provide a tick value in millisecond. * @brief Povides a tick value in millisecond.
* @param Non * @param Non
* @retval tick value * @retval tick value
*/ */
@ -268,7 +269,13 @@ uint32_t HAL_GetTick(void)
} }
/** /**
* @brief This method used to provide blocking delay * @brief Provides a blocking delay in millisecond.
* @note Care must be taken when using HAL_Delay(), this function provides accurate delay
* (in milliseconds) based on variable incremented in SysTick ISR. This implies that
* if HAL_Delay() is called from a peripheral ISR process, then the SysTick interrupt
* must have higher priority (numerically lower) than the peripheral interrupt.
* Otherwise the caller ISR process will be blocked. To change the SysTick interrupt
* priority you have to use HAL_NVIC_SetPriority() function.
* @param Delay : specifies the delay time length, in milliseconds. * @param Delay : specifies the delay time length, in milliseconds.
* @retval None * @retval None
*/ */
@ -283,7 +290,7 @@ void HAL_Delay(__IO uint32_t Delay)
} }
/** /**
* @brief This method returns the HAL revision * @brief Returns the HAL revision
* @param None * @param None
* @retval version : 0xXYZR (8bits for each decimal, R for RC) * @retval version : 0xXYZR (8bits for each decimal, R for RC)
*/ */
@ -435,7 +442,6 @@ void HAL_DisableMemorySwappingBank(void)
* @} * @}
*/ */
#endif /* HAL_MODULE_ENABLED */
/** /**
* @} * @}
*/ */

View File

@ -2,8 +2,8 @@
****************************************************************************** ******************************************************************************
* @file stm32f4xx_hal.h * @file stm32f4xx_hal.h
* @author MCD Application Team * @author MCD Application Team
* @version V1.0.0RC2 * @version V1.0.0
* @date 04-February-2014 * @date 18-February-2014
* @brief This file contains all the functions prototypes for the HAL * @brief This file contains all the functions prototypes for the HAL
* module driver. * module driver.
****************************************************************************** ******************************************************************************
@ -109,40 +109,40 @@
/** @brief Main Flash memory mapped at 0x00000000 /** @brief Main Flash memory mapped at 0x00000000
*/ */
#define __HAL_REMAPMEMORY_FLASH (SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE)) #define __HAL_REMAPMEMORY_FLASH() (SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE))
/** @brief System Flash memory mapped at 0x00000000 /** @brief System Flash memory mapped at 0x00000000
*/ */
#define __HAL_REMAPMEMORY_SYSTEMFLASH do {SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE);\ #define __HAL_REMAPMEMORY_SYSTEMFLASH() do {SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE);\
SYSCFG->MEMRMP |= SYSCFG_MEMRMP_MEM_MODE_0;\ SYSCFG->MEMRMP |= SYSCFG_MEMRMP_MEM_MODE_0;\
}while(0); }while(0);
/** @brief Embedded SRAM mapped at 0x00000000 /** @brief Embedded SRAM mapped at 0x00000000
*/ */
#define __HAL_REMAPMEMORY_SRAM do {SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE);\ #define __HAL_REMAPMEMORY_SRAM() do {SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE);\
SYSCFG->MEMRMP |= (SYSCFG_MEMRMP_MEM_MODE_0 | SYSCFG_MEMRMP_MEM_MODE_1);\ SYSCFG->MEMRMP |= (SYSCFG_MEMRMP_MEM_MODE_0 | SYSCFG_MEMRMP_MEM_MODE_1);\
}while(0); }while(0);
#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx)|| defined(STM32F417xx) #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx)|| defined(STM32F417xx)
/** @brief FSMC Bank1 (NOR/PSRAM 1 and 2) mapped at 0x00000000 /** @brief FSMC Bank1 (NOR/PSRAM 1 and 2) mapped at 0x00000000
*/ */
#define __HAL_REMAPMEMORY_FSMC do {SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE);\ #define __HAL_REMAPMEMORY_FSMC() do {SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE);\
SYSCFG->MEMRMP |= (SYSCFG_MEMRMP_MEM_MODE_1);\ SYSCFG->MEMRMP |= (SYSCFG_MEMRMP_MEM_MODE_1);\
}while(0); }while(0);
#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx */ #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx */
#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx)
/** @brief FMC Bank1 (NOR/PSRAM 1 and 2) mapped at 0x00000000 /** @brief FMC Bank1 (NOR/PSRAM 1 and 2) mapped at 0x00000000
*/ */
#define __HAL_REMAPMEMORY_FMC do {SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE);\ #define __HAL_REMAPMEMORY_FMC() do {SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE);\
SYSCFG->MEMRMP |= (SYSCFG_MEMRMP_MEM_MODE_1);\ SYSCFG->MEMRMP |= (SYSCFG_MEMRMP_MEM_MODE_1);\
}while(0); }while(0);
/** @brief FMC/SDRAM Bank 1 and 2 mapped at 0x00000000 /** @brief FMC/SDRAM Bank 1 and 2 mapped at 0x00000000
*/ */
#define __HAL_REMAPMEMORY_FMC_SDRAM do {SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE);\ #define __HAL_REMAPMEMORY_FMC_SDRAM() do {SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE);\
SYSCFG->MEMRMP |= (SYSCFG_MEMRMP_MEM_MODE_2);\ SYSCFG->MEMRMP |= (SYSCFG_MEMRMP_MEM_MODE_2);\
}while(0); }while(0);
#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */
/* Exported functions --------------------------------------------------------*/ /* Exported functions --------------------------------------------------------*/
@ -150,8 +150,8 @@
/* Initialization and de-initialization functions ******************************/ /* Initialization and de-initialization functions ******************************/
HAL_StatusTypeDef HAL_Init(void); HAL_StatusTypeDef HAL_Init(void);
HAL_StatusTypeDef HAL_DeInit(void); HAL_StatusTypeDef HAL_DeInit(void);
__weak void HAL_MspInit(void); void HAL_MspInit(void);
__weak void HAL_MspDeInit(void); void HAL_MspDeInit(void);
/* Peripheral Control functions ************************************************/ /* Peripheral Control functions ************************************************/
void HAL_IncTick(void); void HAL_IncTick(void);

View File

@ -2,8 +2,8 @@
****************************************************************************** ******************************************************************************
* @file stm32f4xx_hal_adc.c * @file stm32f4xx_hal_adc.c
* @author MCD Application Team * @author MCD Application Team
* @version V1.0.0RC2 * @version V1.0.0
* @date 04-February-2014 * @date 18-February-2014
* @brief This file provides firmware functions to manage the following * @brief This file provides firmware functions to manage the following
* functionalities of the Analog to Digital Convertor (ADC) peripheral: * functionalities of the Analog to Digital Convertor (ADC) peripheral:
* + Initialization and de-initialization functions * + Initialization and de-initialization functions
@ -242,7 +242,10 @@ HAL_StatusTypeDef HAL_ADC_Init(ADC_HandleTypeDef* hadc)
/* Initialize the ADC state */ /* Initialize the ADC state */
hadc->State = HAL_ADC_STATE_READY; hadc->State = HAL_ADC_STATE_READY;
/* Release Lock */
__HAL_UNLOCK(hadc);
/* Return function status */ /* Return function status */
return HAL_OK; return HAL_OK;
} }

View File

@ -2,8 +2,8 @@
****************************************************************************** ******************************************************************************
* @file stm32f4xx_hal_adc.h * @file stm32f4xx_hal_adc.h
* @author MCD Application Team * @author MCD Application Team
* @version V1.0.0RC2 * @version V1.0.0
* @date 04-February-2014 * @date 18-February-2014
* @brief Header file of ADC HAL extension module. * @brief Header file of ADC HAL extension module.
****************************************************************************** ******************************************************************************
* @attention * @attention
@ -687,8 +687,8 @@ typedef struct
/* Initialization/de-initialization functions ***********************************/ /* Initialization/de-initialization functions ***********************************/
HAL_StatusTypeDef HAL_ADC_Init(ADC_HandleTypeDef* hadc); HAL_StatusTypeDef HAL_ADC_Init(ADC_HandleTypeDef* hadc);
HAL_StatusTypeDef HAL_ADC_DeInit(ADC_HandleTypeDef *hadc); HAL_StatusTypeDef HAL_ADC_DeInit(ADC_HandleTypeDef *hadc);
__weak void HAL_ADC_MspInit(ADC_HandleTypeDef* hadc); void HAL_ADC_MspInit(ADC_HandleTypeDef* hadc);
__weak void HAL_ADC_MspDeInit(ADC_HandleTypeDef* hadc); void HAL_ADC_MspDeInit(ADC_HandleTypeDef* hadc);
/* I/O operation functions ******************************************************/ /* I/O operation functions ******************************************************/
HAL_StatusTypeDef HAL_ADC_Start(ADC_HandleTypeDef* hadc); HAL_StatusTypeDef HAL_ADC_Start(ADC_HandleTypeDef* hadc);
@ -707,10 +707,10 @@ HAL_StatusTypeDef HAL_ADC_Stop_DMA(ADC_HandleTypeDef* hadc);
uint32_t HAL_ADC_GetValue(ADC_HandleTypeDef* hadc); uint32_t HAL_ADC_GetValue(ADC_HandleTypeDef* hadc);
__weak void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc); void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc);
__weak void HAL_ADC_ConvHalfCpltCallback(ADC_HandleTypeDef* hadc); void HAL_ADC_ConvHalfCpltCallback(ADC_HandleTypeDef* hadc);
__weak void HAL_ADC_LevelOutOfWindowCallback(ADC_HandleTypeDef* hadc); void HAL_ADC_LevelOutOfWindowCallback(ADC_HandleTypeDef* hadc);
__weak void HAL_ADC_ErrorCallback(ADC_HandleTypeDef *hadc); void HAL_ADC_ErrorCallback(ADC_HandleTypeDef *hadc);
/* Peripheral Control functions *************************************************/ /* Peripheral Control functions *************************************************/
HAL_StatusTypeDef HAL_ADC_ConfigChannel(ADC_HandleTypeDef* hadc, ADC_ChannelConfTypeDef* sConfig); HAL_StatusTypeDef HAL_ADC_ConfigChannel(ADC_HandleTypeDef* hadc, ADC_ChannelConfTypeDef* sConfig);

View File

@ -2,8 +2,8 @@
****************************************************************************** ******************************************************************************
* @file stm32f4xx_hal_adc_ex.c * @file stm32f4xx_hal_adc_ex.c
* @author MCD Application Team * @author MCD Application Team
* @version V1.0.0RC2 * @version V1.0.0
* @date 04-February-2014 * @date 18-February-2014
* @brief This file provides firmware functions to manage the following * @brief This file provides firmware functions to manage the following
* functionalities of the ADC extension peripheral: * functionalities of the ADC extension peripheral:
* + Extended features functions * + Extended features functions

View File

@ -2,8 +2,8 @@
****************************************************************************** ******************************************************************************
* @file stm32f4xx_hal_adc.h * @file stm32f4xx_hal_adc.h
* @author MCD Application Team * @author MCD Application Team
* @version V1.0.0RC2 * @version V1.0.0
* @date 04-February-2014 * @date 18-February-2014
* @brief Header file of ADC HAL module. * @brief Header file of ADC HAL module.
****************************************************************************** ******************************************************************************
* @attention * @attention
@ -264,7 +264,7 @@ uint32_t HAL_ADCEx_InjectedGetValue(ADC_HandleTypeDef* hadc, uint32_t I
HAL_StatusTypeDef HAL_ADCEx_MultiModeStart_DMA(ADC_HandleTypeDef* hadc, uint32_t* pData, uint32_t Length); HAL_StatusTypeDef HAL_ADCEx_MultiModeStart_DMA(ADC_HandleTypeDef* hadc, uint32_t* pData, uint32_t Length);
HAL_StatusTypeDef HAL_ADCEx_MultiModeStop_DMA(ADC_HandleTypeDef* hadc); HAL_StatusTypeDef HAL_ADCEx_MultiModeStop_DMA(ADC_HandleTypeDef* hadc);
uint32_t HAL_ADCEx_MultiModeGetValue(ADC_HandleTypeDef* hadc); uint32_t HAL_ADCEx_MultiModeGetValue(ADC_HandleTypeDef* hadc);
__weak void HAL_ADCEx_InjectedConvCpltCallback(ADC_HandleTypeDef* hadc); void HAL_ADCEx_InjectedConvCpltCallback(ADC_HandleTypeDef* hadc);
/* Peripheral Control functions *************************************************/ /* Peripheral Control functions *************************************************/
HAL_StatusTypeDef HAL_ADCEx_InjectedConfigChannel(ADC_HandleTypeDef* hadc,ADC_InjectionConfTypeDef* sConfigInjected); HAL_StatusTypeDef HAL_ADCEx_InjectedConfigChannel(ADC_HandleTypeDef* hadc,ADC_InjectionConfTypeDef* sConfigInjected);

View File

@ -2,8 +2,8 @@
****************************************************************************** ******************************************************************************
* @file stm32f4xx_hal_can.c * @file stm32f4xx_hal_can.c
* @author MCD Application Team * @author MCD Application Team
* @version V1.0.0RC2 * @version V1.0.0
* @date 04-February-2014 * @date 18-February-2014
* @brief This file provides firmware functions to manage the following * @brief This file provides firmware functions to manage the following
* functionalities of the Controller Area Network (CAN) peripheral: * functionalities of the Controller Area Network (CAN) peripheral:
* + Initialization and de-initialization functions * + Initialization and de-initialization functions
@ -459,7 +459,10 @@ HAL_StatusTypeDef HAL_CAN_DeInit(CAN_HandleTypeDef* hcan)
/* Change CAN state */ /* Change CAN state */
hcan->State = HAL_CAN_STATE_RESET; hcan->State = HAL_CAN_STATE_RESET;
/* Release Lock */
__HAL_UNLOCK(hcan);
/* Return function status */ /* Return function status */
return HAL_OK; return HAL_OK;
} }
@ -1166,7 +1169,7 @@ void HAL_CAN_IRQHandler(CAN_HandleTypeDef* hcan)
} }
/* Call the Error call Back in case of Errors */ /* Call the Error call Back in case of Errors */
if(hcan->ErrorCode != HAL_IRDA_ERROR_NONE) if(hcan->ErrorCode != HAL_CAN_ERROR_NONE)
{ {
/* Set the CAN state ready to be able to start again the process */ /* Set the CAN state ready to be able to start again the process */
hcan->State = HAL_CAN_STATE_READY; hcan->State = HAL_CAN_STATE_READY;

View File

@ -2,8 +2,8 @@
****************************************************************************** ******************************************************************************
* @file stm32f4xx_hal_can.h * @file stm32f4xx_hal_can.h
* @author MCD Application Team * @author MCD Application Team
* @version V1.0.0RC2 * @version V1.0.0
* @date 04-February-2014 * @date 18-February-2014
* @brief Header file of CAN HAL module. * @brief Header file of CAN HAL module.
****************************************************************************** ******************************************************************************
* @attention * @attention
@ -735,8 +735,8 @@ typedef struct
HAL_StatusTypeDef HAL_CAN_Init(CAN_HandleTypeDef* hcan); HAL_StatusTypeDef HAL_CAN_Init(CAN_HandleTypeDef* hcan);
HAL_StatusTypeDef HAL_CAN_ConfigFilter(CAN_HandleTypeDef* hcan, CAN_FilterConfTypeDef* sFilterConfig); HAL_StatusTypeDef HAL_CAN_ConfigFilter(CAN_HandleTypeDef* hcan, CAN_FilterConfTypeDef* sFilterConfig);
HAL_StatusTypeDef HAL_CAN_DeInit(CAN_HandleTypeDef* hcan); HAL_StatusTypeDef HAL_CAN_DeInit(CAN_HandleTypeDef* hcan);
__weak void HAL_CAN_MspInit(CAN_HandleTypeDef* hcan); void HAL_CAN_MspInit(CAN_HandleTypeDef* hcan);
__weak void HAL_CAN_MspDeInit(CAN_HandleTypeDef* hcan); void HAL_CAN_MspDeInit(CAN_HandleTypeDef* hcan);
/* I/O operation functions ******************************************************/ /* I/O operation functions ******************************************************/
HAL_StatusTypeDef HAL_CAN_Transmit(CAN_HandleTypeDef *hcan, uint32_t Timeout); HAL_StatusTypeDef HAL_CAN_Transmit(CAN_HandleTypeDef *hcan, uint32_t Timeout);
@ -751,9 +751,9 @@ void HAL_CAN_IRQHandler(CAN_HandleTypeDef* hcan);
uint32_t HAL_CAN_GetError(CAN_HandleTypeDef *hcan); uint32_t HAL_CAN_GetError(CAN_HandleTypeDef *hcan);
HAL_CAN_StateTypeDef HAL_CAN_GetState(CAN_HandleTypeDef* hcan); HAL_CAN_StateTypeDef HAL_CAN_GetState(CAN_HandleTypeDef* hcan);
__weak void HAL_CAN_TxCpltCallback(CAN_HandleTypeDef* hcan); void HAL_CAN_TxCpltCallback(CAN_HandleTypeDef* hcan);
__weak void HAL_CAN_RxCpltCallback(CAN_HandleTypeDef* hcan); void HAL_CAN_RxCpltCallback(CAN_HandleTypeDef* hcan);
__weak void HAL_CAN_ErrorCallback(CAN_HandleTypeDef *hcan); void HAL_CAN_ErrorCallback(CAN_HandleTypeDef *hcan);
#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */

View File

@ -2,8 +2,8 @@
****************************************************************************** ******************************************************************************
* @file stm32f4xx_hal_conf_template.h * @file stm32f4xx_hal_conf_template.h
* @author MCD Application Team * @author MCD Application Team
* @version V1.0.0RC2 * @version V1.0.0
* @date 04-February-2014 * @date 18-February-2014
* @brief HAL configuration template file. * @brief HAL configuration template file.
* This file should be copied to the application folder and renamed * This file should be copied to the application folder and renamed
* to stm32f4xx_hal_conf.h. * to stm32f4xx_hal_conf.h.

View File

@ -2,8 +2,8 @@
****************************************************************************** ******************************************************************************
* @file stm32f4xx_hal_cortex.c * @file stm32f4xx_hal_cortex.c
* @author MCD Application Team * @author MCD Application Team
* @version V1.0.0RC2 * @version V1.0.0
* @date 04-February-2014 * @date 18-February-2014
* @brief CORTEX HAL module driver. * @brief CORTEX HAL module driver.
* This file provides firmware functions to manage the following * This file provides firmware functions to manage the following
* functionalities of the CORTEX: * functionalities of the CORTEX:

View File

@ -2,8 +2,8 @@
****************************************************************************** ******************************************************************************
* @file stm32f4xx_hal_cortex.h * @file stm32f4xx_hal_cortex.h
* @author MCD Application Team * @author MCD Application Team
* @version V1.0.0RC2 * @version V1.0.0
* @date 04-February-2014 * @date 18-February-2014
* @brief Header file of CORTEX HAL module. * @brief Header file of CORTEX HAL module.
****************************************************************************** ******************************************************************************
* @attention * @attention
@ -143,7 +143,7 @@ void HAL_NVIC_ClearPendingIRQ(IRQn_Type IRQn);
uint32_t HAL_NVIC_GetActive(IRQn_Type IRQn); uint32_t HAL_NVIC_GetActive(IRQn_Type IRQn);
void HAL_SYSTICK_CLKSourceConfig(uint32_t CLKSource); void HAL_SYSTICK_CLKSourceConfig(uint32_t CLKSource);
void HAL_SYSTICK_IRQHandler(void); void HAL_SYSTICK_IRQHandler(void);
__weak void HAL_SYSTICK_Callback(void); void HAL_SYSTICK_Callback(void);
/** /**
* @} * @}

View File

@ -2,8 +2,8 @@
****************************************************************************** ******************************************************************************
* @file stm32f4xx_hal_crc.c * @file stm32f4xx_hal_crc.c
* @author MCD Application Team * @author MCD Application Team
* @version V1.0.0RC2 * @version V1.0.0
* @date 04-February-2014 * @date 18-February-2014
* @brief CRC HAL module driver. * @brief CRC HAL module driver.
* This file provides firmware functions to manage the following * This file provides firmware functions to manage the following
* functionalities of the Cyclic Redundancy Check (CRC) peripheral: * functionalities of the Cyclic Redundancy Check (CRC) peripheral:
@ -160,6 +160,9 @@ HAL_StatusTypeDef HAL_CRC_DeInit(CRC_HandleTypeDef *hcrc)
/* Change CRC peripheral state */ /* Change CRC peripheral state */
hcrc->State = HAL_CRC_STATE_RESET; hcrc->State = HAL_CRC_STATE_RESET;
/* Release Lock */
__HAL_UNLOCK(hcrc);
/* Return function status */ /* Return function status */
return HAL_OK; return HAL_OK;
} }

View File

@ -2,8 +2,8 @@
****************************************************************************** ******************************************************************************
* @file stm32f4xx_hal_crc.h * @file stm32f4xx_hal_crc.h
* @author MCD Application Team * @author MCD Application Team
* @version V1.0.0RC2 * @version V1.0.0
* @date 04-February-2014 * @date 18-February-2014
* @brief Header file of CRC HAL module. * @brief Header file of CRC HAL module.
****************************************************************************** ******************************************************************************
* @attention * @attention
@ -97,8 +97,8 @@ typedef struct
/* Initialization/de-initialization functions **********************************/ /* Initialization/de-initialization functions **********************************/
HAL_StatusTypeDef HAL_CRC_Init(CRC_HandleTypeDef *hcrc); HAL_StatusTypeDef HAL_CRC_Init(CRC_HandleTypeDef *hcrc);
HAL_StatusTypeDef HAL_CRC_DeInit (CRC_HandleTypeDef *hcrc); HAL_StatusTypeDef HAL_CRC_DeInit (CRC_HandleTypeDef *hcrc);
__weak void HAL_CRC_MspInit(CRC_HandleTypeDef *hcrc); void HAL_CRC_MspInit(CRC_HandleTypeDef *hcrc);
__weak void HAL_CRC_MspDeInit(CRC_HandleTypeDef *hcrc); void HAL_CRC_MspDeInit(CRC_HandleTypeDef *hcrc);
/* Peripheral Control functions ************************************************/ /* Peripheral Control functions ************************************************/
uint32_t HAL_CRC_Accumulate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength); uint32_t HAL_CRC_Accumulate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength);

View File

@ -2,8 +2,8 @@
****************************************************************************** ******************************************************************************
* @file stm32f4xx_hal_cryp.c * @file stm32f4xx_hal_cryp.c
* @author MCD Application Team * @author MCD Application Team
* @version V1.0.0RC2 * @version V1.0.0
* @date 04-February-2014 * @date 18-February-2014
* @brief CRYP HAL module driver. * @brief CRYP HAL module driver.
* This file provides firmware functions to manage the following * This file provides firmware functions to manage the following
* functionalities of the Cryptography (CRYP) peripheral: * functionalities of the Cryptography (CRYP) peripheral:
@ -233,7 +233,10 @@ HAL_StatusTypeDef HAL_CRYP_DeInit(CRYP_HandleTypeDef *hcryp)
/* Change the CRYP state */ /* Change the CRYP state */
hcryp->State = HAL_CRYP_STATE_RESET; hcryp->State = HAL_CRYP_STATE_RESET;
/* Release Lock */
__HAL_UNLOCK(hcryp);
/* Return function status */ /* Return function status */
return HAL_OK; return HAL_OK;
} }
@ -1038,7 +1041,7 @@ HAL_StatusTypeDef HAL_CRYP_AESECB_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t
/* Change state */ /* Change state */
hcryp->State = HAL_CRYP_STATE_TIMEOUT; hcryp->State = HAL_CRYP_STATE_TIMEOUT;
/* Process Unlocked */ /* Process Unlocked */
__HAL_UNLOCK(hcryp); __HAL_UNLOCK(hcryp);
return HAL_TIMEOUT; return HAL_TIMEOUT;

View File

@ -2,8 +2,8 @@
****************************************************************************** ******************************************************************************
* @file stm32f4xx_hal_cryp.h * @file stm32f4xx_hal_cryp.h
* @author MCD Application Team * @author MCD Application Team
* @version V1.0.0RC2 * @version V1.0.0
* @date 04-February-2014 * @date 18-February-2014
* @brief Header file of CRYP HAL module. * @brief Header file of CRYP HAL module.
****************************************************************************** ******************************************************************************
* @attention * @attention
@ -375,13 +375,13 @@ void HAL_CRYP_IRQHandler(CRYP_HandleTypeDef *hcryp);
HAL_CRYP_STATETypeDef HAL_CRYP_GetState(CRYP_HandleTypeDef *hcryp); HAL_CRYP_STATETypeDef HAL_CRYP_GetState(CRYP_HandleTypeDef *hcryp);
/* MSP functions *************************************************************/ /* MSP functions *************************************************************/
__weak void HAL_CRYP_MspInit(CRYP_HandleTypeDef *hcryp); void HAL_CRYP_MspInit(CRYP_HandleTypeDef *hcryp);
__weak void HAL_CRYP_MspDeInit(CRYP_HandleTypeDef *hcryp); void HAL_CRYP_MspDeInit(CRYP_HandleTypeDef *hcryp);
/* CallBack functions ********************************************************/ /* CallBack functions ********************************************************/
__weak void HAL_CRYP_InCpltCallback(CRYP_HandleTypeDef *hcryp); void HAL_CRYP_InCpltCallback(CRYP_HandleTypeDef *hcryp);
__weak void HAL_CRYP_OutCpltCallback(CRYP_HandleTypeDef *hcryp); void HAL_CRYP_OutCpltCallback(CRYP_HandleTypeDef *hcryp);
__weak void HAL_CRYP_ErrorCallback(CRYP_HandleTypeDef *hcryp); void HAL_CRYP_ErrorCallback(CRYP_HandleTypeDef *hcryp);
#endif /* STM32F415xx || STM32F417xx || STM32F437xx || STM32F439xx */ #endif /* STM32F415xx || STM32F417xx || STM32F437xx || STM32F439xx */

View File

@ -2,8 +2,8 @@
****************************************************************************** ******************************************************************************
* @file stm32f4xx_hal_cryp_ex.c * @file stm32f4xx_hal_cryp_ex.c
* @author MCD Application Team * @author MCD Application Team
* @version V1.0.0RC2 * @version V1.0.0
* @date 04-February-2014 * @date 18-February-2014
* @brief Extended CRYP HAL module driver * @brief Extended CRYP HAL module driver
* This file provides firmware functions to manage the following * This file provides firmware functions to manage the following
* functionalities of CRYP extension peripheral: * functionalities of CRYP extension peripheral:

View File

@ -2,8 +2,8 @@
****************************************************************************** ******************************************************************************
* @file stm32f4xx_hal_cryp_ex.h * @file stm32f4xx_hal_cryp_ex.h
* @author MCD Application Team * @author MCD Application Team
* @version V1.0.0RC2 * @version V1.0.0
* @date 04-February-2014 * @date 18-February-2014
* @brief Header file of CRYP HAL Extension module. * @brief Header file of CRYP HAL Extension module.
****************************************************************************** ******************************************************************************
* @attention * @attention

View File

@ -2,8 +2,8 @@
****************************************************************************** ******************************************************************************
* @file stm32f4xx_hal_dac.c * @file stm32f4xx_hal_dac.c
* @author MCD Application Team * @author MCD Application Team
* @version V1.0.0RC2 * @version V1.0.0
* @date 04-February-2014 * @date 18-February-2014
* @brief DAC HAL module driver. * @brief DAC HAL module driver.
* This file provides firmware functions to manage the following * This file provides firmware functions to manage the following
* functionalities of the Digital to Analog Converter (DAC) peripheral: * functionalities of the Digital to Analog Converter (DAC) peripheral:
@ -263,22 +263,25 @@ HAL_StatusTypeDef HAL_DAC_DeInit(DAC_HandleTypeDef* hdac)
{ {
return HAL_ERROR; return HAL_ERROR;
} }
/* Check the parameters */ /* Check the parameters */
assert_param(IS_DAC_ALL_INSTANCE(hdac->Instance)); assert_param(IS_DAC_ALL_INSTANCE(hdac->Instance));
/* Change DAC state */ /* Change DAC state */
hdac->State = HAL_DAC_STATE_BUSY; hdac->State = HAL_DAC_STATE_BUSY;
/* DeInit the low level hardware */ /* DeInit the low level hardware */
HAL_DAC_MspDeInit(hdac); HAL_DAC_MspDeInit(hdac);
/* Set DAC error code to none */ /* Set DAC error code to none */
hdac->ErrorCode = HAL_DAC_ERROR_NONE; hdac->ErrorCode = HAL_DAC_ERROR_NONE;
/* Change DAC state */ /* Change DAC state */
hdac->State = HAL_DAC_STATE_RESET; hdac->State = HAL_DAC_STATE_RESET;
/* Release Lock */
__HAL_UNLOCK(hdac);
/* Return function status */ /* Return function status */
return HAL_OK; return HAL_OK;
} }

View File

@ -2,8 +2,8 @@
****************************************************************************** ******************************************************************************
* @file stm32f4xx_hal_dac.h * @file stm32f4xx_hal_dac.h
* @author MCD Application Team * @author MCD Application Team
* @version V1.0.0RC2 * @version V1.0.0
* @date 04-February-2014 * @date 18-February-2014
* @brief Header file of DAC HAL module. * @brief Header file of DAC HAL module.
****************************************************************************** ******************************************************************************
* @attention * @attention
@ -253,8 +253,8 @@ typedef struct
/* Initialization/de-initialization functions ***********************************/ /* Initialization/de-initialization functions ***********************************/
HAL_StatusTypeDef HAL_DAC_Init(DAC_HandleTypeDef* hdac); HAL_StatusTypeDef HAL_DAC_Init(DAC_HandleTypeDef* hdac);
HAL_StatusTypeDef HAL_DAC_DeInit(DAC_HandleTypeDef* hdac); HAL_StatusTypeDef HAL_DAC_DeInit(DAC_HandleTypeDef* hdac);
__weak void HAL_DAC_MspInit(DAC_HandleTypeDef* hdac); void HAL_DAC_MspInit(DAC_HandleTypeDef* hdac);
__weak void HAL_DAC_MspDeInit(DAC_HandleTypeDef* hdac); void HAL_DAC_MspDeInit(DAC_HandleTypeDef* hdac);
/* I/O operation functions ******************************************************/ /* I/O operation functions ******************************************************/
HAL_StatusTypeDef HAL_DAC_Start(DAC_HandleTypeDef* hdac, uint32_t Channel); HAL_StatusTypeDef HAL_DAC_Start(DAC_HandleTypeDef* hdac, uint32_t Channel);
@ -272,10 +272,10 @@ HAL_DAC_StateTypeDef HAL_DAC_GetState(DAC_HandleTypeDef* hdac);
void HAL_DAC_IRQHandler(DAC_HandleTypeDef* hdac); void HAL_DAC_IRQHandler(DAC_HandleTypeDef* hdac);
uint32_t HAL_DAC_GetError(DAC_HandleTypeDef *hdac); uint32_t HAL_DAC_GetError(DAC_HandleTypeDef *hdac);
__weak void HAL_DAC_ConvCpltCallbackCh1(DAC_HandleTypeDef* hdac); void HAL_DAC_ConvCpltCallbackCh1(DAC_HandleTypeDef* hdac);
__weak void HAL_DAC_ConvHalfCpltCallbackCh1(DAC_HandleTypeDef* hdac); void HAL_DAC_ConvHalfCpltCallbackCh1(DAC_HandleTypeDef* hdac);
__weak void HAL_DAC_ErrorCallbackCh1(DAC_HandleTypeDef *hdac); void HAL_DAC_ErrorCallbackCh1(DAC_HandleTypeDef *hdac);
__weak void HAL_DAC_DMAUnderrunCallbackCh1(DAC_HandleTypeDef *hdac); void HAL_DAC_DMAUnderrunCallbackCh1(DAC_HandleTypeDef *hdac);
#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */

View File

@ -2,8 +2,8 @@
****************************************************************************** ******************************************************************************
* @file stm32f4xx_hal_dac_ex.c * @file stm32f4xx_hal_dac_ex.c
* @author MCD Application Team * @author MCD Application Team
* @version V1.0.0RC2 * @version V1.0.0
* @date 04-February-2014 * @date 18-February-2014
* @brief DAC HAL module driver. * @brief DAC HAL module driver.
* This file provides firmware functions to manage the following * This file provides firmware functions to manage the following
* functionalities of DAC extension peripheral: * functionalities of DAC extension peripheral:

View File

@ -2,8 +2,8 @@
****************************************************************************** ******************************************************************************
* @file stm32f4xx_hal_dac.h * @file stm32f4xx_hal_dac.h
* @author MCD Application Team * @author MCD Application Team
* @version V1.0.0RC2 * @version V1.0.0
* @date 04-February-2014 * @date 18-February-2014
* @brief Header file of DAC HAL Extension module. * @brief Header file of DAC HAL Extension module.
****************************************************************************** ******************************************************************************
* @attention * @attention
@ -155,10 +155,10 @@ HAL_StatusTypeDef HAL_DACEx_TriangleWaveGenerate(DAC_HandleTypeDef* hdac, uint32
HAL_StatusTypeDef HAL_DACEx_NoiseWaveGenerate(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t Amplitude); HAL_StatusTypeDef HAL_DACEx_NoiseWaveGenerate(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t Amplitude);
HAL_StatusTypeDef HAL_DACEx_DualSetValue(DAC_HandleTypeDef* hdac, uint32_t Alignment, uint32_t Data1, uint32_t Data2); HAL_StatusTypeDef HAL_DACEx_DualSetValue(DAC_HandleTypeDef* hdac, uint32_t Alignment, uint32_t Data1, uint32_t Data2);
__weak void HAL_DACEx_ConvCpltCallbackCh2(DAC_HandleTypeDef* hdac); void HAL_DACEx_ConvCpltCallbackCh2(DAC_HandleTypeDef* hdac);
__weak void HAL_DACEx_ConvHalfCpltCallbackCh2(DAC_HandleTypeDef* hdac); void HAL_DACEx_ConvHalfCpltCallbackCh2(DAC_HandleTypeDef* hdac);
__weak void HAL_DACEx_ErrorCallbackCh2(DAC_HandleTypeDef* hdac); void HAL_DACEx_ErrorCallbackCh2(DAC_HandleTypeDef* hdac);
__weak void HAL_DACEx_DMAUnderrunCallbackCh2(DAC_HandleTypeDef* hdac); void HAL_DACEx_DMAUnderrunCallbackCh2(DAC_HandleTypeDef* hdac);
void DAC_DMAConvCpltCh2(DMA_HandleTypeDef *hdma); void DAC_DMAConvCpltCh2(DMA_HandleTypeDef *hdma);
void DAC_DMAErrorCh2(DMA_HandleTypeDef *hdma); void DAC_DMAErrorCh2(DMA_HandleTypeDef *hdma);

View File

@ -2,8 +2,8 @@
****************************************************************************** ******************************************************************************
* @file stm32f4xx_hal_dcmi.c * @file stm32f4xx_hal_dcmi.c
* @author MCD Application Team * @author MCD Application Team
* @version V1.0.0RC2 * @version V1.0.0
* @date 04-February-2014 * @date 18-February-2014
* @brief DCMI HAL module driver * @brief DCMI HAL module driver
* This file provides firmware functions to manage the following * This file provides firmware functions to manage the following
* functionalities of the Digital Camera Interface (DCMI) peripheral: * functionalities of the Digital Camera Interface (DCMI) peripheral:
@ -54,7 +54,7 @@
(+) __HAL_DCMI_CLEAR_FLAG: Clear the DCMI pending flags. (+) __HAL_DCMI_CLEAR_FLAG: Clear the DCMI pending flags.
(+) __HAL_DCMI_ENABLE_IT: Enable the specified DCMI interrupts. (+) __HAL_DCMI_ENABLE_IT: Enable the specified DCMI interrupts.
(+) __HAL_DCMI_DISABLE_IT: Disable the specified DCMI interrupts. (+) __HAL_DCMI_DISABLE_IT: Disable the specified DCMI interrupts.
(+) __HAL_DCMI_IT_STATUS: Check whether the specified DCMI interrupt has occurred or not. (+) __HAL_DCMI_GET_IT_SOURCE: Check whether the specified DCMI interrupt has occurred or not.
[..] [..]
(@) You can refer to the DCMI HAL driver header file for more useful macros (@) You can refer to the DCMI HAL driver header file for more useful macros
@ -110,8 +110,8 @@
/* Private macro -------------------------------------------------------------*/ /* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/
static void HAL_DCMI_DMAConvCplt(DMA_HandleTypeDef *hdma); static void DCMI_DMAConvCplt(DMA_HandleTypeDef *hdma);
static void HAL_DCMI_DMAError(DMA_HandleTypeDef *hdma); static void DCMI_DMAError(DMA_HandleTypeDef *hdma);
/* Private functions ---------------------------------------------------------*/ /* Private functions ---------------------------------------------------------*/
@ -231,6 +231,9 @@ HAL_StatusTypeDef HAL_DCMI_DeInit(DCMI_HandleTypeDef *hdcmi)
/* Initialize the DCMI state*/ /* Initialize the DCMI state*/
hdcmi->State = HAL_DCMI_STATE_RESET; hdcmi->State = HAL_DCMI_STATE_RESET;
/* Release Lock */
__HAL_UNLOCK(hdcmi);
return HAL_OK; return HAL_OK;
} }
@ -311,10 +314,10 @@ HAL_StatusTypeDef HAL_DCMI_Start_DMA(DCMI_HandleTypeDef* hdcmi, uint32_t DCMI_Mo
hdcmi->Instance->CR |= (uint32_t)(DCMI_Mode); hdcmi->Instance->CR |= (uint32_t)(DCMI_Mode);
/* Set the DMA memory0 conversion complete callback */ /* Set the DMA memory0 conversion complete callback */
hdcmi->DMA_Handle->XferCpltCallback = HAL_DCMI_DMAConvCplt; hdcmi->DMA_Handle->XferCpltCallback = DCMI_DMAConvCplt;
/* Set the DMA error callback */ /* Set the DMA error callback */
hdcmi->DMA_Handle->XferErrorCallback = HAL_DCMI_DMAError; hdcmi->DMA_Handle->XferErrorCallback = DCMI_DMAError;
if(Length <= 0xFFFF) if(Length <= 0xFFFF)
{ {
@ -324,7 +327,7 @@ HAL_StatusTypeDef HAL_DCMI_Start_DMA(DCMI_HandleTypeDef* hdcmi, uint32_t DCMI_Mo
else /* DCMI_DOUBLE_BUFFER Mode */ else /* DCMI_DOUBLE_BUFFER Mode */
{ {
/* Set the DMA memory1 conversion complete callback */ /* Set the DMA memory1 conversion complete callback */
hdcmi->DMA_Handle->XferM1CpltCallback = HAL_DCMI_DMAConvCplt; hdcmi->DMA_Handle->XferM1CpltCallback = DCMI_DMAConvCplt;
/* Initialise transfer parameters */ /* Initialise transfer parameters */
hdcmi->XferCount = 1; hdcmi->XferCount = 1;
@ -421,7 +424,7 @@ void HAL_DCMI_IRQHandler(DCMI_HandleTypeDef *hdcmi)
/* Synchronization error interrupt management *******************************/ /* Synchronization error interrupt management *******************************/
if(__HAL_DCMI_GET_FLAG(hdcmi, DCMI_FLAG_ERRRI) != RESET) if(__HAL_DCMI_GET_FLAG(hdcmi, DCMI_FLAG_ERRRI) != RESET)
{ {
if(__HAL_DCMI_IT_STATUS(hdcmi, DCMI_IT_ERR) != RESET) if(__HAL_DCMI_GET_IT_SOURCE(hdcmi, DCMI_IT_ERR) != RESET)
{ {
/* Disable the Synchronization error interrupt */ /* Disable the Synchronization error interrupt */
__HAL_DCMI_DISABLE_IT(hdcmi, DCMI_IT_ERR); __HAL_DCMI_DISABLE_IT(hdcmi, DCMI_IT_ERR);
@ -448,7 +451,7 @@ void HAL_DCMI_IRQHandler(DCMI_HandleTypeDef *hdcmi)
/* Overflow interrupt management ********************************************/ /* Overflow interrupt management ********************************************/
if(__HAL_DCMI_GET_FLAG(hdcmi, DCMI_FLAG_OVFRI) != RESET) if(__HAL_DCMI_GET_FLAG(hdcmi, DCMI_FLAG_OVFRI) != RESET)
{ {
if(__HAL_DCMI_IT_STATUS(hdcmi, DCMI_IT_OVF) != RESET) if(__HAL_DCMI_GET_IT_SOURCE(hdcmi, DCMI_IT_OVF) != RESET)
{ {
/* Disable the Overflow interrupt */ /* Disable the Overflow interrupt */
__HAL_DCMI_DISABLE_IT(hdcmi, DCMI_IT_OVF); __HAL_DCMI_DISABLE_IT(hdcmi, DCMI_IT_OVF);
@ -475,7 +478,7 @@ void HAL_DCMI_IRQHandler(DCMI_HandleTypeDef *hdcmi)
/* Line Interrupt management ************************************************/ /* Line Interrupt management ************************************************/
if(__HAL_DCMI_GET_FLAG(hdcmi, DCMI_FLAG_LINERI) != RESET) if(__HAL_DCMI_GET_FLAG(hdcmi, DCMI_FLAG_LINERI) != RESET)
{ {
if(__HAL_DCMI_IT_STATUS(hdcmi, DCMI_IT_LINE) != RESET) if(__HAL_DCMI_GET_IT_SOURCE(hdcmi, DCMI_IT_LINE) != RESET)
{ {
/* Clear the Line interrupt flag */ /* Clear the Line interrupt flag */
__HAL_DCMI_CLEAR_FLAG(hdcmi, DCMI_FLAG_LINERI); __HAL_DCMI_CLEAR_FLAG(hdcmi, DCMI_FLAG_LINERI);
@ -490,7 +493,7 @@ void HAL_DCMI_IRQHandler(DCMI_HandleTypeDef *hdcmi)
/* VSYNC interrupt management ***********************************************/ /* VSYNC interrupt management ***********************************************/
if(__HAL_DCMI_GET_FLAG(hdcmi, DCMI_FLAG_VSYNCRI) != RESET) if(__HAL_DCMI_GET_FLAG(hdcmi, DCMI_FLAG_VSYNCRI) != RESET)
{ {
if(__HAL_DCMI_IT_STATUS(hdcmi, DCMI_IT_VSYNC) != RESET) if(__HAL_DCMI_GET_IT_SOURCE(hdcmi, DCMI_IT_VSYNC) != RESET)
{ {
/* Disable the VSYNC interrupt */ /* Disable the VSYNC interrupt */
__HAL_DCMI_DISABLE_IT(hdcmi, DCMI_IT_VSYNC); __HAL_DCMI_DISABLE_IT(hdcmi, DCMI_IT_VSYNC);
@ -508,7 +511,7 @@ void HAL_DCMI_IRQHandler(DCMI_HandleTypeDef *hdcmi)
/* End of Frame interrupt management ****************************************/ /* End of Frame interrupt management ****************************************/
if(__HAL_DCMI_GET_FLAG(hdcmi, DCMI_FLAG_FRAMERI) != RESET) if(__HAL_DCMI_GET_FLAG(hdcmi, DCMI_FLAG_FRAMERI) != RESET)
{ {
if(__HAL_DCMI_IT_STATUS(hdcmi, DCMI_IT_FRAME) != RESET) if(__HAL_DCMI_GET_IT_SOURCE(hdcmi, DCMI_IT_FRAME) != RESET)
{ {
/* Disable the End of Frame interrupt */ /* Disable the End of Frame interrupt */
__HAL_DCMI_DISABLE_IT(hdcmi, DCMI_IT_FRAME); __HAL_DCMI_DISABLE_IT(hdcmi, DCMI_IT_FRAME);
@ -736,7 +739,7 @@ uint32_t HAL_DCMI_GetError(DCMI_HandleTypeDef *hdcmi)
* @param hdma: pointer to DMA handle. * @param hdma: pointer to DMA handle.
* @retval None * @retval None
*/ */
static void HAL_DCMI_DMAConvCplt(DMA_HandleTypeDef *hdma) static void DCMI_DMAConvCplt(DMA_HandleTypeDef *hdma)
{ {
uint32_t tmp = 0; uint32_t tmp = 0;
@ -789,7 +792,7 @@ static void HAL_DCMI_DMAConvCplt(DMA_HandleTypeDef *hdma)
* @param hdma: pointer to DMA handle. * @param hdma: pointer to DMA handle.
* @retval None * @retval None
*/ */
static void HAL_DCMI_DMAError(DMA_HandleTypeDef *hdma) static void DCMI_DMAError(DMA_HandleTypeDef *hdma)
{ {
DCMI_HandleTypeDef* hdcmi = ( DCMI_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; DCMI_HandleTypeDef* hdcmi = ( DCMI_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent;
hdcmi->State= HAL_DCMI_STATE_READY; hdcmi->State= HAL_DCMI_STATE_READY;

View File

@ -2,8 +2,8 @@
****************************************************************************** ******************************************************************************
* @file stm32f4xx_hal_dcmi.h * @file stm32f4xx_hal_dcmi.h
* @author MCD Application Team * @author MCD Application Team
* @version V1.0.0RC2 * @version V1.0.0
* @date 04-February-2014 * @date 18-February-2014
* @brief Header file of DCMI HAL module. * @brief Header file of DCMI HAL module.
****************************************************************************** ******************************************************************************
* @attention * @attention
@ -453,23 +453,23 @@ typedef struct
* @arg DCMI_IT_LINE: Line interrupt mask * @arg DCMI_IT_LINE: Line interrupt mask
* @retval The state of INTERRUPT. * @retval The state of INTERRUPT.
*/ */
#define __HAL_DCMI_IT_STATUS(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->MISR & (__INTERRUPT__)) #define __HAL_DCMI_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->MISR & (__INTERRUPT__))
/* Exported functions --------------------------------------------------------*/ /* Exported functions --------------------------------------------------------*/
/* Initialization and de-initialization functions *******************************/ /* Initialization and de-initialization functions *******************************/
HAL_StatusTypeDef HAL_DCMI_Init(DCMI_HandleTypeDef *hdcmi); HAL_StatusTypeDef HAL_DCMI_Init(DCMI_HandleTypeDef *hdcmi);
HAL_StatusTypeDef HAL_DCMI_DeInit(DCMI_HandleTypeDef *hdcmi); HAL_StatusTypeDef HAL_DCMI_DeInit(DCMI_HandleTypeDef *hdcmi);
__weak void HAL_DCMI_MspInit(DCMI_HandleTypeDef* hdcmi); void HAL_DCMI_MspInit(DCMI_HandleTypeDef* hdcmi);
__weak void HAL_DCMI_MspDeInit(DCMI_HandleTypeDef* hdcmi); void HAL_DCMI_MspDeInit(DCMI_HandleTypeDef* hdcmi);
/* IO operation functions *******************************************************/ /* IO operation functions *******************************************************/
HAL_StatusTypeDef HAL_DCMI_Start_DMA(DCMI_HandleTypeDef* hdcmi, uint32_t DCMI_Mode, uint32_t pData, uint32_t Length); HAL_StatusTypeDef HAL_DCMI_Start_DMA(DCMI_HandleTypeDef* hdcmi, uint32_t DCMI_Mode, uint32_t pData, uint32_t Length);
HAL_StatusTypeDef HAL_DCMI_Stop(DCMI_HandleTypeDef* hdcmi); HAL_StatusTypeDef HAL_DCMI_Stop(DCMI_HandleTypeDef* hdcmi);
__weak void HAL_DCMI_ErrorCallback(DCMI_HandleTypeDef *hdcmi); void HAL_DCMI_ErrorCallback(DCMI_HandleTypeDef *hdcmi);
__weak void HAL_DCMI_LineEventCallback(DCMI_HandleTypeDef *hdcmi); void HAL_DCMI_LineEventCallback(DCMI_HandleTypeDef *hdcmi);
__weak void HAL_DCMI_FrameEventCallback(DCMI_HandleTypeDef *hdcmi); void HAL_DCMI_FrameEventCallback(DCMI_HandleTypeDef *hdcmi);
__weak void HAL_DCMI_VsyncEventCallback(DCMI_HandleTypeDef *hdcmi); void HAL_DCMI_VsyncEventCallback(DCMI_HandleTypeDef *hdcmi);
void HAL_DCMI_IRQHandler(DCMI_HandleTypeDef *hdcmi); void HAL_DCMI_IRQHandler(DCMI_HandleTypeDef *hdcmi);
/* Peripheral Control functions *************************************************/ /* Peripheral Control functions *************************************************/

View File

@ -2,8 +2,8 @@
****************************************************************************** ******************************************************************************
* @file stm32f4xx_hal_def.h * @file stm32f4xx_hal_def.h
* @author MCD Application Team * @author MCD Application Team
* @version V1.0.0RC2 * @version V1.0.0
* @date 04-February-2014 * @date 18-February-2014
* @brief This file contains HAL common defines, enumeration, macros and * @brief This file contains HAL common defines, enumeration, macros and
* structures definitions. * structures definitions.
****************************************************************************** ******************************************************************************
@ -115,7 +115,30 @@ typedef enum
#endif /* __packed */ #endif /* __packed */
#endif /* __GNUC__ */ #endif /* __GNUC__ */
/* Macro to get variable aligned on 4-bytes, for __ICCARM__ the directive "#pragma data_alignment=4" must be used instead */
#if defined (__GNUC__) /* GNU Compiler */
#ifndef __ALIGN_END
#define __ALIGN_END __attribute__ ((aligned (4)))
#endif /* __ALIGN_END */
#ifndef __ALIGN_BEGIN
#define __ALIGN_BEGIN
#endif /* __ALIGN_BEGIN */
#else
#ifndef __ALIGN_END
#define __ALIGN_END
#endif /* __ALIGN_END */
#ifndef __ALIGN_BEGIN
#if defined (__CC_ARM) /* ARM Compiler */
#define __ALIGN_BEGIN __align(4)
#elif defined (__ICCARM__) /* IAR Compiler */
#define __ALIGN_BEGIN
#elif defined (__TASKING__) /* TASKING Compiler */
#define __ALIGN_BEGIN __align(4)
#endif /* __CC_ARM */
#endif /* __ALIGN_BEGIN */
#endif /* __GNUC__ */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif