Skip to content

Commit c1fa33b

Browse files
author
Krzysztof Blazewicz
committed
stmhal: upgrade to STM32CubeF4 v1.13.0 - HAL v1.5.1
1 parent 4f5c4fd commit c1fa33b

66 files changed

Lines changed: 33524 additions & 14000 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

stmhal/hal/f4/inc/Legacy/stm32_hal_legacy.h

Lines changed: 3123 additions & 0 deletions
Large diffs are not rendered by default.

stmhal/hal/f4/inc/stm32f4xx_hal.h

Lines changed: 148 additions & 77 deletions
Large diffs are not rendered by default.

stmhal/hal/f4/inc/stm32f4xx_hal_adc.h

Lines changed: 467 additions & 352 deletions
Large diffs are not rendered by default.

stmhal/hal/f4/inc/stm32f4xx_hal_adc_ex.h

Lines changed: 234 additions & 109 deletions
Large diffs are not rendered by default.

stmhal/hal/f4/inc/stm32f4xx_hal_can.h

Lines changed: 285 additions & 289 deletions
Large diffs are not rendered by default.

stmhal/hal/f4/inc/stm32f4xx_hal_cortex.h

Lines changed: 346 additions & 42 deletions
Large diffs are not rendered by default.

stmhal/hal/f4/inc/stm32f4xx_hal_dac.h

Lines changed: 168 additions & 86 deletions
Large diffs are not rendered by default.

stmhal/hal/f4/inc/stm32f4xx_hal_dac_ex.h

Lines changed: 67 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
******************************************************************************
33
* @file stm32f4xx_hal_dac.h
44
* @author MCD Application Team
5-
* @version V1.1.0
6-
* @date 19-June-2014
5+
* @version V1.5.1
6+
* @date 01-July-2016
77
* @brief Header file of DAC HAL Extension module.
88
******************************************************************************
99
* @attention
1010
*
11-
* <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
11+
* <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
1212
*
1313
* Redistribution and use in source and binary forms, with or without modification,
1414
* are permitted provided that the following conditions are met:
@@ -43,7 +43,10 @@
4343
extern "C" {
4444
#endif
4545

46-
#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)
46+
#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\
47+
defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\
48+
defined(STM32F410Tx) || defined(STM32F410Cx) || defined(STM32F410Rx) || defined(STM32F446xx) ||\
49+
defined(STM32F469xx) || defined(STM32F479xx)
4750

4851
/* Includes ------------------------------------------------------------------*/
4952
#include "stm32f4xx_hal_def.h"
@@ -57,31 +60,15 @@
5760
*/
5861

5962
/* Exported types ------------------------------------------------------------*/
60-
61-
/**
62-
* @brief HAL State structures definition
63-
*/
64-
6563
/* Exported constants --------------------------------------------------------*/
66-
67-
/** @defgroup DACEx_wave_generation
64+
/** @defgroup DACEx_Exported_Constants DAC Exported Constants
6865
* @{
6966
*/
70-
#define DAC_WAVEGENERATION_NONE ((uint32_t)0x00000000)
71-
#define DAC_WAVEGENERATION_NOISE ((uint32_t)DAC_CR_WAVE1_0)
72-
#define DAC_WAVEGENERATION_TRIANGLE ((uint32_t)DAC_CR_WAVE1_1)
7367

74-
#define IS_DAC_GENERATE_WAVE(WAVE) (((WAVE) == DAC_WAVEGENERATION_NONE) || \
75-
((WAVE) == DAC_WAVEGENERATION_NOISE) || \
76-
((WAVE) == DAC_WAVEGENERATION_TRIANGLE))
77-
/**
78-
* @}
79-
*/
80-
81-
/** @defgroup DACEx_lfsrunmask_triangleamplitude
68+
/** @defgroup DACEx_lfsrunmask_triangleamplitude DAC LFS Run Mask Triangle Amplitude
8269
* @{
8370
*/
84-
#define DAC_LFSRUNMASK_BIT0 ((uint32_t)0x00000000) /*!< Unmask DAC channel LFSR bit0 for noise wave generation */
71+
#define DAC_LFSRUNMASK_BIT0 ((uint32_t)0x00000000U) /*!< Unmask DAC channel LFSR bit0 for noise wave generation */
8572
#define DAC_LFSRUNMASK_BITS1_0 ((uint32_t)DAC_CR_MAMP1_0) /*!< Unmask DAC channel LFSR bit[1:0] for noise wave generation */
8673
#define DAC_LFSRUNMASK_BITS2_0 ((uint32_t)DAC_CR_MAMP1_1) /*!< Unmask DAC channel LFSR bit[2:0] for noise wave generation */
8774
#define DAC_LFSRUNMASK_BITS3_0 ((uint32_t)DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0)/*!< Unmask DAC channel LFSR bit[3:0] for noise wave generation */
@@ -93,7 +80,7 @@
9380
#define DAC_LFSRUNMASK_BITS9_0 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_0) /*!< Unmask DAC channel LFSR bit[9:0] for noise wave generation */
9481
#define DAC_LFSRUNMASK_BITS10_0 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_1) /*!< Unmask DAC channel LFSR bit[10:0] for noise wave generation */
9582
#define DAC_LFSRUNMASK_BITS11_0 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Unmask DAC channel LFSR bit[11:0] for noise wave generation */
96-
#define DAC_TRIANGLEAMPLITUDE_1 ((uint32_t)0x00000000) /*!< Select max triangle amplitude of 1 */
83+
#define DAC_TRIANGLEAMPLITUDE_1 ((uint32_t)0x00000000U) /*!< Select max triangle amplitude of 1 */
9784
#define DAC_TRIANGLEAMPLITUDE_3 ((uint32_t)DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 3 */
9885
#define DAC_TRIANGLEAMPLITUDE_7 ((uint32_t)DAC_CR_MAMP1_1) /*!< Select max triangle amplitude of 7 */
9986
#define DAC_TRIANGLEAMPLITUDE_15 ((uint32_t)DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 15 */
@@ -105,7 +92,55 @@
10592
#define DAC_TRIANGLEAMPLITUDE_1023 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 1023 */
10693
#define DAC_TRIANGLEAMPLITUDE_2047 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_1) /*!< Select max triangle amplitude of 2047 */
10794
#define DAC_TRIANGLEAMPLITUDE_4095 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 4095 */
95+
/**
96+
* @}
97+
*/
98+
99+
/**
100+
* @}
101+
*/
102+
103+
/* Exported macro ------------------------------------------------------------*/
104+
/* Exported functions --------------------------------------------------------*/
105+
/** @addtogroup DACEx_Exported_Functions
106+
* @{
107+
*/
108108

