Skip to content

Target STM32F3 #2097

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions hal/targets/cmsis/TARGET_STM/TARGET_STM32F3/stm32_hal_legacy.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
******************************************************************************
* @file stm32_hal_legacy.h
* @author MCD Application Team
* @version V1.2.1
* @date 29-April-2015
* @version V1.3.0
* @date 01-July-2016
* @brief This file contains aliases definition for the STM32Cube HAL constants
* macros and functions maintained for legacy purpose.
******************************************************************************
Expand Down Expand Up @@ -150,6 +150,9 @@
#define COMP_NONINVERTINGINPUT_IO1 COMP_INPUT_PLUS_IO1
#define COMP_NONINVERTINGINPUT_IO2 COMP_INPUT_PLUS_IO2
#define COMP_NONINVERTINGINPUT_IO3 COMP_INPUT_PLUS_IO3
#define COMP_NONINVERTINGINPUT_IO4 COMP_INPUT_PLUS_IO4
#define COMP_NONINVERTINGINPUT_IO5 COMP_INPUT_PLUS_IO5
#define COMP_NONINVERTINGINPUT_IO6 COMP_INPUT_PLUS_IO6

#define COMP_INVERTINGINPUT_1_4VREFINT COMP_INPUT_MINUS_1_4VREFINT
#define COMP_INVERTINGINPUT_1_2VREFINT COMP_INPUT_MINUS_1_2VREFINT
Expand All @@ -160,8 +163,16 @@
#define COMP_INVERTINGINPUT_DAC1 COMP_INPUT_MINUS_DAC1_CH1
#define COMP_INVERTINGINPUT_DAC2 COMP_INPUT_MINUS_DAC1_CH2
#define COMP_INVERTINGINPUT_IO1 COMP_INPUT_MINUS_IO1
#if defined(STM32L0)
/* Issue fixed on STM32L0 COMP driver: only 2 dedicated IO (IO1 and IO2), */
/* IO2 was wrongly assigned to IO shared with DAC and IO3 was corresponding */
/* to the second dedicated IO (only for COMP2). */
#define COMP_INVERTINGINPUT_IO2 COMP_INPUT_MINUS_DAC1_CH2
#define COMP_INVERTINGINPUT_IO3 COMP_INPUT_MINUS_IO2
#else
#define COMP_INVERTINGINPUT_IO2 COMP_INPUT_MINUS_IO2
#define COMP_INVERTINGINPUT_IO3 COMP_INPUT_MINUS_IO3
#endif
#define COMP_INVERTINGINPUT_IO4 COMP_INPUT_MINUS_IO4
#define COMP_INVERTINGINPUT_IO5 COMP_INPUT_MINUS_IO5

