mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-01-19 08:23:30 +08:00
[stm32][l476-nucleo] support RTduino
This commit is contained in:
parent
dfd0e3e96d
commit
4f8094ecd0
@ -1,9 +1,18 @@
|
||||
from building import *
|
||||
import os
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
src = Glob('*.c')
|
||||
CPPPATH = [cwd]
|
||||
src = ['main.c']
|
||||
|
||||
if GetDepend(['PKG_USING_RTDUINO']) and not GetDepend(['RTDUINO_NO_SETUP_LOOP']):
|
||||
src += ['arduino_main.cpp']
|
||||
|
||||
group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH)
|
||||
|
||||
list = os.listdir(cwd)
|
||||
for item in list:
|
||||
if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
|
||||
group = group + SConscript(os.path.join(item, 'SConscript'))
|
||||
|
||||
Return('group')
|
||||
|
24
bsp/stm32/stm32l476-st-nucleo/applications/arduino_main.cpp
Normal file
24
bsp/stm32/stm32l476-st-nucleo/applications/arduino_main.cpp
Normal file
@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2023, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2023-03-23 Meco Man first version
|
||||
*/
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
void setup(void)
|
||||
{
|
||||
/* put your setup code here, to run once: */
|
||||
Serial.begin();
|
||||
Serial.println("Hello RTduino!");
|
||||
}
|
||||
|
||||
void loop(void)
|
||||
{
|
||||
/* put your main code here, to run repeatedly: */
|
||||
delay(1000);
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
# xxx 开发板的Arduino生态兼容说明
|
||||
|
||||
## 1 RTduino - RT-Thread的Arduino生态兼容层
|
||||
|
||||
xxx 开发板已经完整适配了[RTduino软件包](https://github.com/RTduino/RTduino),即RT-Thread的Arduino生态兼容层。用户可以按照Arduino的编程习惯来操作该BSP,并且可以使用大量Arduino社区丰富的库,是对RT-Thread生态的极大增强。更多信息,请参见[RTduino软件包说明文档](https://github.com/RTduino/RTduino)。
|
||||
|
||||
### 1.1 如何开启针对本BSP的Arduino生态兼容层
|
||||
|
||||
Env 工具下敲入 menuconfig 命令,或者 RT-Thread Studio IDE 下选择 RT-Thread Settings:
|
||||
|
||||
```Kconfig
|
||||
Hardware Drivers Config --->
|
||||
Onboard Peripheral Drivers --->
|
||||
[*] Compatible with Arduino Ecosystem (RTduino)
|
||||
```
|
||||
|
||||
## 2 Arduino引脚排布
|
||||
|
||||
更多引脚布局相关信息参见 [pins_arduino.c](pins_arduino.c) 和 [pins_arduino.h](pins_arduino.h)。
|
||||
|
||||
![xxx-pinout](xxx-pinout.jpg)
|
||||
| Arduino引脚编号 | STM32引脚编号 | 5V容忍 | 备注 |
|
||||
| ------------------- | --------- | ---- | ------------------------------------------------------------------------- |
|
||||
| 0 (D0) | PA3 | 是/否 | Serial-RX,默认被RT-Thread的UART设备框架uart2接管 |
|
||||
| 1 (D1) | PA2 | 是/否 | Serial-TX,默认被RT-Thread的UART设备框架uart2接管 |
|
||||
| 2 (D2) | PA10 | 是/否 | |
|
||||
| 3 (D3) | PB3 | 是/否 | PWM2-CH2,默认被RT-Thread的PWM设备框架pwm2接管 |
|
||||
| 4 (D4) | PB5 | 是/否 | |
|
||||
| 5 (D5) | PB4 | 是/否 | PWM3-CH1,默认被RT-Thread的PWM设备框架pwm3接管 |
|
||||
| 6 (D6) | PB10 | 是/否 | PWM2-CH3,默认被RT-Thread的PWM设备框架pwm2接管 |
|
||||
| 7 (D7) | PA8 | 是/否 | |
|
||||
| 8 (D8) | PA9 | 是/否 | |
|
||||
| 9 (D9) | PC7 | 是/否 | PWM3-CH0,默认被RT-Thread的PWM设备框架pwm3接管 |
|
||||
| 10 (D10) | PB6 | 是/否 | PWM4-CH1,默认被RT-Thread的PWM设备框架pwm4接管 |
|
||||
| 11 (D11) | PA7 | 是/否 | PWM17-CH1,默认被RT-Thread的PWM设备框架pwm17接管 |
|
||||
| 12 (D12) | PA6 | 是/否 | |
|
||||
| 13 (D13) | PA5 | 是/否 | |
|
||||
| 14 (D14) | PB9 | 是/否 | I2C1-SDA,默认被RT-Thread的I2C设备框架i2c1接管 |
|
||||
| 15 (D15) | PB8 | 是/否 | I2C1-SCL,默认被RT-Thread的I2C设备框架i2c1接管 |
|
||||
| 16 (D16) | PA5 | 是/否 | |
|
||||
| 17 (A0) | PA0 | 是/否 | ADC1-CH5,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| 18 (A1) | PA1 | 是/否 | ADC1-CH6,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| 19 (A2) | PA4 | 是/否 | ADC1-CH9,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| 20 (A3) | PB0 | 是/否 | ADC1-CH15,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| 21 (A4) | PC1 | 是/否 | ADC1-CH2,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| 22 (A5) | PC0 | 是/否 | ADC1-CH1,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| 23 (A6) | -- | | 芯片内部参考电压 ADC,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| 24 (A7) | -- | | 芯片内部温度 ADC,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
|
||||
> 注意:
|
||||
>
|
||||
> 1. xxxxxxxxx
|
||||
> 2. xxxxxxxxx
|
@ -0,0 +1,9 @@
|
||||
from building import *
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
src = Glob('*.c') + Glob('*.cpp')
|
||||
inc = [cwd]
|
||||
|
||||
group = DefineGroup('RTduino', src, depend = ['PKG_USING_RTDUINO'], CPPPATH = inc)
|
||||
|
||||
Return('group')
|
@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2023, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2023-03-23 Meco Man first version
|
||||
*/
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <board.h>
|
||||
#include "pins_arduino.h"
|
||||
|
||||
/*
|
||||
* {Arduino Pin, RT-Thread Pin [, Device Name, Channel]}
|
||||
* [] means optional
|
||||
* Digital pins must NOT give the device name and channel.
|
||||
* Analog pins MUST give the device name and channel(ADC, PWM or DAC).
|
||||
* Arduino Pin must keep in sequence.
|
||||
*/
|
||||
const pin_map_t pin_map_table[]=
|
||||
{
|
||||
{D0, GET_PIN(A,3), "uart2"}, /* Serial-RX */
|
||||
{D1, GET_PIN(A,2), "uart2"}, /* Serial-TX */
|
||||
{D2, GET_PIN(A,10)},
|
||||
{D3, GET_PIN(B,3), "pwm2", 2}, /* PWM */
|
||||
{D4, GET_PIN(B,5)},
|
||||
{D5, GET_PIN(B,4), "pwm3", 1}, /* PWM */
|
||||
{D6, GET_PIN(B,10), "pwm2", 3}, /* PWM */
|
||||
{D7, GET_PIN(A,8)},
|
||||
{D8, GET_PIN(A,9)},
|
||||
{D9, GET_PIN(C,7), "pwm3", 0}, /* PWM */
|
||||
{D10, GET_PIN(B,6), "pwm4", 1}, /* PWM */
|
||||
{D11, GET_PIN(A,7), "pwm17", 1}, /* PWM */
|
||||
{D12, GET_PIN(A,6)},
|
||||
{D13, GET_PIN(A,5)},
|
||||
{D14, GET_PIN(B,9), "i2c1"}, /* I2C-SDA (Wire) */
|
||||
{D15, GET_PIN(B,8), "i2c1"}, /* I2C-SCL (Wire) */
|
||||
{D16, GET_PIN(A,5)},
|
||||
{A0, GET_PIN(A,0), "adc1", 5}, /* ADC */
|
||||
{A1, GET_PIN(A,1), "adc1", 6}, /* ADC */
|
||||
{A2, GET_PIN(A,4), "adc1", 9}, /* ADC */
|
||||
{A3, GET_PIN(B,0), "adc1", 15}, /* ADC */
|
||||
{A4, GET_PIN(C,1), "adc1", 2}, /* ADC */
|
||||
{A5, GET_PIN(C,0), "adc1", 1}, /* ADC */
|
||||
{A6, RT_NULL, "adc1", 17}, /* ADC, On-Chip: internal reference voltage, ADC_CHANNEL_VREFINT */
|
||||
{A7, RT_NULL, "adc1", 16}, /* ADC, On-Chip: internal temperature sensor, ADC_CHANNEL_TEMPSENSOR */
|
||||
};
|
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2023, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2023-03-23 Meco Man first version
|
||||
*/
|
||||
|
||||
#ifndef Pins_Arduino_h
|
||||
#define Pins_Arduino_h
|
||||
|
||||
/* pins alias. Must keep in sequence */
|
||||
#define D0 (0)
|
||||
#define D1 (1)
|
||||
#define D2 (2)
|
||||
#define D3 (3)
|
||||
#define D4 (4)
|
||||
#define D5 (5)
|
||||
#define D6 (6)
|
||||
#define D7 (7)
|
||||
#define D8 (8)
|
||||
#define D9 (9)
|
||||
#define D10 (10)
|
||||
#define D11 (11)
|
||||
#define D12 (12)
|
||||
#define D13 (13)
|
||||
#define D14 (14)
|
||||
#define D15 (15)
|
||||
#define D16 (16)
|
||||
#define A0 (17)
|
||||
#define A1 (18)
|
||||
#define A2 (19)
|
||||
#define A3 (20)
|
||||
#define A4 (21)
|
||||
#define A5 (22)
|
||||
#define A6 (23)
|
||||
#define A7 (24)
|
||||
|
||||
#define F_CPU 80000000L /* CPU:80MHz */
|
||||
|
||||
/* i2c1 : PB9-SDA PB8-SCL */
|
||||
#define RTDUINO_DEFAULT_IIC_BUS_NAME "i2c1"
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
File diff suppressed because one or more lines are too long
@ -1,227 +1,88 @@
|
||||
#MicroXplorer Configuration settings - do not modify
|
||||
ADC1.Channel-1\#ChannelRegularConversion=ADC_CHANNEL_5
|
||||
ADC1.CommonPathInternal=null|null|null|null
|
||||
ADC1.IPParameters=Rank-1\#ChannelRegularConversion,Channel-1\#ChannelRegularConversion,SamplingTime-1\#ChannelRegularConversion,OffsetNumber-1\#ChannelRegularConversion,NbrOfConversionFlag,master,CommonPathInternal
|
||||
ADC1.NbrOfConversionFlag=1
|
||||
ADC1.OffsetNumber-1\#ChannelRegularConversion=ADC_OFFSET_NONE
|
||||
ADC1.Rank-1\#ChannelRegularConversion=1
|
||||
ADC1.SamplingTime-1\#ChannelRegularConversion=ADC_SAMPLETIME_2CYCLES_5
|
||||
ADC1.master=1
|
||||
CAD.formats=
|
||||
CAD.pinconfig=
|
||||
CAD.provider=
|
||||
File.Version=6
|
||||
KeepUserPlacement=false
|
||||
Mcu.CPN=STM32L476RGT3
|
||||
Mcu.Family=STM32L4
|
||||
PC3.Mode=Full_Duplex_Master
|
||||
ProjectManager.MainLocation=Src
|
||||
PA6.Mode=Full_Duplex_Master
|
||||
RCC.USART1Freq_Value=80000000
|
||||
RCC.SAI1Freq_Value=18285714.285714287
|
||||
USART2.IPParameters=VirtualMode-Asynchronous
|
||||
RCC.CortexFreq_Value=80000000
|
||||
SPI3.Direction=SPI_DIRECTION_2LINES
|
||||
VP_TIM17_VS_ClockSourceINT.Mode=Enable_Timer
|
||||
SPI3.VirtualType=VM_MASTER
|
||||
ProjectManager.KeepUserCode=true
|
||||
Mcu.UserName=STM32L476RGTx
|
||||
SPI1.VirtualType=VM_MASTER
|
||||
SPI2.VirtualType=VM_MASTER
|
||||
PB10.Mode=Full_Duplex_Master
|
||||
ADC2.Channel-0\#ChannelRegularConversion=ADC_CHANNEL_2
|
||||
SH.ADCx_IN2.0=ADC2_IN2,IN2-Single-Ended
|
||||
PC10.Signal=SPI3_SCK
|
||||
PC12.Signal=SPI3_MOSI
|
||||
RCC.PLLSAI1RoutputFreq_Value=64000000
|
||||
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_USART2_UART_Init-USART2-false-HAL-true,4-MX_RTC_Init-RTC-false-HAL-true,5-MX_SPI1_Init-SPI1-false-HAL-true,6-MX_SPI2_Init-SPI2-false-HAL-true,7-MX_SPI3_Init-SPI3-false-HAL-true,8-MX_TIM15_Init-TIM15-false-HAL-true,9-MX_TIM16_Init-TIM16-false-HAL-true,10-MX_TIM17_Init-TIM17-false-HAL-true,11-MX_ADC1_Init-ADC1-false-HAL-true,12-MX_ADC2_Init-ADC2-false-HAL-true,13-MX_ADC3_Init-ADC3-false-HAL-true,14-MX_LPTIM1_Init-LPTIM1-false-HAL-true
|
||||
VP_RTC_VS_RTC_Activate.Mode=RTC_Enabled
|
||||
RCC.RTCFreq_Value=32768
|
||||
RCC.USART2Freq_Value=80000000
|
||||
PC15-OSC32_OUT\ (PC15).Mode=LSE-External-Oscillator
|
||||
ADC3.Channel-0\#ChannelRegularConversion=ADC_CHANNEL_3
|
||||
PinOutPanel.RotationAngle=0
|
||||
RCC.MCO1PinFreq_Value=80000000
|
||||
RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK
|
||||
ProjectManager.StackSize=0x400
|
||||
PC14-OSC32_IN\ (PC14).Mode=LSE-External-Oscillator
|
||||
PA14\ (JTCK-SWCLK).Signal=SYS_JTCK-SWCLK
|
||||
RCC.I2C3Freq_Value=80000000
|
||||
RCC.LPTIM1Freq_Value=80000000
|
||||
Mcu.IP4=NVIC
|
||||
Mcu.IP5=RCC
|
||||
RCC.FCLKCortexFreq_Value=80000000
|
||||
Mcu.IP2=ADC3
|
||||
NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false
|
||||
Mcu.IP3=LPTIM1
|
||||
Mcu.IP0=ADC1
|
||||
Mcu.IP1=ADC2
|
||||
Mcu.UserConstants=
|
||||
RCC.VCOSAI1OutputFreq_Value=128000000
|
||||
RCC.SDMMCFreq_Value=64000000
|
||||
Mcu.ThirdPartyNb=0
|
||||
SPI1.Direction=SPI_DIRECTION_2LINES
|
||||
RCC.HCLKFreq_Value=80000000
|
||||
SH.ADCx_IN3.0=ADC3_IN3,IN3-Single-Ended
|
||||
Mcu.IPNb=15
|
||||
ProjectManager.PreviousToolchain=
|
||||
RCC.APB2TimFreq_Value=80000000
|
||||
SPI1.CalculateBaudRate=40.0 MBits/s
|
||||
SH.ADCx_IN3.ConfNb=1
|
||||
PC3.Signal=SPI2_MOSI
|
||||
Mcu.Pin6=PA2
|
||||
RCC.SAI2Freq_Value=18285714.285714287
|
||||
Mcu.Pin7=PA3
|
||||
Mcu.Pin8=PA5
|
||||
Mcu.Pin9=PA6
|
||||
RCC.AHBFreq_Value=80000000
|
||||
Mcu.IP1=LPTIM1
|
||||
Mcu.IP10=TIM15
|
||||
Mcu.IP11=TIM16
|
||||
Mcu.IP12=TIM17
|
||||
Mcu.IP13=USART2
|
||||
Mcu.IP2=NVIC
|
||||
Mcu.IP3=RCC
|
||||
Mcu.IP4=RTC
|
||||
Mcu.IP5=SPI3
|
||||
Mcu.IP6=SYS
|
||||
Mcu.IP7=TIM2
|
||||
Mcu.IP8=TIM3
|
||||
Mcu.IP9=TIM4
|
||||
Mcu.IPNb=14
|
||||
Mcu.Name=STM32L476R(C-E-G)Tx
|
||||
Mcu.Package=LQFP64
|
||||
Mcu.Pin0=PC14-OSC32_IN (PC14)
|
||||
Mcu.Pin1=PC15-OSC32_OUT (PC15)
|
||||
Mcu.Pin2=PC0
|
||||
Mcu.Pin3=PC1
|
||||
RCC.USART3Freq_Value=80000000
|
||||
Mcu.Pin4=PC2
|
||||
Mcu.Pin5=PC3
|
||||
ADC1.Channel-0\#ChannelRegularConversion=ADC_CHANNEL_1
|
||||
ProjectManager.ProjectBuild=false
|
||||
RCC.HSE_VALUE=8000000
|
||||
NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false
|
||||
NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false
|
||||
Mcu.IP10=SYS
|
||||
USART2.VirtualMode-Asynchronous=VM_ASYNC
|
||||
NVIC.SysTick_IRQn=true\:0\:0\:false\:false\:true\:false\:true
|
||||
RCC.RTCClockSelection=RCC_RTCCLKSOURCE_LSE
|
||||
Mcu.IP12=TIM16
|
||||
Mcu.IP11=TIM15
|
||||
ProjectManager.FirmwarePackage=STM32Cube FW_L4 V1.15.1
|
||||
MxDb.Version=DB.5.0.60
|
||||
Mcu.IP14=USART2
|
||||
Mcu.IP13=TIM17
|
||||
ProjectManager.BackupPrevious=false
|
||||
RCC.VCOInputFreq_Value=16000000
|
||||
SH.ADCx_IN1.ConfNb=1
|
||||
PB14.Mode=Full_Duplex_Master
|
||||
File.Version=6
|
||||
SPI2.CalculateBaudRate=40.0 MBits/s
|
||||
ADC3.IPParameters=Rank-0\#ChannelRegularConversion,Channel-0\#ChannelRegularConversion,SamplingTime-0\#ChannelRegularConversion,OffsetNumber-0\#ChannelRegularConversion,NbrOfConversionFlag
|
||||
RCC.PLLRCLKFreq_Value=80000000
|
||||
NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false
|
||||
VP_TIM15_VS_ClockSourceINT.Signal=TIM15_VS_ClockSourceINT
|
||||
ProjectManager.HalAssertFull=false
|
||||
ADC1.SamplingTime-0\#ChannelRegularConversion=ADC_SAMPLETIME_2CYCLES_5
|
||||
ProjectManager.ProjectName=CubeMX_Config
|
||||
Mcu.Package=LQFP64
|
||||
PA6.Signal=SPI1_MISO
|
||||
SPI2.Mode=SPI_MODE_MASTER
|
||||
SPI3.Mode=SPI_MODE_MASTER
|
||||
ProjectManager.ToolChainLocation=
|
||||
RCC.LSI_VALUE=32000
|
||||
VP_SYS_VS_Systick.Signal=SYS_VS_Systick
|
||||
VP_LPTIM1_VS_LPTIM_counterModeInternalClock.Mode=Counts__internal_clock_event_00
|
||||
ADC3.Rank-0\#ChannelRegularConversion=1
|
||||
RCC.LSCOPinFreq_Value=32000
|
||||
ADC2.SamplingTime-0\#ChannelRegularConversion=ADC_SAMPLETIME_2CYCLES_5
|
||||
RCC.DFSDMFreq_Value=80000000
|
||||
PC11.Mode=Full_Duplex_Master
|
||||
ADC3.OffsetNumber-0\#ChannelRegularConversion=ADC_OFFSET_NONE
|
||||
SH.ADCx_IN1.0=ADC1_IN1,IN1-Single-Ended
|
||||
RCC.PLLPoutputFreq_Value=22857142.85714286
|
||||
RCC.APB1TimFreq_Value=80000000
|
||||
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false
|
||||
RCC.LPUART1Freq_Value=80000000
|
||||
SPI3.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate
|
||||
SPI2.Direction=SPI_DIRECTION_2LINES
|
||||
ADC2.Rank-0\#ChannelRegularConversion=1
|
||||
PA13\ (JTMS-SWDIO).Signal=SYS_JTMS-SWDIO
|
||||
ProjectManager.CustomerFirmwarePackage=
|
||||
PA3.Signal=USART2_RX
|
||||
PA5.Mode=Full_Duplex_Master
|
||||
VP_RTC_VS_RTC_Activate.Signal=RTC_VS_RTC_Activate
|
||||
RCC.MSI_VALUE=4000000
|
||||
RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSI
|
||||
PA14\ (JTCK-SWCLK).Mode=Serial_Wire
|
||||
RCC.PLLQoutputFreq_Value=80000000
|
||||
ProjectManager.ProjectFileName=CubeMX_Config.ioc
|
||||
ADC1.Rank-0\#ChannelRegularConversion=1
|
||||
PA7.Mode=Full_Duplex_Master
|
||||
Mcu.PinsNb=24
|
||||
ProjectManager.NoMain=false
|
||||
SPI1.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate
|
||||
ADC1.IPParameters=Rank-0\#ChannelRegularConversion,Channel-0\#ChannelRegularConversion,SamplingTime-0\#ChannelRegularConversion,OffsetNumber-0\#ChannelRegularConversion,NbrOfConversionFlag,master
|
||||
ADC1.OffsetNumber-0\#ChannelRegularConversion=ADC_OFFSET_NONE
|
||||
PC11.Signal=SPI3_MISO
|
||||
RCC.SWPMI1Freq_Value=80000000
|
||||
PC2.Signal=ADCx_IN3
|
||||
PC10.Mode=Full_Duplex_Master
|
||||
ProjectManager.DefaultFWLocation=true
|
||||
PC15-OSC32_OUT\ (PC15).Signal=RCC_OSC32_OUT
|
||||
VP_TIM16_VS_ClockSourceINT.Mode=Enable_Timer
|
||||
ProjectManager.DeletePrevious=true
|
||||
PC0.Signal=ADCx_IN1
|
||||
RCC.VCOSAI2OutputFreq_Value=128000000
|
||||
VP_TIM17_VS_ClockSourceINT.Signal=TIM17_VS_ClockSourceINT
|
||||
RCC.FamilyName=M
|
||||
PA3.Mode=Asynchronous
|
||||
ADC3.SamplingTime-0\#ChannelRegularConversion=ADC_SAMPLETIME_2CYCLES_5
|
||||
ProjectManager.TargetToolchain=MDK-ARM V5
|
||||
ADC2.IPParameters=Rank-0\#ChannelRegularConversion,Channel-0\#ChannelRegularConversion,SamplingTime-0\#ChannelRegularConversion,OffsetNumber-0\#ChannelRegularConversion,NbrOfConversionFlag
|
||||
SPI2.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate
|
||||
RCC.USBFreq_Value=64000000
|
||||
RCC.PLLSAI1PoutputFreq_Value=18285714.285714287
|
||||
PB10.Signal=SPI2_SCK
|
||||
PB14.Signal=SPI2_MISO
|
||||
RCC.PLLSAI2RoutputFreq_Value=64000000
|
||||
PA5.Signal=SPI1_SCK
|
||||
ADC2.OffsetNumber-0\#ChannelRegularConversion=ADC_OFFSET_NONE
|
||||
PC12.Mode=Full_Duplex_Master
|
||||
board=custom
|
||||
RCC.VCOOutputFreq_Value=160000000
|
||||
ProjectManager.LastFirmware=true
|
||||
RCC.APB2Freq_Value=80000000
|
||||
RCC.UART4Freq_Value=80000000
|
||||
SPI3.CalculateBaudRate=40.0 MBits/s
|
||||
MxCube.Version=5.6.1
|
||||
RCC.I2C1Freq_Value=80000000
|
||||
SPI1.Mode=SPI_MODE_MASTER
|
||||
RCC.LCDFreq_Value=32768
|
||||
RCC.RNGFreq_Value=64000000
|
||||
SH.ADCx_IN2.ConfNb=1
|
||||
RCC.PLLSAI1QoutputFreq_Value=64000000
|
||||
RCC.ADCFreq_Value=64000000
|
||||
VP_SYS_VS_Systick.Mode=SysTick
|
||||
VP_TIM16_VS_ClockSourceINT.Signal=TIM16_VS_ClockSourceINT
|
||||
NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false
|
||||
RCC.UART5Freq_Value=80000000
|
||||
ProjectManager.FreePins=false
|
||||
RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,DFSDMFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2C1Freq_Value,I2C2Freq_Value,I2C3Freq_Value,LCDFreq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSI_VALUE,MCO1PinFreq_Value,MSI_VALUE,PLLN,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PLLSAI2PoutputFreq_Value,PLLSAI2RoutputFreq_Value,PLLSourceVirtual,PWRFreq_Value,RNGFreq_Value,RTCClockSelection,RTCFreq_Value,SAI1Freq_Value,SAI2Freq_Value,SDMMCFreq_Value,SWPMI1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,UART4Freq_Value,UART5Freq_Value,USART1Freq_Value,USART2Freq_Value,USART3Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value,VCOSAI2OutputFreq_Value
|
||||
ProjectManager.AskForMigrate=true
|
||||
Mcu.Name=STM32L476R(C-E-G)Tx
|
||||
RCC.LPTIM2Freq_Value=80000000
|
||||
PA2.Signal=USART2_TX
|
||||
ProjectManager.UnderRoot=false
|
||||
Mcu.IP8=SPI2
|
||||
Mcu.IP9=SPI3
|
||||
Mcu.IP6=RTC
|
||||
Mcu.IP7=SPI1
|
||||
ProjectManager.CoupleFile=false
|
||||
PA13\ (JTMS-SWDIO).Mode=Serial_Wire
|
||||
RCC.SYSCLKFreq_VALUE=80000000
|
||||
Mcu.Pin22=VP_TIM16_VS_ClockSourceINT
|
||||
Mcu.Pin23=VP_TIM17_VS_ClockSourceINT
|
||||
Mcu.Pin20=VP_SYS_VS_Systick
|
||||
ADC1.master=1
|
||||
Mcu.Pin21=VP_TIM15_VS_ClockSourceINT
|
||||
ADC2.NbrOfConversionFlag=1
|
||||
RCC.PLLSAI2PoutputFreq_Value=18285714.285714287
|
||||
NVIC.ForceEnableDMAVector=true
|
||||
KeepUserPlacement=false
|
||||
PC14-OSC32_IN\ (PC14).Signal=RCC_OSC32_IN
|
||||
NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false
|
||||
ProjectManager.CompilerOptimize=6
|
||||
VP_TIM15_VS_ClockSourceINT.Mode=Internal
|
||||
ProjectManager.HeapSize=0x200
|
||||
Mcu.Pin15=PC10
|
||||
NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false
|
||||
Mcu.Pin16=PC11
|
||||
Mcu.Pin10=PB0
|
||||
Mcu.Pin11=PB10
|
||||
Mcu.Pin12=PC7
|
||||
Mcu.Pin13=PA13 (JTMS-SWDIO)
|
||||
Mcu.Pin14=PA14 (JTCK-SWCLK)
|
||||
Mcu.Pin19=VP_RTC_VS_RTC_Activate
|
||||
ProjectManager.ComputerToolchain=false
|
||||
Mcu.Pin15=PC10
|
||||
Mcu.Pin16=PC11
|
||||
Mcu.Pin17=PC12
|
||||
RCC.HSI_VALUE=16000000
|
||||
Mcu.Pin18=VP_LPTIM1_VS_LPTIM_counterModeInternalClock
|
||||
Mcu.Pin18=PB3 (JTDO-TRACESWO)
|
||||
Mcu.Pin19=PB4 (NJTRST)
|
||||
Mcu.Pin2=PC0
|
||||
Mcu.Pin20=PB6
|
||||
Mcu.Pin21=VP_LPTIM1_VS_LPTIM_counterModeInternalClock
|
||||
Mcu.Pin22=VP_RTC_VS_RTC_Activate
|
||||
Mcu.Pin23=VP_SYS_VS_Systick
|
||||
Mcu.Pin24=VP_TIM15_VS_ClockSourceINT
|
||||
Mcu.Pin25=VP_TIM16_VS_ClockSourceINT
|
||||
Mcu.Pin26=VP_TIM17_VS_ClockSourceINT
|
||||
Mcu.Pin3=PC1
|
||||
Mcu.Pin4=PA0
|
||||
Mcu.Pin5=PA1
|
||||
Mcu.Pin6=PA2
|
||||
Mcu.Pin7=PA3
|
||||
Mcu.Pin8=PA4
|
||||
Mcu.Pin9=PA7
|
||||
Mcu.PinsNb=27
|
||||
Mcu.ThirdPartyNb=0
|
||||
Mcu.UserConstants=
|
||||
Mcu.UserName=STM32L476RGTx
|
||||
MxCube.Version=6.8.0
|
||||
MxDb.Version=DB.6.0.80
|
||||
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
|
||||
NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
|
||||
NVIC.ForceEnableDMAVector=true
|
||||
NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
|
||||
NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
|
||||
NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
|
||||
NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
|
||||
NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4
|
||||
ADC1.NbrOfConversionFlag=1
|
||||
Mcu.Pin11=PB10
|
||||
Mcu.Pin12=PB14
|
||||
RCC.PLLN=10
|
||||
Mcu.Pin10=PA7
|
||||
NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
|
||||
NVIC.SysTick_IRQn=true\:0\:0\:false\:false\:true\:false\:true\:false
|
||||
NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
|
||||
PA0.Locked=true
|
||||
PA0.Signal=ADCx_IN5
|
||||
PA1.Locked=true
|
||||
PA1.Signal=ADCx_IN6
|
||||
PA13\ (JTMS-SWDIO).Mode=Serial_Wire
|
||||
PA13\ (JTMS-SWDIO).Signal=SYS_JTMS-SWDIO
|
||||
PA14\ (JTCK-SWCLK).Mode=Serial_Wire
|
||||
PA14\ (JTCK-SWCLK).Signal=SYS_JTCK-SWCLK
|
||||
PA2.GPIOParameters=GPIO_PuPd
|
||||
PA2.GPIO_PuPd=GPIO_PULLUP
|
||||
PA2.Mode=Asynchronous
|
||||
@ -230,12 +91,169 @@ PA3.GPIOParameters=GPIO_PuPd
|
||||
PA3.GPIO_PuPd=GPIO_PULLUP
|
||||
PA3.Mode=Asynchronous
|
||||
PA3.Signal=USART2_RX
|
||||
VP_LPTIM1_VS_LPTIM_counterModeInternalClock.Signal=LPTIM1_VS_LPTIM_counterModeInternalClock
|
||||
RCC.PWRFreq_Value=80000000
|
||||
RCC.I2C2Freq_Value=80000000
|
||||
RCC.APB1Freq_Value=80000000
|
||||
ADC3.NbrOfConversionFlag=1
|
||||
ProjectManager.DeviceId=STM32L476RGTx
|
||||
PA4.Locked=true
|
||||
PA4.Signal=ADCx_IN9
|
||||
PA7.Locked=true
|
||||
PA7.Signal=S_TIM17_CH1
|
||||
PB0.Signal=ADCx_IN15
|
||||
PB10.Locked=true
|
||||
PB10.Signal=S_TIM2_CH3
|
||||
PB3\ (JTDO-TRACESWO).Locked=true
|
||||
PB3\ (JTDO-TRACESWO).Signal=S_TIM2_CH2
|
||||
PB4\ (NJTRST).Locked=true
|
||||
PB4\ (NJTRST).Signal=S_TIM3_CH1
|
||||
PB6.Locked=true
|
||||
PB6.Signal=S_TIM4_CH1
|
||||
PC0.Signal=ADCx_IN1
|
||||
PC1.Signal=ADCx_IN2
|
||||
PC10.Mode=Full_Duplex_Master
|
||||
PC10.Signal=SPI3_SCK
|
||||
PC11.Mode=Full_Duplex_Master
|
||||
PC11.Signal=SPI3_MISO
|
||||
PC12.Mode=Full_Duplex_Master
|
||||
PC12.Signal=SPI3_MOSI
|
||||
PC14-OSC32_IN\ (PC14).Mode=LSE-External-Oscillator
|
||||
PC14-OSC32_IN\ (PC14).Signal=RCC_OSC32_IN
|
||||
PC15-OSC32_OUT\ (PC15).Mode=LSE-External-Oscillator
|
||||
PC15-OSC32_OUT\ (PC15).Signal=RCC_OSC32_OUT
|
||||
PC7.Locked=true
|
||||
PC7.Signal=S_TIM3_CH2
|
||||
PinOutPanel.RotationAngle=0
|
||||
ProjectManager.AskForMigrate=true
|
||||
ProjectManager.BackupPrevious=false
|
||||
ProjectManager.CompilerOptimize=6
|
||||
ProjectManager.ComputerToolchain=false
|
||||
ProjectManager.CoupleFile=false
|
||||
ProjectManager.CustomerFirmwarePackage=
|
||||
ProjectManager.DefaultFWLocation=true
|
||||
ProjectManager.DeletePrevious=true
|
||||
ProjectManager.DeviceId=STM32L476RGTx
|
||||
ProjectManager.FirmwarePackage=STM32Cube FW_L4 V1.17.2
|
||||
ProjectManager.FreePins=false
|
||||
ProjectManager.HalAssertFull=false
|
||||
ProjectManager.HeapSize=0x200
|
||||
ProjectManager.KeepUserCode=true
|
||||
ProjectManager.LastFirmware=true
|
||||
ProjectManager.LibraryCopy=2
|
||||
PA7.Signal=SPI1_MOSI
|
||||
ProjectManager.MainLocation=Src
|
||||
ProjectManager.NoMain=false
|
||||
ProjectManager.PreviousToolchain=
|
||||
ProjectManager.ProjectBuild=false
|
||||
ProjectManager.ProjectFileName=CubeMX_Config.ioc
|
||||
ProjectManager.ProjectName=CubeMX_Config
|
||||
ProjectManager.ProjectStructure=
|
||||
ProjectManager.RegisterCallBack=
|
||||
ProjectManager.StackSize=0x400
|
||||
ProjectManager.TargetToolchain=MDK-ARM V5
|
||||
ProjectManager.ToolChainLocation=
|
||||
ProjectManager.UnderRoot=false
|
||||
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_USART2_UART_Init-USART2-false-HAL-true,4-MX_RTC_Init-RTC-false-HAL-true,5-MX_SPI3_Init-SPI3-false-HAL-true,6-MX_TIM15_Init-TIM15-false-HAL-true,7-MX_TIM16_Init-TIM16-false-HAL-true,8-MX_TIM17_Init-TIM17-false-HAL-true,9-MX_ADC1_Init-ADC1-false-HAL-true,10-MX_ADC2_Init-ADC2-false-HAL-true,11-MX_ADC3_Init-ADC3-false-HAL-true,12-MX_LPTIM1_Init-LPTIM1-false-HAL-true,13-MX_TIM2_Init-TIM2-false-HAL-true,14-MX_TIM3_Init-TIM3-false-HAL-true,15-MX_TIM4_Init-TIM4-false-HAL-true
|
||||
RCC.ADCFreq_Value=64000000
|
||||
RCC.AHBFreq_Value=80000000
|
||||
RCC.APB1Freq_Value=80000000
|
||||
RCC.APB1TimFreq_Value=80000000
|
||||
RCC.APB2Freq_Value=80000000
|
||||
RCC.APB2TimFreq_Value=80000000
|
||||
RCC.CortexFreq_Value=80000000
|
||||
RCC.DFSDMFreq_Value=80000000
|
||||
RCC.FCLKCortexFreq_Value=80000000
|
||||
RCC.FamilyName=M
|
||||
RCC.HCLKFreq_Value=80000000
|
||||
RCC.HSE_VALUE=8000000
|
||||
RCC.HSI_VALUE=16000000
|
||||
RCC.I2C1Freq_Value=80000000
|
||||
RCC.I2C2Freq_Value=80000000
|
||||
RCC.I2C3Freq_Value=80000000
|
||||
RCC.IPParameters=ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,DFSDMFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2C1Freq_Value,I2C2Freq_Value,I2C3Freq_Value,LCDFreq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSI_VALUE,MCO1PinFreq_Value,MSI_VALUE,PLLN,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PLLSAI2PoutputFreq_Value,PLLSAI2RoutputFreq_Value,PLLSourceVirtual,PWRFreq_Value,RNGFreq_Value,RTCClockSelection,RTCFreq_Value,SAI1Freq_Value,SAI2Freq_Value,SDMMCFreq_Value,SWPMI1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,UART4Freq_Value,UART5Freq_Value,USART1Freq_Value,USART2Freq_Value,USART3Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value,VCOSAI2OutputFreq_Value
|
||||
RCC.LCDFreq_Value=32768
|
||||
RCC.LPTIM1Freq_Value=80000000
|
||||
RCC.LPTIM2Freq_Value=80000000
|
||||
RCC.LPUART1Freq_Value=80000000
|
||||
RCC.LSCOPinFreq_Value=32000
|
||||
RCC.LSI_VALUE=32000
|
||||
RCC.MCO1PinFreq_Value=80000000
|
||||
RCC.MSI_VALUE=4000000
|
||||
RCC.PLLN=10
|
||||
RCC.PLLPoutputFreq_Value=22857142.85714286
|
||||
RCC.PLLQoutputFreq_Value=80000000
|
||||
RCC.PLLRCLKFreq_Value=80000000
|
||||
RCC.PLLSAI1PoutputFreq_Value=18285714.285714287
|
||||
RCC.PLLSAI1QoutputFreq_Value=64000000
|
||||
RCC.PLLSAI1RoutputFreq_Value=64000000
|
||||
RCC.PLLSAI2PoutputFreq_Value=18285714.285714287
|
||||
RCC.PLLSAI2RoutputFreq_Value=64000000
|
||||
RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSI
|
||||
RCC.PWRFreq_Value=80000000
|
||||
RCC.RNGFreq_Value=64000000
|
||||
RCC.RTCClockSelection=RCC_RTCCLKSOURCE_LSE
|
||||
RCC.RTCFreq_Value=32768
|
||||
RCC.SAI1Freq_Value=18285714.285714287
|
||||
RCC.SAI2Freq_Value=18285714.285714287
|
||||
RCC.SDMMCFreq_Value=64000000
|
||||
RCC.SWPMI1Freq_Value=80000000
|
||||
RCC.SYSCLKFreq_VALUE=80000000
|
||||
RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK
|
||||
RCC.UART4Freq_Value=80000000
|
||||
RCC.UART5Freq_Value=80000000
|
||||
RCC.USART1Freq_Value=80000000
|
||||
RCC.USART2Freq_Value=80000000
|
||||
RCC.USART3Freq_Value=80000000
|
||||
RCC.USBFreq_Value=64000000
|
||||
RCC.VCOInputFreq_Value=16000000
|
||||
RCC.VCOOutputFreq_Value=160000000
|
||||
RCC.VCOSAI1OutputFreq_Value=128000000
|
||||
RCC.VCOSAI2OutputFreq_Value=128000000
|
||||
SH.ADCx_IN1.0=ADC1_IN1,IN1-Single-Ended
|
||||
SH.ADCx_IN1.ConfNb=1
|
||||
SH.ADCx_IN15.0=ADC1_IN15,IN15-Single-Ended
|
||||
SH.ADCx_IN15.ConfNb=1
|
||||
SH.ADCx_IN2.0=ADC1_IN2,IN2-Single-Ended
|
||||
SH.ADCx_IN2.ConfNb=1
|
||||
SH.ADCx_IN5.0=ADC1_IN5,IN5-Single-Ended
|
||||
SH.ADCx_IN5.ConfNb=1
|
||||
SH.ADCx_IN6.0=ADC1_IN6,IN6-Single-Ended
|
||||
SH.ADCx_IN6.ConfNb=1
|
||||
SH.ADCx_IN9.0=ADC1_IN9,IN9-Single-Ended
|
||||
SH.ADCx_IN9.ConfNb=1
|
||||
SH.S_TIM17_CH1.0=TIM17_CH1,PWM Generation1 CH1
|
||||
SH.S_TIM17_CH1.ConfNb=1
|
||||
SH.S_TIM2_CH2.0=TIM2_CH2,PWM Generation2 CH2
|
||||
SH.S_TIM2_CH2.ConfNb=1
|
||||
SH.S_TIM2_CH3.0=TIM2_CH3,PWM Generation3 CH3
|
||||
SH.S_TIM2_CH3.ConfNb=1
|
||||
SH.S_TIM3_CH1.0=TIM3_CH1,PWM Generation1 CH1
|
||||
SH.S_TIM3_CH1.ConfNb=1
|
||||
SH.S_TIM3_CH2.0=TIM3_CH2,PWM Generation2 CH2
|
||||
SH.S_TIM3_CH2.ConfNb=1
|
||||
SH.S_TIM4_CH1.0=TIM4_CH1,PWM Generation1 CH1
|
||||
SH.S_TIM4_CH1.ConfNb=1
|
||||
SPI3.CalculateBaudRate=40.0 MBits/s
|
||||
SPI3.Direction=SPI_DIRECTION_2LINES
|
||||
SPI3.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate
|
||||
SPI3.Mode=SPI_MODE_MASTER
|
||||
SPI3.VirtualType=VM_MASTER
|
||||
TIM17.Channel=TIM_CHANNEL_1
|
||||
TIM17.IPParameters=Channel
|
||||
TIM2.Channel-PWM\ Generation2\ CH2=TIM_CHANNEL_2
|
||||
TIM2.Channel-PWM\ Generation3\ CH3=TIM_CHANNEL_3
|
||||
TIM2.IPParameters=Channel-PWM Generation2 CH2,Channel-PWM Generation3 CH3
|
||||
TIM3.Channel-PWM\ Generation1\ CH1=TIM_CHANNEL_1
|
||||
TIM3.Channel-PWM\ Generation2\ CH2=TIM_CHANNEL_2
|
||||
TIM3.IPParameters=Channel-PWM Generation1 CH1,Channel-PWM Generation2 CH2
|
||||
TIM4.Channel-PWM\ Generation1\ CH1=TIM_CHANNEL_1
|
||||
TIM4.IPParameters=Channel-PWM Generation1 CH1
|
||||
USART2.IPParameters=VirtualMode-Asynchronous
|
||||
USART2.VirtualMode-Asynchronous=VM_ASYNC
|
||||
VP_LPTIM1_VS_LPTIM_counterModeInternalClock.Mode=Counts__internal_clock_event_00
|
||||
VP_LPTIM1_VS_LPTIM_counterModeInternalClock.Signal=LPTIM1_VS_LPTIM_counterModeInternalClock
|
||||
VP_RTC_VS_RTC_Activate.Mode=RTC_Enabled
|
||||
VP_RTC_VS_RTC_Activate.Signal=RTC_VS_RTC_Activate
|
||||
VP_SYS_VS_Systick.Mode=SysTick
|
||||
VP_SYS_VS_Systick.Signal=SYS_VS_Systick
|
||||
VP_TIM15_VS_ClockSourceINT.Mode=Internal
|
||||
VP_TIM15_VS_ClockSourceINT.Signal=TIM15_VS_ClockSourceINT
|
||||
VP_TIM16_VS_ClockSourceINT.Mode=Enable_Timer
|
||||
VP_TIM16_VS_ClockSourceINT.Signal=TIM16_VS_ClockSourceINT
|
||||
VP_TIM17_VS_ClockSourceINT.Mode=Enable_Timer
|
||||
VP_TIM17_VS_ClockSourceINT.Signal=TIM17_VS_ClockSourceINT
|
||||
board=custom
|
||||
|
@ -70,6 +70,8 @@ extern "C" {
|
||||
|
||||
/* USER CODE END EM */
|
||||
|
||||
void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);
|
||||
|
||||
/* Exported functions prototypes ---------------------------------------------*/
|
||||
void Error_Handler(void);
|
||||
|
||||
@ -78,6 +80,7 @@ void Error_Handler(void);
|
||||
/* USER CODE END EFP */
|
||||
|
||||
/* Private defines -----------------------------------------------------------*/
|
||||
|
||||
/* USER CODE BEGIN Private defines */
|
||||
|
||||
/* USER CODE END Private defines */
|
||||
@ -87,5 +90,3 @@ void Error_Handler(void);
|
||||
#endif
|
||||
|
||||
#endif /* __MAIN_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
|
@ -1,40 +1,28 @@
|
||||
/* USER CODE BEGIN Header */
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm32l4xx_hal_conf.h
|
||||
* @brief HAL configuration file.
|
||||
* @author MCD Application Team
|
||||
* @brief HAL configuration template file.
|
||||
* This file should be copied to the application folder and renamed
|
||||
* to stm32l4xx_hal_conf.h.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2020 STMicroelectronics</center></h2>
|
||||
* Copyright (c) 2017 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 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 is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
*/
|
||||
/* USER CODE END Header */
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __STM32L4xx_HAL_CONF_H
|
||||
#define __STM32L4xx_HAL_CONF_H
|
||||
#ifndef STM32L4xx_HAL_CONF_H
|
||||
#define STM32L4xx_HAL_CONF_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -45,14 +33,14 @@
|
||||
|
||||
/* ########################## Module Selection ############################## */
|
||||
/**
|
||||
* @brief This is the list of modules to be used in the HAL driver
|
||||
* @brief This is the list of modules to be used in the HAL driver
|
||||
*/
|
||||
|
||||
#define HAL_MODULE_ENABLED
|
||||
#define HAL_MODULE_ENABLED
|
||||
#define HAL_ADC_MODULE_ENABLED
|
||||
/*#define HAL_CRYP_MODULE_ENABLED */
|
||||
/*#define HAL_CAN_MODULE_ENABLED */
|
||||
/*#define HAL_COMP_MODULE_ENABLED */
|
||||
/*#define HAL_I2C_MODULE_ENABLED */
|
||||
/*#define HAL_CRC_MODULE_ENABLED */
|
||||
/*#define HAL_CRYP_MODULE_ENABLED */
|
||||
/*#define HAL_DAC_MODULE_ENABLED */
|
||||
@ -97,8 +85,7 @@
|
||||
/*#define HAL_EXTI_MODULE_ENABLED */
|
||||
/*#define HAL_PSSI_MODULE_ENABLED */
|
||||
#define HAL_GPIO_MODULE_ENABLED
|
||||
#define HAL_EXTI_MODULE_ENABLED
|
||||
#define HAL_I2C_MODULE_ENABLED
|
||||
#define HAL_EXTI_MODULE_ENABLED
|
||||
#define HAL_DMA_MODULE_ENABLED
|
||||
#define HAL_RCC_MODULE_ENABLED
|
||||
#define HAL_FLASH_MODULE_ENABLED
|
||||
@ -109,9 +96,9 @@
|
||||
/**
|
||||
* @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
|
||||
* This value is used by the RCC HAL module to compute the system frequency
|
||||
* (when HSE is used as system clock source, directly or through the PLL).
|
||||
* (when HSE is used as system clock source, directly or through the PLL).
|
||||
*/
|
||||
#if !defined (HSE_VALUE)
|
||||
#if !defined (HSE_VALUE)
|
||||
#define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */
|
||||
#endif /* HSE_VALUE */
|
||||
|
||||
@ -129,7 +116,7 @@
|
||||
/**
|
||||
* @brief Internal High Speed oscillator (HSI) value.
|
||||
* This value is used by the RCC HAL module to compute the system frequency
|
||||
* (when HSI is used as system clock source, directly or through the PLL).
|
||||
* (when HSI is used as system clock source, directly or through the PLL).
|
||||
*/
|
||||
#if !defined (HSI_VALUE)
|
||||
#define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/
|
||||
@ -142,7 +129,7 @@
|
||||
* When the CRS is not used, the HSI48 RC oscillator runs on it default frequency
|
||||
* which is subject to manufacturing process variations.
|
||||
*/
|
||||
#if !defined (HSI48_VALUE)
|
||||
#if !defined (HSI48_VALUE)
|
||||
#define HSI48_VALUE ((uint32_t)48000000U) /*!< Value of the Internal High Speed oscillator for USB FS/SDMMC/RNG in Hz.
|
||||
The real value my vary depending on manufacturing process variations.*/
|
||||
#endif /* HSI48_VALUE */
|
||||
@ -150,8 +137,8 @@
|
||||
/**
|
||||
* @brief Internal Low Speed oscillator (LSI) value.
|
||||
*/
|
||||
#if !defined (LSI_VALUE)
|
||||
#define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/
|
||||
#if !defined (LSI_VALUE)
|
||||
#define LSI_VALUE 32000U /*!< LSI Typical Value in Hz*/
|
||||
#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
|
||||
The real value may vary depending on the variations
|
||||
in voltage and temperature.*/
|
||||
@ -161,29 +148,29 @@
|
||||
* This value is used by the UART, RTC HAL module to compute the system frequency
|
||||
*/
|
||||
#if !defined (LSE_VALUE)
|
||||
#define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External oscillator in Hz*/
|
||||
#define LSE_VALUE 32768U /*!< Value of the External oscillator in Hz*/
|
||||
#endif /* LSE_VALUE */
|
||||
|
||||
#if !defined (LSE_STARTUP_TIMEOUT)
|
||||
#define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */
|
||||
#define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */
|
||||
#endif /* HSE_STARTUP_TIMEOUT */
|
||||
|
||||
/**
|
||||
* @brief External clock source for SAI1 peripheral
|
||||
* This value is used by the RCC HAL module to compute the SAI1 & SAI2 clock source
|
||||
* This value is used by the RCC HAL module to compute the SAI1 & SAI2 clock source
|
||||
* frequency.
|
||||
*/
|
||||
#if !defined (EXTERNAL_SAI1_CLOCK_VALUE)
|
||||
#define EXTERNAL_SAI1_CLOCK_VALUE ((uint32_t)2097000U) /*!< Value of the SAI1 External clock source in Hz*/
|
||||
#define EXTERNAL_SAI1_CLOCK_VALUE 2097000U /*!< Value of the SAI1 External clock source in Hz*/
|
||||
#endif /* EXTERNAL_SAI1_CLOCK_VALUE */
|
||||
|
||||
/**
|
||||
* @brief External clock source for SAI2 peripheral
|
||||
* This value is used by the RCC HAL module to compute the SAI1 & SAI2 clock source
|
||||
* This value is used by the RCC HAL module to compute the SAI1 & SAI2 clock source
|
||||
* frequency.
|
||||
*/
|
||||
#if !defined (EXTERNAL_SAI2_CLOCK_VALUE)
|
||||
#define EXTERNAL_SAI2_CLOCK_VALUE ((uint32_t)2097000U) /*!< Value of the SAI2 External clock source in Hz*/
|
||||
#define EXTERNAL_SAI2_CLOCK_VALUE 2097000U /*!< Value of the SAI2 External clock source in Hz*/
|
||||
#endif /* EXTERNAL_SAI2_CLOCK_VALUE */
|
||||
|
||||
/* Tip: To avoid modifying this file each time you need to use different HSE,
|
||||
@ -192,22 +179,67 @@
|
||||
/* ########################### System Configuration ######################### */
|
||||
/**
|
||||
* @brief This is the HAL system configuration section
|
||||
*/
|
||||
|
||||
#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */
|
||||
#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */
|
||||
#define USE_RTOS 0U
|
||||
*/
|
||||
|
||||
#define VDD_VALUE 3300U /*!< Value of VDD in mv */
|
||||
#define TICK_INT_PRIORITY 0U /*!< tick interrupt priority */
|
||||
#define USE_RTOS 0U
|
||||
#define PREFETCH_ENABLE 0U
|
||||
#define INSTRUCTION_CACHE_ENABLE 1U
|
||||
#define DATA_CACHE_ENABLE 1U
|
||||
|
||||
/* ########################## Assert Selection ############################## */
|
||||
/**
|
||||
* @brief Uncomment the line below to expanse the "assert_param" macro in the
|
||||
* @brief Uncomment the line below to expanse the "assert_param" macro in the
|
||||
* HAL drivers code
|
||||
*/
|
||||
/* #define USE_FULL_ASSERT 1U */
|
||||
|
||||
/* ################## Register callback feature configuration ############### */
|
||||
/**
|
||||
* @brief Set below the peripheral configuration to "1U" to add the support
|
||||
* of HAL callback registration/deregistration feature for the HAL
|
||||
* driver(s). This allows user application to provide specific callback
|
||||
* functions thanks to HAL_PPP_RegisterCallback() rather than overwriting
|
||||
* the default weak callback functions (see each stm32l4xx_hal_ppp.h file
|
||||
* for possible callback identifiers defined in HAL_PPP_CallbackIDTypeDef
|
||||
* for each PPP peripheral).
|
||||
*/
|
||||
#define USE_HAL_ADC_REGISTER_CALLBACKS 0U
|
||||
#define USE_HAL_CAN_REGISTER_CALLBACKS 0U
|
||||
#define USE_HAL_COMP_REGISTER_CALLBACKS 0U
|
||||
#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U
|
||||
#define USE_HAL_DAC_REGISTER_CALLBACKS 0U
|
||||
#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U
|
||||
#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U
|
||||
#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U
|
||||
#define USE_HAL_DSI_REGISTER_CALLBACKS 0U
|
||||
#define USE_HAL_GFXMMU_REGISTER_CALLBACKS 0U
|
||||
#define USE_HAL_HASH_REGISTER_CALLBACKS 0U
|
||||
#define USE_HAL_HCD_REGISTER_CALLBACKS 0U
|
||||
#define USE_HAL_I2C_REGISTER_CALLBACKS 0U
|
||||
#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U
|
||||
#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U
|
||||
#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U
|
||||
#define USE_HAL_MMC_REGISTER_CALLBACKS 0U
|
||||
#define USE_HAL_OPAMP_REGISTER_CALLBACKS 0U
|
||||
#define USE_HAL_OSPI_REGISTER_CALLBACKS 0U
|
||||
#define USE_HAL_PCD_REGISTER_CALLBACKS 0U
|
||||
#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U
|
||||
#define USE_HAL_RNG_REGISTER_CALLBACKS 0U
|
||||
#define USE_HAL_RTC_REGISTER_CALLBACKS 0U
|
||||
#define USE_HAL_SAI_REGISTER_CALLBACKS 0U
|
||||
#define USE_HAL_SD_REGISTER_CALLBACKS 0U
|
||||
#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U
|
||||
#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U
|
||||
#define USE_HAL_SPI_REGISTER_CALLBACKS 0U
|
||||
#define USE_HAL_SWPMI_REGISTER_CALLBACKS 0U
|
||||
#define USE_HAL_TIM_REGISTER_CALLBACKS 0U
|
||||
#define USE_HAL_TSC_REGISTER_CALLBACKS 0U
|
||||
#define USE_HAL_UART_REGISTER_CALLBACKS 0U
|
||||
#define USE_HAL_USART_REGISTER_CALLBACKS 0U
|
||||
#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U
|
||||
|
||||
/* ################## SPI peripheral configuration ########################## */
|
||||
|
||||
/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
|
||||
@ -224,20 +256,14 @@
|
||||
|
||||
#ifdef HAL_RCC_MODULE_ENABLED
|
||||
#include "stm32l4xx_hal_rcc.h"
|
||||
#include "stm32l4xx_hal_rcc_ex.h"
|
||||
#endif /* HAL_RCC_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_EXTI_MODULE_ENABLED
|
||||
#include "stm32l4xx_hal_exti.h"
|
||||
#endif /* HAL_EXTI_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_GPIO_MODULE_ENABLED
|
||||
#include "stm32l4xx_hal_gpio.h"
|
||||
#endif /* HAL_GPIO_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_DMA_MODULE_ENABLED
|
||||
#include "stm32l4xx_hal_dma.h"
|
||||
#include "stm32l4xx_hal_dma_ex.h"
|
||||
#endif /* HAL_DMA_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_DFSDM_MODULE_ENABLED
|
||||
@ -256,6 +282,10 @@
|
||||
#include "stm32l4xx_hal_can.h"
|
||||
#endif /* HAL_CAN_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_CAN_LEGACY_MODULE_ENABLED
|
||||
#include "Legacy/stm32l4xx_hal_can_legacy.h"
|
||||
#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_COMP_MODULE_ENABLED
|
||||
#include "stm32l4xx_hal_comp.h"
|
||||
#endif /* HAL_COMP_MODULE_ENABLED */
|
||||
@ -284,6 +314,14 @@
|
||||
#include "stm32l4xx_hal_dsi.h"
|
||||
#endif /* HAL_DSI_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_EXTI_MODULE_ENABLED
|
||||
#include "stm32l4xx_hal_exti.h"
|
||||
#endif /* HAL_EXTI_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_GFXMMU_MODULE_ENABLED
|
||||
#include "stm32l4xx_hal_gfxmmu.h"
|
||||
#endif /* HAL_GFXMMU_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_FIREWALL_MODULE_ENABLED
|
||||
#include "stm32l4xx_hal_firewall.h"
|
||||
#endif /* HAL_FIREWALL_MODULE_ENABLED */
|
||||
@ -296,26 +334,18 @@
|
||||
#include "stm32l4xx_hal_hash.h"
|
||||
#endif /* HAL_HASH_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_SRAM_MODULE_ENABLED
|
||||
#include "stm32l4xx_hal_sram.h"
|
||||
#endif /* HAL_SRAM_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_MMC_MODULE_ENABLED
|
||||
#include "stm32l4xx_hal_mmc.h"
|
||||
#endif /* HAL_MMC_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_NOR_MODULE_ENABLED
|
||||
#include "stm32l4xx_hal_nor.h"
|
||||
#endif /* HAL_NOR_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_NAND_MODULE_ENABLED
|
||||
#include "stm32l4xx_hal_nand.h"
|
||||
#endif /* HAL_NAND_MODULE_ENABLED */
|
||||
#ifdef HAL_HCD_MODULE_ENABLED
|
||||
#include "stm32l4xx_hal_hcd.h"
|
||||
#endif /* HAL_HCD_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_I2C_MODULE_ENABLED
|
||||
#include "stm32l4xx_hal_i2c.h"
|
||||
#endif /* HAL_I2C_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_IRDA_MODULE_ENABLED
|
||||
#include "stm32l4xx_hal_irda.h"
|
||||
#endif /* HAL_IRDA_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_IWDG_MODULE_ENABLED
|
||||
#include "stm32l4xx_hal_iwdg.h"
|
||||
#endif /* HAL_IWDG_MODULE_ENABLED */
|
||||
@ -332,6 +362,18 @@
|
||||
#include "stm32l4xx_hal_ltdc.h"
|
||||
#endif /* HAL_LTDC_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_MMC_MODULE_ENABLED
|
||||
#include "stm32l4xx_hal_mmc.h"
|
||||
#endif /* HAL_MMC_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_NAND_MODULE_ENABLED
|
||||
#include "stm32l4xx_hal_nand.h"
|
||||
#endif /* HAL_NAND_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_NOR_MODULE_ENABLED
|
||||
#include "stm32l4xx_hal_nor.h"
|
||||
#endif /* HAL_NOR_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_OPAMP_MODULE_ENABLED
|
||||
#include "stm32l4xx_hal_opamp.h"
|
||||
#endif /* HAL_OPAMP_MODULE_ENABLED */
|
||||
@ -340,9 +382,17 @@
|
||||
#include "stm32l4xx_hal_ospi.h"
|
||||
#endif /* HAL_OSPI_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_PCD_MODULE_ENABLED
|
||||
#include "stm32l4xx_hal_pcd.h"
|
||||
#endif /* HAL_PCD_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_PKA_MODULE_ENABLED
|
||||
#include "stm32l4xx_hal_pka.h"
|
||||
#endif /* HAL_PWR_MODULE_ENABLED */
|
||||
#endif /* HAL_PKA_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_PSSI_MODULE_ENABLED
|
||||
#include "stm32l4xx_hal_pssi.h"
|
||||
#endif /* HAL_PSSI_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_PWR_MODULE_ENABLED
|
||||
#include "stm32l4xx_hal_pwr.h"
|
||||
@ -368,6 +418,10 @@
|
||||
#include "stm32l4xx_hal_sd.h"
|
||||
#endif /* HAL_SD_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_SMARTCARD_MODULE_ENABLED
|
||||
#include "stm32l4xx_hal_smartcard.h"
|
||||
#endif /* HAL_SMARTCARD_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_SMBUS_MODULE_ENABLED
|
||||
#include "stm32l4xx_hal_smbus.h"
|
||||
#endif /* HAL_SMBUS_MODULE_ENABLED */
|
||||
@ -376,6 +430,10 @@
|
||||
#include "stm32l4xx_hal_spi.h"
|
||||
#endif /* HAL_SPI_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_SRAM_MODULE_ENABLED
|
||||
#include "stm32l4xx_hal_sram.h"
|
||||
#endif /* HAL_SRAM_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_SWPMI_MODULE_ENABLED
|
||||
#include "stm32l4xx_hal_swpmi.h"
|
||||
#endif /* HAL_SWPMI_MODULE_ENABLED */
|
||||
@ -396,39 +454,15 @@
|
||||
#include "stm32l4xx_hal_usart.h"
|
||||
#endif /* HAL_USART_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_IRDA_MODULE_ENABLED
|
||||
#include "stm32l4xx_hal_irda.h"
|
||||
#endif /* HAL_IRDA_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_SMARTCARD_MODULE_ENABLED
|
||||
#include "stm32l4xx_hal_smartcard.h"
|
||||
#endif /* HAL_SMARTCARD_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_WWDG_MODULE_ENABLED
|
||||
#include "stm32l4xx_hal_wwdg.h"
|
||||
#endif /* HAL_WWDG_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_PCD_MODULE_ENABLED
|
||||
#include "stm32l4xx_hal_pcd.h"
|
||||
#endif /* HAL_PCD_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_HCD_MODULE_ENABLED
|
||||
#include "stm32l4xx_hal_hcd.h"
|
||||
#endif /* HAL_HCD_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_GFXMMU_MODULE_ENABLED
|
||||
#include "stm32l4xx_hal_gfxmmu.h"
|
||||
#endif /* HAL_GFXMMU_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_PSSI_MODULE_ENABLED
|
||||
#include "stm32l4xx_hal_pssi.h"
|
||||
#endif /* HAL_PSSI_MODULE_ENABLED */
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
#ifdef USE_FULL_ASSERT
|
||||
/**
|
||||
* @brief The assert_param macro is used for function's parameters check.
|
||||
* @param expr: If expr is false, it calls assert_failed function
|
||||
* @param expr If expr is false, it calls assert_failed function
|
||||
* which reports the name of the source file and the source
|
||||
* line number of the call that failed.
|
||||
* If expr is true, it returns no value.
|
||||
@ -436,7 +470,7 @@
|
||||
*/
|
||||
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
|
||||
/* Exported functions ------------------------------------------------------- */
|
||||
void assert_failed(char *file, uint32_t line);
|
||||
void assert_failed(uint8_t *file, uint32_t line);
|
||||
#else
|
||||
#define assert_param(expr) ((void)0U)
|
||||
#endif /* USE_FULL_ASSERT */
|
||||
@ -445,6 +479,4 @@
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __STM32L4xx_HAL_CONF_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
#endif /* STM32L4xx_HAL_CONF_H */
|
||||
|
@ -39,7 +39,7 @@
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
@ -80,5 +80,3 @@ void SysTick_Handler(void);
|
||||
#endif
|
||||
|
||||
#endif /* __STM32L4xx_IT_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
|
@ -78,7 +78,9 @@
|
||||
/* USER CODE BEGIN 0 */
|
||||
|
||||
/* USER CODE END 0 */
|
||||
/**
|
||||
|
||||
void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);
|
||||
/**
|
||||
* Initializes the Global MSP.
|
||||
*/
|
||||
void HAL_MspInit(void)
|
||||
@ -97,8 +99,6 @@ void HAL_MspInit(void)
|
||||
/* USER CODE END MspInit 1 */
|
||||
}
|
||||
|
||||
static uint32_t HAL_RCC_ADC_CLK_ENABLED=0;
|
||||
|
||||
/**
|
||||
* @brief ADC MSP Initialization
|
||||
* This function configures the hardware resources used in this example
|
||||
@ -108,78 +108,62 @@ static uint32_t HAL_RCC_ADC_CLK_ENABLED=0;
|
||||
void HAL_ADC_MspInit(ADC_HandleTypeDef* hadc)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
||||
RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
|
||||
if(hadc->Instance==ADC1)
|
||||
{
|
||||
/* USER CODE BEGIN ADC1_MspInit 0 */
|
||||
|
||||
/* USER CODE END ADC1_MspInit 0 */
|
||||
/* Peripheral clock enable */
|
||||
HAL_RCC_ADC_CLK_ENABLED++;
|
||||
if(HAL_RCC_ADC_CLK_ENABLED==1){
|
||||
__HAL_RCC_ADC_CLK_ENABLE();
|
||||
|
||||
/** Initializes the peripherals clock
|
||||
*/
|
||||
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_ADC;
|
||||
PeriphClkInit.AdcClockSelection = RCC_ADCCLKSOURCE_PLLSAI1;
|
||||
PeriphClkInit.PLLSAI1.PLLSAI1Source = RCC_PLLSOURCE_HSI;
|
||||
PeriphClkInit.PLLSAI1.PLLSAI1M = 1;
|
||||
PeriphClkInit.PLLSAI1.PLLSAI1N = 8;
|
||||
PeriphClkInit.PLLSAI1.PLLSAI1P = RCC_PLLP_DIV7;
|
||||
PeriphClkInit.PLLSAI1.PLLSAI1Q = RCC_PLLQ_DIV2;
|
||||
PeriphClkInit.PLLSAI1.PLLSAI1R = RCC_PLLR_DIV2;
|
||||
PeriphClkInit.PLLSAI1.PLLSAI1ClockOut = RCC_PLLSAI1_ADC1CLK;
|
||||
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
/* Peripheral clock enable */
|
||||
__HAL_RCC_ADC_CLK_ENABLE();
|
||||
|
||||
__HAL_RCC_GPIOC_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOB_CLK_ENABLE();
|
||||
/**ADC1 GPIO Configuration
|
||||
PC0 ------> ADC1_IN1
|
||||
PC1 ------> ADC1_IN2
|
||||
PA0 ------> ADC1_IN5
|
||||
PA1 ------> ADC1_IN6
|
||||
PA4 ------> ADC1_IN9
|
||||
PB0 ------> ADC1_IN15
|
||||
*/
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_0;
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG_ADC_CONTROL;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
|
||||
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_4;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG_ADC_CONTROL;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_0;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG_ADC_CONTROL;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||
|
||||
/* USER CODE BEGIN ADC1_MspInit 1 */
|
||||
|
||||
/* USER CODE END ADC1_MspInit 1 */
|
||||
}
|
||||
else if(hadc->Instance==ADC2)
|
||||
{
|
||||
/* USER CODE BEGIN ADC2_MspInit 0 */
|
||||
|
||||
/* USER CODE END ADC2_MspInit 0 */
|
||||
/* Peripheral clock enable */
|
||||
HAL_RCC_ADC_CLK_ENABLED++;
|
||||
if(HAL_RCC_ADC_CLK_ENABLED==1){
|
||||
__HAL_RCC_ADC_CLK_ENABLE();
|
||||
}
|
||||
|
||||
__HAL_RCC_GPIOC_CLK_ENABLE();
|
||||
/**ADC2 GPIO Configuration
|
||||
PC1 ------> ADC2_IN2
|
||||
*/
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_1;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG_ADC_CONTROL;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
|
||||
|
||||
/* USER CODE BEGIN ADC2_MspInit 1 */
|
||||
|
||||
/* USER CODE END ADC2_MspInit 1 */
|
||||
}
|
||||
else if(hadc->Instance==ADC3)
|
||||
{
|
||||
/* USER CODE BEGIN ADC3_MspInit 0 */
|
||||
|
||||
/* USER CODE END ADC3_MspInit 0 */
|
||||
/* Peripheral clock enable */
|
||||
HAL_RCC_ADC_CLK_ENABLED++;
|
||||
if(HAL_RCC_ADC_CLK_ENABLED==1){
|
||||
__HAL_RCC_ADC_CLK_ENABLE();
|
||||
}
|
||||
|
||||
__HAL_RCC_GPIOC_CLK_ENABLE();
|
||||
/**ADC3 GPIO Configuration
|
||||
PC2 ------> ADC3_IN3
|
||||
*/
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_2;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG_ADC_CONTROL;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
|
||||
|
||||
/* USER CODE BEGIN ADC3_MspInit 1 */
|
||||
|
||||
/* USER CODE END ADC3_MspInit 1 */
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -197,60 +181,26 @@ void HAL_ADC_MspDeInit(ADC_HandleTypeDef* hadc)
|
||||
|
||||
/* USER CODE END ADC1_MspDeInit 0 */
|
||||
/* Peripheral clock disable */
|
||||
HAL_RCC_ADC_CLK_ENABLED--;
|
||||
if(HAL_RCC_ADC_CLK_ENABLED==0){
|
||||
__HAL_RCC_ADC_CLK_DISABLE();
|
||||
}
|
||||
__HAL_RCC_ADC_CLK_DISABLE();
|
||||
|
||||
/**ADC1 GPIO Configuration
|
||||
PC0 ------> ADC1_IN1
|
||||
PC1 ------> ADC1_IN2
|
||||
PA0 ------> ADC1_IN5
|
||||
PA1 ------> ADC1_IN6
|
||||
PA4 ------> ADC1_IN9
|
||||
PB0 ------> ADC1_IN15
|
||||
*/
|
||||
HAL_GPIO_DeInit(GPIOC, GPIO_PIN_0);
|
||||
HAL_GPIO_DeInit(GPIOC, GPIO_PIN_0|GPIO_PIN_1);
|
||||
|
||||
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_4);
|
||||
|
||||
HAL_GPIO_DeInit(GPIOB, GPIO_PIN_0);
|
||||
|
||||
/* USER CODE BEGIN ADC1_MspDeInit 1 */
|
||||
|
||||
/* USER CODE END ADC1_MspDeInit 1 */
|
||||
}
|
||||
else if(hadc->Instance==ADC2)
|
||||
{
|
||||
/* USER CODE BEGIN ADC2_MspDeInit 0 */
|
||||
|
||||
/* USER CODE END ADC2_MspDeInit 0 */
|
||||
/* Peripheral clock disable */
|
||||
HAL_RCC_ADC_CLK_ENABLED--;
|
||||
if(HAL_RCC_ADC_CLK_ENABLED==0){
|
||||
__HAL_RCC_ADC_CLK_DISABLE();
|
||||
}
|
||||
|
||||
/**ADC2 GPIO Configuration
|
||||
PC1 ------> ADC2_IN2
|
||||
*/
|
||||
HAL_GPIO_DeInit(GPIOC, GPIO_PIN_1);
|
||||
|
||||
/* USER CODE BEGIN ADC2_MspDeInit 1 */
|
||||
|
||||
/* USER CODE END ADC2_MspDeInit 1 */
|
||||
}
|
||||
else if(hadc->Instance==ADC3)
|
||||
{
|
||||
/* USER CODE BEGIN ADC3_MspDeInit 0 */
|
||||
|
||||
/* USER CODE END ADC3_MspDeInit 0 */
|
||||
/* Peripheral clock disable */
|
||||
HAL_RCC_ADC_CLK_ENABLED--;
|
||||
if(HAL_RCC_ADC_CLK_ENABLED==0){
|
||||
__HAL_RCC_ADC_CLK_DISABLE();
|
||||
}
|
||||
|
||||
/**ADC3 GPIO Configuration
|
||||
PC2 ------> ADC3_IN3
|
||||
*/
|
||||
HAL_GPIO_DeInit(GPIOC, GPIO_PIN_2);
|
||||
|
||||
/* USER CODE BEGIN ADC3_MspDeInit 1 */
|
||||
|
||||
/* USER CODE END ADC3_MspDeInit 1 */
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -262,11 +212,22 @@ void HAL_ADC_MspDeInit(ADC_HandleTypeDef* hadc)
|
||||
*/
|
||||
void HAL_LPTIM_MspInit(LPTIM_HandleTypeDef* hlptim)
|
||||
{
|
||||
RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
|
||||
if(hlptim->Instance==LPTIM1)
|
||||
{
|
||||
/* USER CODE BEGIN LPTIM1_MspInit 0 */
|
||||
|
||||
/* USER CODE END LPTIM1_MspInit 0 */
|
||||
|
||||
/** Initializes the peripherals clock
|
||||
*/
|
||||
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_LPTIM1;
|
||||
PeriphClkInit.Lptim1ClockSelection = RCC_LPTIM1CLKSOURCE_PCLK;
|
||||
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
/* Peripheral clock enable */
|
||||
__HAL_RCC_LPTIM1_CLK_ENABLE();
|
||||
/* USER CODE BEGIN LPTIM1_MspInit 1 */
|
||||
@ -306,11 +267,22 @@ void HAL_LPTIM_MspDeInit(LPTIM_HandleTypeDef* hlptim)
|
||||
*/
|
||||
void HAL_RTC_MspInit(RTC_HandleTypeDef* hrtc)
|
||||
{
|
||||
RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
|
||||
if(hrtc->Instance==RTC)
|
||||
{
|
||||
/* USER CODE BEGIN RTC_MspInit 0 */
|
||||
|
||||
/* USER CODE END RTC_MspInit 0 */
|
||||
|
||||
/** Initializes the peripherals clock
|
||||
*/
|
||||
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_RTC;
|
||||
PeriphClkInit.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
|
||||
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
/* Peripheral clock enable */
|
||||
__HAL_RCC_RTC_ENABLE();
|
||||
/* USER CODE BEGIN RTC_MspInit 1 */
|
||||
@ -351,65 +323,7 @@ void HAL_RTC_MspDeInit(RTC_HandleTypeDef* hrtc)
|
||||
void HAL_SPI_MspInit(SPI_HandleTypeDef* hspi)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
||||
if(hspi->Instance==SPI1)
|
||||
{
|
||||
/* USER CODE BEGIN SPI1_MspInit 0 */
|
||||
|
||||
/* USER CODE END SPI1_MspInit 0 */
|
||||
/* Peripheral clock enable */
|
||||
__HAL_RCC_SPI1_CLK_ENABLE();
|
||||
|
||||
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
/**SPI1 GPIO Configuration
|
||||
PA5 ------> SPI1_SCK
|
||||
PA6 ------> SPI1_MISO
|
||||
PA7 ------> SPI1_MOSI
|
||||
*/
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
GPIO_InitStruct.Alternate = GPIO_AF5_SPI1;
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
|
||||
/* USER CODE BEGIN SPI1_MspInit 1 */
|
||||
|
||||
/* USER CODE END SPI1_MspInit 1 */
|
||||
}
|
||||
else if(hspi->Instance==SPI2)
|
||||
{
|
||||
/* USER CODE BEGIN SPI2_MspInit 0 */
|
||||
|
||||
/* USER CODE END SPI2_MspInit 0 */
|
||||
/* Peripheral clock enable */
|
||||
__HAL_RCC_SPI2_CLK_ENABLE();
|
||||
|
||||
__HAL_RCC_GPIOC_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOB_CLK_ENABLE();
|
||||
/**SPI2 GPIO Configuration
|
||||
PC3 ------> SPI2_MOSI
|
||||
PB10 ------> SPI2_SCK
|
||||
PB14 ------> SPI2_MISO
|
||||
*/
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_3;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
GPIO_InitStruct.Alternate = GPIO_AF5_SPI2;
|
||||
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
|
||||
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_10|GPIO_PIN_14;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
GPIO_InitStruct.Alternate = GPIO_AF5_SPI2;
|
||||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||
|
||||
/* USER CODE BEGIN SPI2_MspInit 1 */
|
||||
|
||||
/* USER CODE END SPI2_MspInit 1 */
|
||||
}
|
||||
else if(hspi->Instance==SPI3)
|
||||
if(hspi->Instance==SPI3)
|
||||
{
|
||||
/* USER CODE BEGIN SPI3_MspInit 0 */
|
||||
|
||||
@ -445,47 +359,7 @@ void HAL_SPI_MspInit(SPI_HandleTypeDef* hspi)
|
||||
*/
|
||||
void HAL_SPI_MspDeInit(SPI_HandleTypeDef* hspi)
|
||||
{
|
||||
if(hspi->Instance==SPI1)
|
||||
{
|
||||
/* USER CODE BEGIN SPI1_MspDeInit 0 */
|
||||
|
||||
/* USER CODE END SPI1_MspDeInit 0 */
|
||||
/* Peripheral clock disable */
|
||||
__HAL_RCC_SPI1_CLK_DISABLE();
|
||||
|
||||
/**SPI1 GPIO Configuration
|
||||
PA5 ------> SPI1_SCK
|
||||
PA6 ------> SPI1_MISO
|
||||
PA7 ------> SPI1_MOSI
|
||||
*/
|
||||
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7);
|
||||
|
||||
/* USER CODE BEGIN SPI1_MspDeInit 1 */
|
||||
|
||||
/* USER CODE END SPI1_MspDeInit 1 */
|
||||
}
|
||||
else if(hspi->Instance==SPI2)
|
||||
{
|
||||
/* USER CODE BEGIN SPI2_MspDeInit 0 */
|
||||
|
||||
/* USER CODE END SPI2_MspDeInit 0 */
|
||||
/* Peripheral clock disable */
|
||||
__HAL_RCC_SPI2_CLK_DISABLE();
|
||||
|
||||
/**SPI2 GPIO Configuration
|
||||
PC3 ------> SPI2_MOSI
|
||||
PB10 ------> SPI2_SCK
|
||||
PB14 ------> SPI2_MISO
|
||||
*/
|
||||
HAL_GPIO_DeInit(GPIOC, GPIO_PIN_3);
|
||||
|
||||
HAL_GPIO_DeInit(GPIOB, GPIO_PIN_10|GPIO_PIN_14);
|
||||
|
||||
/* USER CODE BEGIN SPI2_MspDeInit 1 */
|
||||
|
||||
/* USER CODE END SPI2_MspDeInit 1 */
|
||||
}
|
||||
else if(hspi->Instance==SPI3)
|
||||
if(hspi->Instance==SPI3)
|
||||
{
|
||||
/* USER CODE BEGIN SPI3_MspDeInit 0 */
|
||||
|
||||
@ -507,6 +381,50 @@ void HAL_SPI_MspDeInit(SPI_HandleTypeDef* hspi)
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TIM_PWM MSP Initialization
|
||||
* This function configures the hardware resources used in this example
|
||||
* @param htim_pwm: TIM_PWM handle pointer
|
||||
* @retval None
|
||||
*/
|
||||
void HAL_TIM_PWM_MspInit(TIM_HandleTypeDef* htim_pwm)
|
||||
{
|
||||
if(htim_pwm->Instance==TIM2)
|
||||
{
|
||||
/* USER CODE BEGIN TIM2_MspInit 0 */
|
||||
|
||||
/* USER CODE END TIM2_MspInit 0 */
|
||||
/* Peripheral clock enable */
|
||||
__HAL_RCC_TIM2_CLK_ENABLE();
|
||||
/* USER CODE BEGIN TIM2_MspInit 1 */
|
||||
|
||||
/* USER CODE END TIM2_MspInit 1 */
|
||||
}
|
||||
else if(htim_pwm->Instance==TIM3)
|
||||
{
|
||||
/* USER CODE BEGIN TIM3_MspInit 0 */
|
||||
|
||||
/* USER CODE END TIM3_MspInit 0 */
|
||||
/* Peripheral clock enable */
|
||||
__HAL_RCC_TIM3_CLK_ENABLE();
|
||||
/* USER CODE BEGIN TIM3_MspInit 1 */
|
||||
|
||||
/* USER CODE END TIM3_MspInit 1 */
|
||||
}
|
||||
else if(htim_pwm->Instance==TIM4)
|
||||
{
|
||||
/* USER CODE BEGIN TIM4_MspInit 0 */
|
||||
|
||||
/* USER CODE END TIM4_MspInit 0 */
|
||||
/* Peripheral clock enable */
|
||||
__HAL_RCC_TIM4_CLK_ENABLE();
|
||||
/* USER CODE BEGIN TIM4_MspInit 1 */
|
||||
|
||||
/* USER CODE END TIM4_MspInit 1 */
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TIM_Base MSP Initialization
|
||||
* This function configures the hardware resources used in this example
|
||||
@ -551,6 +469,148 @@ void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* htim_base)
|
||||
|
||||
}
|
||||
|
||||
void HAL_TIM_MspPostInit(TIM_HandleTypeDef* htim)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
||||
if(htim->Instance==TIM2)
|
||||
{
|
||||
/* USER CODE BEGIN TIM2_MspPostInit 0 */
|
||||
|
||||
/* USER CODE END TIM2_MspPostInit 0 */
|
||||
__HAL_RCC_GPIOB_CLK_ENABLE();
|
||||
/**TIM2 GPIO Configuration
|
||||
PB10 ------> TIM2_CH3
|
||||
PB3 (JTDO-TRACESWO) ------> TIM2_CH2
|
||||
*/
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_10|GPIO_PIN_3;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
GPIO_InitStruct.Alternate = GPIO_AF1_TIM2;
|
||||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||
|
||||
/* USER CODE BEGIN TIM2_MspPostInit 1 */
|
||||
|
||||
/* USER CODE END TIM2_MspPostInit 1 */
|
||||
}
|
||||
else if(htim->Instance==TIM3)
|
||||
{
|
||||
/* USER CODE BEGIN TIM3_MspPostInit 0 */
|
||||
|
||||
/* USER CODE END TIM3_MspPostInit 0 */
|
||||
|
||||
__HAL_RCC_GPIOC_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOB_CLK_ENABLE();
|
||||
/**TIM3 GPIO Configuration
|
||||
PC7 ------> TIM3_CH2
|
||||
PB4 (NJTRST) ------> TIM3_CH1
|
||||
*/
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_7;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
GPIO_InitStruct.Alternate = GPIO_AF2_TIM3;
|
||||
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
|
||||
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_4;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
GPIO_InitStruct.Alternate = GPIO_AF2_TIM3;
|
||||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||
|
||||
/* USER CODE BEGIN TIM3_MspPostInit 1 */
|
||||
|
||||
/* USER CODE END TIM3_MspPostInit 1 */
|
||||
}
|
||||
else if(htim->Instance==TIM4)
|
||||
{
|
||||
/* USER CODE BEGIN TIM4_MspPostInit 0 */
|
||||
|
||||
/* USER CODE END TIM4_MspPostInit 0 */
|
||||
|
||||
__HAL_RCC_GPIOB_CLK_ENABLE();
|
||||
/**TIM4 GPIO Configuration
|
||||
PB6 ------> TIM4_CH1
|
||||
*/
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_6;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
GPIO_InitStruct.Alternate = GPIO_AF2_TIM4;
|
||||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||
|
||||
/* USER CODE BEGIN TIM4_MspPostInit 1 */
|
||||
|
||||
/* USER CODE END TIM4_MspPostInit 1 */
|
||||
}
|
||||
else if(htim->Instance==TIM17)
|
||||
{
|
||||
/* USER CODE BEGIN TIM17_MspPostInit 0 */
|
||||
|
||||
/* USER CODE END TIM17_MspPostInit 0 */
|
||||
|
||||
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
/**TIM17 GPIO Configuration
|
||||
PA7 ------> TIM17_CH1
|
||||
*/
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_7;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
GPIO_InitStruct.Alternate = GPIO_AF14_TIM17;
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
|
||||
/* USER CODE BEGIN TIM17_MspPostInit 1 */
|
||||
|
||||
/* USER CODE END TIM17_MspPostInit 1 */
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* @brief TIM_PWM MSP De-Initialization
|
||||
* This function freeze the hardware resources used in this example
|
||||
* @param htim_pwm: TIM_PWM handle pointer
|
||||
* @retval None
|
||||
*/
|
||||
void HAL_TIM_PWM_MspDeInit(TIM_HandleTypeDef* htim_pwm)
|
||||
{
|
||||
if(htim_pwm->Instance==TIM2)
|
||||
{
|
||||
/* USER CODE BEGIN TIM2_MspDeInit 0 */
|
||||
|
||||
/* USER CODE END TIM2_MspDeInit 0 */
|
||||
/* Peripheral clock disable */
|
||||
__HAL_RCC_TIM2_CLK_DISABLE();
|
||||
/* USER CODE BEGIN TIM2_MspDeInit 1 */
|
||||
|
||||
/* USER CODE END TIM2_MspDeInit 1 */
|
||||
}
|
||||
else if(htim_pwm->Instance==TIM3)
|
||||
{
|
||||
/* USER CODE BEGIN TIM3_MspDeInit 0 */
|
||||
|
||||
/* USER CODE END TIM3_MspDeInit 0 */
|
||||
/* Peripheral clock disable */
|
||||
__HAL_RCC_TIM3_CLK_DISABLE();
|
||||
/* USER CODE BEGIN TIM3_MspDeInit 1 */
|
||||
|
||||
/* USER CODE END TIM3_MspDeInit 1 */
|
||||
}
|
||||
else if(htim_pwm->Instance==TIM4)
|
||||
{
|
||||
/* USER CODE BEGIN TIM4_MspDeInit 0 */
|
||||
|
||||
/* USER CODE END TIM4_MspDeInit 0 */
|
||||
/* Peripheral clock disable */
|
||||
__HAL_RCC_TIM4_CLK_DISABLE();
|
||||
/* USER CODE BEGIN TIM4_MspDeInit 1 */
|
||||
|
||||
/* USER CODE END TIM4_MspDeInit 1 */
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TIM_Base MSP De-Initialization
|
||||
* This function freeze the hardware resources used in this example
|
||||
@ -604,11 +664,22 @@ void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* htim_base)
|
||||
void HAL_UART_MspInit(UART_HandleTypeDef* huart)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
||||
RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
|
||||
if(huart->Instance==USART2)
|
||||
{
|
||||
/* USER CODE BEGIN USART2_MspInit 0 */
|
||||
|
||||
/* USER CODE END USART2_MspInit 0 */
|
||||
|
||||
/** Initializes the peripherals clock
|
||||
*/
|
||||
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USART2;
|
||||
PeriphClkInit.Usart2ClockSelection = RCC_USART2CLKSOURCE_PCLK1;
|
||||
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
/* Peripheral clock enable */
|
||||
__HAL_RCC_USART2_CLK_ENABLE();
|
||||
|
||||
@ -663,5 +734,3 @@ void HAL_UART_MspDeInit(UART_HandleTypeDef* huart)
|
||||
/* USER CODE BEGIN 1 */
|
||||
|
||||
/* USER CODE END 1 */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
|
@ -77,7 +77,7 @@
|
||||
/* USER CODE END EV */
|
||||
|
||||
/******************************************************************************/
|
||||
/* Cortex-M4 Processor Interruption and Exception Handlers */
|
||||
/* Cortex-M4 Processor Interruption and Exception Handlers */
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* @brief This function handles Non maskable interrupt.
|
||||
@ -215,4 +215,3 @@ void SysTick_Handler(void)
|
||||
/* USER CODE BEGIN 1 */
|
||||
|
||||
/* USER CODE END 1 */
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
|
@ -15,6 +15,30 @@ menu "Onboard Peripheral Drivers"
|
||||
select BSP_USING_UART2
|
||||
default y
|
||||
|
||||
config BSP_USING_ARDUINO
|
||||
bool "Compatible with Arduino Ecosystem (RTduino)"
|
||||
select PKG_USING_RTDUINO
|
||||
select BSP_USING_STLINK_TO_USART
|
||||
select BSP_USING_GPIO
|
||||
select BSP_USING_ADC
|
||||
select BSP_USING_ADC1
|
||||
select BSP_USING_PWM
|
||||
select BSP_USING_PWM2
|
||||
select BSP_USING_PWM2_CH2
|
||||
select BSP_USING_PWM2_CH3
|
||||
select BSP_USING_PWM3
|
||||
select BSP_USING_PWM3_CH0
|
||||
select BSP_USING_PWM3_CH1
|
||||
select BSP_USING_PWM4
|
||||
select BSP_USING_PWM4_CH1
|
||||
select BSP_USING_PWM17
|
||||
select BSP_USING_PWM17_CH1
|
||||
select BSP_USING_I2C
|
||||
select BSP_USING_I2C1
|
||||
imply RTDUINO_USING_SERVO
|
||||
imply RTDUINO_USING_WIRE
|
||||
default n
|
||||
|
||||
endmenu
|
||||
|
||||
menu "On-chip Peripheral Drivers"
|
||||
@ -45,29 +69,34 @@ menu "On-chip Peripheral Drivers"
|
||||
select RT_USING_I2C
|
||||
select RT_USING_I2C_BITOPS
|
||||
select RT_USING_PIN
|
||||
|
||||
if BSP_USING_I2C
|
||||
config BSP_USING_I2C1
|
||||
bool "Enable I2C1 BUS (software simulation)"
|
||||
default n
|
||||
bool "Enable I2C1 BUS (software simulation)"
|
||||
default n
|
||||
|
||||
if BSP_USING_I2C1
|
||||
config BSP_I2C1_SCL_PIN
|
||||
int "i2c1 scl pin number"
|
||||
int "i2c1 scl pin number (PB8)"
|
||||
range 1 176
|
||||
default 22
|
||||
default 24
|
||||
|
||||
config BSP_I2C1_SDA_PIN
|
||||
int "I2C1 sda pin number"
|
||||
int "i2c1 sda pin number (PB9)"
|
||||
range 1 176
|
||||
default 23
|
||||
default 25
|
||||
endif
|
||||
|
||||
config BSP_USING_I2C2
|
||||
bool "Enable I2C2 BUS (software simulation)"
|
||||
default n
|
||||
bool "Enable I2C2 BUS (software simulation)"
|
||||
default n
|
||||
|
||||
if BSP_USING_I2C2
|
||||
config BSP_I2C2_SCL_PIN
|
||||
int "i2c2 scl pin number"
|
||||
range 1 176
|
||||
default 26
|
||||
|
||||
config BSP_I2C2_SDA_PIN
|
||||
int "I2C2 sda pin number"
|
||||
range 1 176
|
||||
@ -75,13 +104,15 @@ menu "On-chip Peripheral Drivers"
|
||||
endif
|
||||
|
||||
config BSP_USING_I2C3
|
||||
bool "Enable I2C3 BUS (software simulation)"
|
||||
default n
|
||||
bool "Enable I2C3 BUS (software simulation)"
|
||||
default n
|
||||
|
||||
if BSP_USING_I2C3
|
||||
config BSP_I2C3_SCL_PIN
|
||||
int "i2c3 scl pin number"
|
||||
range 1 176
|
||||
default 32
|
||||
|
||||
config BSP_I2C3_SDA_PIN
|
||||
int "I2C3 sda pin number"
|
||||
range 1 176
|
||||
@ -158,6 +189,55 @@ menu "On-chip Peripheral Drivers"
|
||||
default n
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_PWM
|
||||
bool "Enable PWM"
|
||||
default n
|
||||
select RT_USING_PWM
|
||||
if BSP_USING_PWM
|
||||
menuconfig BSP_USING_PWM2
|
||||
bool "Enable timer2 output PWM"
|
||||
default n
|
||||
if BSP_USING_PWM2
|
||||
config BSP_USING_PWM2_CH2
|
||||
bool "Enable PWM2 channel2"
|
||||
default n
|
||||
config BSP_USING_PWM2_CH3
|
||||
bool "Enable PWM2 channel3"
|
||||
default n
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_PWM3
|
||||
bool "Enable timer3 output PWM"
|
||||
default n
|
||||
if BSP_USING_PWM3
|
||||
config BSP_USING_PWM3_CH0
|
||||
bool "Enable PWM3 channel0"
|
||||
default n
|
||||
config BSP_USING_PWM3_CH1
|
||||
bool "Enable PWM3 channel1"
|
||||
default n
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_PWM4
|
||||
bool "Enable timer4 output PWM"
|
||||
default n
|
||||
if BSP_USING_PWM4
|
||||
config BSP_USING_PWM4_CH1
|
||||
bool "Enable PWM4 channel1"
|
||||
default n
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_PWM17
|
||||
bool "Enable timer17 output PWM"
|
||||
default n
|
||||
if BSP_USING_PWM17
|
||||
config BSP_USING_PWM17_CH1
|
||||
bool "Enable PWM17 channel1"
|
||||
default n
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_ADC
|
||||
bool "Enable ADC"
|
||||
default n
|
||||
|
Loading…
x
Reference in New Issue
Block a user