109+
/** @addtogroup DACEx_Exported_Functions_Group1
110+
* @{
111+
*/
112+
/* Extension features functions ***********************************************/
113+
uint32_t HAL_DACEx_DualGetValue(DAC_HandleTypeDef* hdac);
114+
HAL_StatusTypeDef HAL_DACEx_TriangleWaveGenerate(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t Amplitude);
115+
HAL_StatusTypeDef HAL_DACEx_NoiseWaveGenerate(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t Amplitude);
116+
HAL_StatusTypeDef HAL_DACEx_DualSetValue(DAC_HandleTypeDef* hdac, uint32_t Alignment, uint32_t Data1, uint32_t Data2);
117+
118+
void HAL_DACEx_ConvCpltCallbackCh2(DAC_HandleTypeDef* hdac);
119+
void HAL_DACEx_ConvHalfCpltCallbackCh2(DAC_HandleTypeDef* hdac);
120+
void HAL_DACEx_ErrorCallbackCh2(DAC_HandleTypeDef* hdac);
121+
void HAL_DACEx_DMAUnderrunCallbackCh2(DAC_HandleTypeDef* hdac);
122+
/**
123+
* @}
124+
*/
125+
126+
/**
127+
* @}
128+
*/
129+
/* Private types -------------------------------------------------------------*/
130+
/* Private variables ---------------------------------------------------------*/
131+
/* Private constants ---------------------------------------------------------*/
132+
/** @defgroup DACEx_Private_Constants DAC Private Constants
133+
* @{
134+
*/
135+
136+
/**
137+
* @}
138+
*/
139+
140+
/* Private macros ------------------------------------------------------------*/
141+
/** @defgroup DACEx_Private_Macros DAC Private Macros
142+
* @{
143+
*/
109144
#define IS_DAC_LFSR_UNMASK_TRIANGLE_AMPLITUDE(VALUE) (((VALUE) == DAC_LFSRUNMASK_BIT0) || \
110145
((VALUE) == DAC_LFSRUNMASK_BITS1_0) || \
111146
((VALUE) == DAC_LFSRUNMASK_BITS2_0) || \
@@ -134,37 +169,19 @@
134169
* @}
135170
*/
136171

137-
/** @defgroup DACEx_wave_generation
172+
/* Private functions ---------------------------------------------------------*/
173+
/** @defgroup DACEx_Private_Functions DAC Private Functions
138174
* @{
139175
*/
140-
#define DAC_WAVE_NOISE ((uint32_t)DAC_CR_WAVE1_0)
141-
#define DAC_WAVE_TRIANGLE ((uint32_t)DAC_CR_WAVE1_1)
142-
143-
#define IS_DAC_WAVE(WAVE) (((WAVE) == DAC_WAVE_NOISE) || \
144-
((WAVE) == DAC_WAVE_TRIANGLE))
145-
/**
146-
* @}
147-
*/
148-
149-
/* Exported macro ------------------------------------------------------------*/
150-
/* Exported functions --------------------------------------------------------*/
151-
152-
/* Extension features functions ***********************************************/
153-
uint32_t HAL_DACEx_DualGetValue(DAC_HandleTypeDef* hdac);
154-
HAL_StatusTypeDef HAL_DACEx_TriangleWaveGenerate(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t Amplitude);
155-
HAL_StatusTypeDef HAL_DACEx_NoiseWaveGenerate(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t Amplitude);
156-
HAL_StatusTypeDef HAL_DACEx_DualSetValue(DAC_HandleTypeDef* hdac, uint32_t Alignment, uint32_t Data1, uint32_t Data2);
157-
158-
void HAL_DACEx_ConvCpltCallbackCh2(DAC_HandleTypeDef* hdac);
159-
void HAL_DACEx_ConvHalfCpltCallbackCh2(DAC_HandleTypeDef* hdac);
160-
void HAL_DACEx_ErrorCallbackCh2(DAC_HandleTypeDef* hdac);
161-
void HAL_DACEx_DMAUnderrunCallbackCh2(DAC_HandleTypeDef* hdac);
162-
163176
void DAC_DMAConvCpltCh2(DMA_HandleTypeDef *hdma);
164177
void DAC_DMAErrorCh2(DMA_HandleTypeDef *hdma);
165178
void DAC_DMAHalfConvCpltCh2(DMA_HandleTypeDef *hdma);
166-
167-
#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */
179+
/**
180+
* @}
181+
*/
182+
#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx ||\
183+
STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx ||\
184+
STM32F410xx || STM32F446xx || STM32F469xx || STM32F479xx */
168185