Expand Down
10 changes: 5 additions & 5 deletions hal/targets/cmsis/TARGET_STM/TARGET_STM32F3/stm32f3xx_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f3xx_hal.c
* @author MCD Application Team
* @version V1.2.1
* @date 29-April-2015
* @version V1.3.0
* @date 01-July-2016
* @brief HAL module driver.
* This is the common part of the HAL initialization
*
Expand Down Expand Up @@ -70,11 +70,11 @@
* @{
*/
/**
* @brief STM32F3xx HAL Driver version number V1.2.1
* @brief STM32F3xx HAL Driver version number V1.3.0
*/
#define __STM32F3xx_HAL_VERSION_MAIN (0x01) /*!< [31:24] main version */
#define __STM32F3xx_HAL_VERSION_SUB1 (0x02) /*!< [23:16] sub1 version */
#define __STM32F3xx_HAL_VERSION_SUB2 (0x01) /*!< [15:8] sub2 version */
#define __STM32F3xx_HAL_VERSION_SUB1 (0x03) /*!< [23:16] sub1 version */
#define __STM32F3xx_HAL_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */
#define __STM32F3xx_HAL_VERSION_RC (0x00) /*!< [7:0] release candidate */
#define __STM32F3xx_HAL_VERSION ((__STM32F3xx_HAL_VERSION_MAIN << 24)\
|(__STM32F3xx_HAL_VERSION_SUB1 << 16)\
Expand Down
4 changes: 2 additions & 2 deletions hal/targets/cmsis/TARGET_STM/TARGET_STM32F3/stm32f3xx_hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f3xx_hal.h
* @author MCD Application Team
* @version V1.2.1
* @date 29-April-2015
* @version V1.3.0
* @date 01-July-2016
* @brief This file contains all the functions prototypes for the HAL
* module driver.
******************************************************************************
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f3xx_hal_adc.c
* @author MCD Application Team
* @version V1.2.1
* @date 29-April-2015
* @version V1.3.0
* @date 01-July-2016
* @brief This file provides firmware functions to manage the following
* functionalities of the Analog to Digital Convertor (ADC)
* peripheral:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f3xx_hal_adc.h
* @author MCD Application Team
* @version V1.2.1
* @date 29-April-2015
* @version V1.3.0
* @date 01-July-2016
* @brief Header file containing functions prototypes of ADC HAL library.
******************************************************************************
* @attention
Expand Down
77 changes: 47 additions & 30 deletions hal/targets/cmsis/TARGET_STM/TARGET_STM32F3/stm32f3xx_hal_adc_ex.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f3xx_hal_adc_ex.c
* @author MCD Application Team
* @version V1.2.1
* @date 29-April-2015
* @version V1.3.0
* @date 01-July-2016
* @brief This file provides firmware functions to manage the following
* functionalities of the Analog to Digital Convertor (ADC)
* peripheral:
Expand Down Expand Up @@ -6941,8 +6941,11 @@ HAL_StatusTypeDef HAL_ADCEx_MultiModeConfigChannel(ADC_HandleTypeDef* hadc, ADC_
/* Check the parameters */
assert_param(IS_ADC_MULTIMODE_MASTER_INSTANCE(hadc->Instance));
assert_param(IS_ADC_MODE(multimode->Mode));
assert_param(IS_ADC_DMA_ACCESS_MODE(multimode->DMAAccessMode));
assert_param(IS_ADC_SAMPLING_DELAY(multimode->TwoSamplingDelay));
if(multimode->Mode != ADC_MODE_INDEPENDENT)
{
assert_param(IS_ADC_DMA_ACCESS_MODE(multimode->DMAAccessMode));
assert_param(IS_ADC_SAMPLING_DELAY(multimode->TwoSamplingDelay));
}

/* Process locked */
__HAL_LOCK(hadc);
Expand All @@ -6964,31 +6967,22 @@ HAL_StatusTypeDef HAL_ADCEx_MultiModeConfigChannel(ADC_HandleTypeDef* hadc, ADC_
/* control registers) */
tmpADC_Common = ADC_COMMON_REGISTER(hadc);

/* Configuration of ADC common group ADC1&ADC2, ADC3&ADC4 if available */
/* (ADC2, ADC3, ADC4 availability depends on STM32 product) */
/* - DMA access mode */
MODIFY_REG(tmpADC_Common->CCR ,
ADC_CCR_MDMA |
ADC_CCR_DMACFG ,
multimode->DMAAccessMode |
ADC_CCR_MULTI_DMACONTREQ(hadc->Init.DMAContinuousRequests) );

/* Parameters that can be updated only when ADC is disabled: */
/* - Multimode mode selection */
/* - Multimode delay */
/* Note: If ADC is not in the appropriate state to modify these */
/* parameters, their setting is bypassed without error reporting */
/* (as it can be the expected behaviour in case of intended action */
/* to update parameter above (which fulfills the ADC state */
/* condition: no conversion on going on group regular) */
/* on the fly). */
if ((ADC_IS_ENABLE(hadc) == RESET) &&
(ADC_IS_ENABLE(&tmphadcSharingSameCommonRegister) == RESET) )
/* If multimode is selected, configure all multimode paramaters. */
/* Otherwise, reset multimode parameters (can be used in case of */
/* transition from multimode to independent mode). */
if(multimode->Mode != ADC_MODE_INDEPENDENT)
{
/* Configuration of ADC common group ADC1&ADC2, ADC3&ADC4 if available */
/* (ADC2, ADC3, ADC4 availability depends on STM32 product) */
/* - set the selected multimode */
/* - DMA access mode */
MODIFY_REG(tmpADC_Common->CCR ,
ADC_CCR_MDMA |
ADC_CCR_DMACFG ,
multimode->DMAAccessMode |
ADC_CCR_MULTI_DMACONTREQ(hadc->Init.DMAContinuousRequests) );

/* Parameters that can be updated only when ADC is disabled: */
/* - Multimode mode selection */
/* - Set delay between two sampling phases */
/* Note: Delay range depends on selected resolution: */
/* from 1 to 12 clock cycles for 12 bits */
Expand All @@ -6997,11 +6991,34 @@ HAL_StatusTypeDef HAL_ADCEx_MultiModeConfigChannel(ADC_HandleTypeDef* hadc, ADC_
/* from 1 to 6 clock cycles for 6 bits */
/* If a higher delay is selected, it will be clamped to maximum delay */
/* range */
MODIFY_REG(tmpADC_Common->CCR ,
ADC_CCR_MULTI |
ADC_CCR_DELAY ,
multimode->Mode |
multimode->TwoSamplingDelay );
/* Note: If ADC is not in the appropriate state to modify these */
/* parameters, their setting is bypassed without error reporting */
/* (as it can be the expected behaviour in case of intended action */
/* to update parameter above (which fulfills the ADC state */
/* condition: no conversion on going on group regular) */
/* on the fly). */
if ((ADC_IS_ENABLE(hadc) == RESET) &&
(ADC_IS_ENABLE(&tmphadcSharingSameCommonRegister) == RESET) )
{
MODIFY_REG(tmpADC_Common->CCR ,
ADC_CCR_MULTI |
ADC_CCR_DELAY ,
multimode->Mode |
multimode->TwoSamplingDelay );
}
}
else /* ADC_MODE_INDEPENDENT */
{
CLEAR_BIT(tmpADC_Common->CCR, ADC_CCR_MDMA | ADC_CCR_DMACFG);

/* Parameters that can be updated only when ADC is disabled: */
/* - Multimode mode selection */
/* - Multimode delay */
if ((ADC_IS_ENABLE(hadc) == RESET) &&
(ADC_IS_ENABLE(&tmphadcSharingSameCommonRegister) == RESET) )
{
CLEAR_BIT(tmpADC_Common->CCR, ADC_CCR_MULTI | ADC_CCR_DELAY);
}
}
}
/* If one of the ADC sharing the same common group is enabled, no update */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f3xx_hal_adc_ex.h
* @author MCD Application Team
* @version V1.2.1
* @date 29-April-2015
* @version V1.3.0
* @date 01-July-2016
* @brief Header file containing functions prototypes of ADC HAL library.
******************************************************************************
* @attention
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f3xx_hal_can.c
* @author MCD Application Team
* @version V1.2.1
* @date 29-April-2015
* @version V1.3.0
* @date 01-July-2016
* @brief CAN HAL module driver.
* This file provides firmware functions to manage the following
* functionalities of the Controller Area Network (CAN) peripheral:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f3xx_hal_can.h
* @author MCD Application Team
* @version V1.2.1
* @date 29-April-2015
* @version V1.3.0
* @date 01-July-2016
* @brief Header file of CAN HAL module.
******************************************************************************
* @attention
Expand Down Expand Up @@ -239,7 +239,7 @@ typedef struct
__IO HAL_CAN_StateTypeDef State; /*!< CAN communication state */

__IO uint32_t ErrorCode; /*!< CAN Error code
This parameter can be a value of @ref HAL_CAN_Error_Code */
This parameter can be a value of @ref CAN_Error_Code */

}CAN_HandleTypeDef;
/**
Expand All @@ -252,7 +252,7 @@ typedef struct
* @{
*/

/** @defgroup HAL_CAN_Error_Code CAN Error Code
/** @defgroup CAN_Error_Code CAN Error Code
* @{
*/
#define HAL_CAN_ERROR_NONE ((uint32_t)0x00000000) /*!< No error */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f3xx_hal_cec.c
* @author MCD Application Team
* @version V1.2.1
* @date 29-April-2015
* @version V1.3.0
* @date 01-July-2016
* @brief CEC HAL module driver.
* This file provides firmware functions to manage the following
* functionalities of the High Definition Multimedia Interface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f3xx_hal_cec.h
* @author MCD Application Team
* @version V1.2.1
* @date 29-April-2015
* @version V1.3.0
* @date 01-July-2016
* @brief Header file of CEC HAL module.
******************************************************************************
* @attention
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f3xx_hal_comp.c
* @author MCD Application Team
* @version V1.2.1
* @date 29-April-2015
* @version V1.3.0
* @date 01-July-2016
* @brief COMP HAL module driver.
* This file provides firmware functions to manage the following
* functionalities of the COMP peripheral:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f3xx_hal_comp.h
* @author MCD Application Team
* @version V1.2.1
* @date 29-April-2015
* @version V1.3.0
* @date 01-July-2016
* @brief Header file of COMP HAL module.
******************************************************************************
* @attention
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f3xx_hal_comp_ex.h
* @author MCD Application Team
* @version V1.2.1
* @date 29-April-2015
* @version V1.3.0
* @date 01-July-2016
* @brief Header file of COMP HAL Extended module.
******************************************************************************
* @attention
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f3xx_hal_conf.h
* @author MCD Application Team
* @version V1.2.1
* @date 29-April-2015
* @version V1.3.0
* @date 01-July-2016
* @brief HAL configuration file.
******************************************************************************
* @attention
Expand Down
Loading