Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -38,56 +38,91 @@ extern "C" {

typedef enum {
ADC_1 = (int)ADC1_BASE,
#if defined ADC2_BASE
ADC_2 = (int)ADC2_BASE,
#endif
#if defined ADC3_BASE
ADC_3 = (int)ADC3_BASE,
#endif
#if defined ADC4_BASE
ADC_4 = (int)ADC4_BASE
#endif
} ADCName;

typedef enum {
DAC_1 = (int)DAC_BASE
DAC_1 = (int)DAC1_BASE,
#if defined DAC2_BASE
DAC_2 = (int)DAC2_BASE
#endif
} DACName;

typedef enum {
UART_1 = (int)USART1_BASE,
UART_2 = (int)USART2_BASE,
UART_3 = (int)USART3_BASE,
#if defined UART4_BASE
UART_4 = (int)UART4_BASE,
#endif
#if defined UART5_BASE
UART_5 = (int)UART5_BASE
#endif
} UARTName;

#define DEVICE_SPI_COUNT 4
typedef enum {
#if defined SPI1_BASE
SPI_1 = (int)SPI1_BASE,
#endif
#if defined SPI2_BASE
SPI_2 = (int)SPI2_BASE,
#endif
#if defined SPI3_BASE
SPI_3 = (int)SPI3_BASE,
#endif
#if defined SPI4_BASE
SPI_4 = (int)SPI4_BASE
#endif
} SPIName;

typedef enum {
I2C_1 = (int)I2C1_BASE,
#if defined I2C2_BASE
I2C_2 = (int)I2C2_BASE,
#endif
#if defined I2C3_BASE
I2C_3 = (int)I2C3_BASE
#endif
} I2CName;

typedef enum {
PWM_1 = (int)TIM1_BASE,
PWM_2 = (int)TIM2_BASE,
#if defined TIM3_BASE
PWM_3 = (int)TIM3_BASE,
#endif
#if defined TIM4_BASE
PWM_4 = (int)TIM4_BASE,
#endif
#if defined TIM8_BASE
PWM_8 = (int)TIM8_BASE,
#endif
PWM_15 = (int)TIM15_BASE,
PWM_16 = (int)TIM16_BASE,
PWM_17 = (int)TIM17_BASE,
#if defined TIM20_BASE
PWM_20 = (int)TIM20_BASE
#endif
} PWMName;

typedef enum {
CAN_1 = (int)CAN_BASE
} CANName;

#if defined USB_BASE
typedef enum {
USB_FS = (int)USB_BASE,
} USBName;
#endif

#ifdef __cplusplus
}
Expand Down
8,612 changes: 8,612 additions & 0 deletions targets/TARGET_STM/TARGET_STM32F3/STM32Cube_FW/CMSIS/stm32f301x8.h

Large diffs are not rendered by default.

Large diffs are not rendered by default.

12,728 changes: 12,728 additions & 0 deletions targets/TARGET_STM/TARGET_STM32F3/STM32Cube_FW/CMSIS/stm32f302xc.h

Large diffs are not rendered by default.

14,472 changes: 14,472 additions & 0 deletions targets/TARGET_STM/TARGET_STM32F3/STM32Cube_FW/CMSIS/stm32f302xe.h

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

8,599 changes: 8,599 additions & 0 deletions targets/TARGET_STM/TARGET_STM32F3/STM32Cube_FW/CMSIS/stm32f318xx.h

Large diffs are not rendered by default.

12,109 changes: 12,109 additions & 0 deletions targets/TARGET_STM/TARGET_STM32F3/STM32Cube_FW/CMSIS/stm32f328xx.h

Large diffs are not rendered by default.

Large diffs are not rendered by default.

13,244 changes: 13,244 additions & 0 deletions targets/TARGET_STM/TARGET_STM32F3/STM32Cube_FW/CMSIS/stm32f358xx.h

Large diffs are not rendered by default.

12,023 changes: 12,023 additions & 0 deletions targets/TARGET_STM/TARGET_STM32F3/STM32Cube_FW/CMSIS/stm32f373xc.h

Large diffs are not rendered by default.