169186
/**
170187
* @}

stmhal/hal/f4/inc/stm32f4xx_hal_def.h

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
******************************************************************************
33
* @file stm32f4xx_hal_def.h
44
* @author MCD Application Team
5-
* @version V1.1.0
6-
* @date 19-June-2014
5+
* @version V1.5.1
6+
* @date 01-July-2016
77
* @brief This file contains HAL common defines, enumeration, macros and
88
* structures definitions.
99
******************************************************************************
1010
* @attention
1111
*
12-
* <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
12+
* <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
1313
*
1414
* Redistribution and use in source and binary forms, with or without modification,
1515
* are permitted provided that the following conditions are met:
@@ -46,6 +46,8 @@
4646

4747
/* Includes ------------------------------------------------------------------*/
4848
#include "stm32f4xx.h"
49+
#include "Legacy/stm32_hal_legacy.h"
50+
#include <stdio.h>
4951

5052
/* Exported types ------------------------------------------------------------*/
5153

@@ -54,27 +56,23 @@
5456
*/
5557
typedef enum
5658
{
57-
HAL_OK = 0x00,
58-
HAL_ERROR = 0x01,
59-
HAL_BUSY = 0x02,
60-
HAL_TIMEOUT = 0x03
59+
HAL_OK = 0x00U,
60+
HAL_ERROR = 0x01U,
61+
HAL_BUSY = 0x02U,
62+
HAL_TIMEOUT = 0x03U
6163
} HAL_StatusTypeDef;
6264

6365
/**
6466
* @brief HAL Lock structures definition
6567
*/
6668
typedef enum
6769
{
68-
HAL_UNLOCKED = 0x00,
69-
HAL_LOCKED = 0x01
70+
HAL_UNLOCKED = 0x00U,
71+
HAL_LOCKED = 0x01U
7072
} HAL_LockTypeDef;
7173

7274
/* Exported macro ------------------------------------------------------------*/
73-
#ifndef NULL
74-
#define NULL (void *) 0
75-
#endif
76-
77-
#define HAL_MAX_DELAY 0xFFFFFFFF
75+
#define HAL_MAX_DELAY 0xFFFFFFFFU
7876

7977
#define HAL_IS_BIT_SET(REG, BIT) (((REG) & (BIT)) != RESET)
8078
#define HAL_IS_BIT_CLR(REG, BIT) (((REG) & (BIT)) == RESET)
@@ -85,6 +83,8 @@ typedef enum
8583
(__DMA_HANDLE__).Parent = (__HANDLE__); \
8684
} while(0)
8785

86+
#define UNUSED(x) ((void)(x))
87+
8888
/** @brief Reset the Handle's State field.
8989
* @param __HANDLE__: specifies the Peripheral Handle.
9090
* @note This macro can be used for the following purpose:
@@ -100,11 +100,11 @@ typedef enum
100100
* HAL_PPP_MspInit() which will reconfigure the low level hardware.
101101
* @retval None
102102
*/
103-
#define __HAL_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = 0)
103+
#define __HAL_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = 0U)
104104

105105
#if (USE_RTOS == 1)
106106
/* Reserved for future use */
107-
#error USE_RTOS should be 0 in the current HAL release
107+
#error "USE_RTOS should be 0 in the current HAL release"
108108
#else
109109
#define __HAL_LOCK(__HANDLE__) \
110110
do{ \
@@ -188,6 +188,22 @@ typedef enum
188188

189189
#endif
190190

191+
/**
192+
* @brief __NOINLINE definition
193+
*/
194+
#if defined ( __CC_ARM ) || defined ( __GNUC__ )
195+
/* ARM & GNUCompiler
196+
----------------
197+
*/
198+
#define __NOINLINE __attribute__ ( (noinline) )
199+
200+
#elif defined ( __ICCARM__ )
201+
/* ICCARM Compiler
202+
---------------
203+
*/
204+
#define __NOINLINE _Pragma("optimize = no_inline")
205+
206+
#endif
191207

192208
#ifdef __cplusplus
193209
}

0 commit comments

Comments
 (0)