11,799 changes: 11,799 additions & 0 deletions targets/TARGET_STM/TARGET_STM32F3/STM32Cube_FW/CMSIS/stm32f378xx.h

Large diffs are not rendered by default.

15,087 changes: 15,087 additions & 0 deletions targets/TARGET_STM/TARGET_STM32F3/STM32Cube_FW/CMSIS/stm32f398xx.h

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,13 @@
******************************************************************************
* @attention
*
* <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
* All rights reserved.</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* 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.
* This software component is licensed by ST under BSD 3-Clause license,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
Expand Down Expand Up @@ -81,7 +65,7 @@

/* #define STM32F301x8 */ /*!< STM32F301K6, STM32F301K8, STM32F301C6, STM32F301C8,
STM32F301R6 and STM32F301R8 Devices */
#define STM32F302x8 /*!< STM32F302K6, STM32F302K8, STM32F302C6, STM32F302C8,
/* #define STM32F302x8 */ /*!< STM32F302K6, STM32F302K8, STM32F302C6, STM32F302C8,
STM32F302R6 and STM32F302R8 Devices */
/* #define STM32F302xC */ /*!< STM32F302CB, STM32F302CC, STM32F302RB, STM32F302RC,
STM32F302VB and STM32F302VC Devices */
Expand Down Expand Up @@ -115,15 +99,15 @@
In this case, these drivers will not be included and the application code will
be based on direct access to peripherals registers
*/
#define USE_HAL_DRIVER
/*#define USE_HAL_DRIVER */
#endif /* USE_HAL_DRIVER */

/**
* @brief CMSIS Device version number V2.3.2
* @brief CMSIS Device version number V2.3.4
*/
#define __STM32F3_CMSIS_VERSION_MAIN (0x02) /*!< [31:24] main version */
#define __STM32F3_CMSIS_VERSION_MAIN (0x02) /*!< [31:24] main version */
#define __STM32F3_CMSIS_VERSION_SUB1 (0x03) /*!< [23:16] sub1 version */
#define __STM32F3_CMSIS_VERSION_SUB2 (0x02) /*!< [15:8] sub2 version */
#define __STM32F3_CMSIS_VERSION_SUB2 (0x04) /*!< [15:8] sub2 version */
#define __STM32F3_CMSIS_VERSION_RC (0x00) /*!< [7:0] release candidate */
#define __STM32F3_CMSIS_VERSION ((__STM32F3_CMSIS_VERSION_MAIN << 24)\
|(__STM32F3_CMSIS_VERSION_SUB1 << 16)\
Expand Down Expand Up @@ -179,21 +163,21 @@
*/
typedef enum
{
RESET = 0,
RESET = 0U,
SET = !RESET
} FlagStatus, ITStatus;

typedef enum
{
DISABLE = 0,
DISABLE = 0U,
ENABLE = !DISABLE
} FunctionalState;
#define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))

typedef enum
{
ERROR = 0,
SUCCESS = !ERROR
SUCCESS = 0U,
ERROR = !SUCCESS
} ErrorStatus;

/**
Expand Down Expand Up @@ -221,15 +205,13 @@ typedef enum
#define POSITION_VAL(VAL) (__CLZ(__RBIT(VAL)))


#if defined (USE_HAL_DRIVER)
#include "stm32f3xx_hal.h"
#endif /* USE_HAL_DRIVER */


/**
* @}
*/

#if defined (USE_HAL_DRIVER)
#include "stm32f3xx_hal.h"
#endif /* USE_HAL_DRIVER */

#ifdef __cplusplus
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,16 @@
******************************************************************************
* @attention
*
* <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
* All rights reserved.</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* 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.
* This software component is licensed by ST under BSD 3-Clause license,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
*/

/** @addtogroup CMSIS
* @{
Expand Down Expand Up @@ -102,8 +86,6 @@ extern const uint8_t APBPrescTable[8]; /*!< APB prescalers table values */

extern void SystemInit(void);
extern void SystemCoreClockUpdate(void);
extern void SetSysClock(void);

/**
* @}
*/
Expand Down
Loading