-
大小: 283KB文件類型: .zip金幣: 2下載: 0 次發布日期: 2021-06-14
- 語言: 其他
- 標簽: STM32cubeMX??PWM??
資源簡介
該資源使用STM33cubeMX 在STM32F103C8T6芯片上實現了一個頻率1000Hz,占空比50%的PWM的輸出

代碼片段和文件信息
/*?USER?CODE?BEGIN?Header?*/
/**
??******************************************************************************
??*?@file???????????:?main.c
??*?@brief??????????:?Main?program?body
??******************************************************************************
??*?@attention
??*
??*?©?Copyright?(c)?2020?STMicroelectronics.
??*?All?rights?reserved.
??*
??*?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
??*
??******************************************************************************
??*/
/*?USER?CODE?END?Header?*/
/*?Includes?------------------------------------------------------------------*/
#include?“main.h“
/*?Private?includes?----------------------------------------------------------*/
/*?USER?CODE?BEGIN?Includes?*/
#include?“y_debug.h“
/*?USER?CODE?END?Includes?*/
/*?Private?typedef?-----------------------------------------------------------*/
/*?USER?CODE?BEGIN?PTD?*/
/*?USER?CODE?END?PTD?*/
/*?Private?define?------------------------------------------------------------*/
/*?USER?CODE?BEGIN?PD?*/
/*?USER?CODE?END?PD?*/
/*?Private?macro?-------------------------------------------------------------*/
/*?USER?CODE?BEGIN?PM?*/
/*?USER?CODE?END?PM?*/
/*?Private?variables?---------------------------------------------------------*/
TIM_HandleTypeDef?htim1;
TIM_HandleTypeDef?htim2;
TIM_HandleTypeDef?htim3;
TIM_HandleTypeDef?htim4;
UART_HandleTypeDef?huart1;
/*?USER?CODE?BEGIN?PV?*/
/*?USER?CODE?END?PV?*/
/*?Private?function?prototypes?-----------------------------------------------*/
void?SystemClock_Config(void);
static?void?MX_GPIO_Init(void);
static?void?MX_TIM1_Init(void);
static?void?MX_TIM2_Init(void);
static?void?MX_TIM4_Init(void);
static?void?MX_USART1_UART_Init(void);
static?void?MX_TIM3_Init(void);
/*?USER?CODE?BEGIN?PFP?*/
/*?USER?CODE?END?PFP?*/
/*?Private?user?code?---------------------------------------------------------*/
/*?USER?CODE?BEGIN?0?*/
/*?USER?CODE?END?0?*/
/**
??*?@brief??The?application?entry?point.
??*?@retval?int
??*/
int?main(void)
{
??/*?USER?CODE?BEGIN?1?*/
??/*?USER?CODE?END?1?*/
??/*?MCU?Configuration--------------------------------------------------------*/
??/*?Reset?of?all?peripherals?Initializes?the?Flash?interface?and?the?Systick.?*/
??HAL_Init();
??/*?USER?CODE?BEGIN?Init?*/
??/*?USER?CODE?END?Init?*/
??/*?Configure?the?system?clock?*/
??SystemClock_Config();
??/*?USER?CODE?BEGIN?SysInit?*/
??/*?USER?CODE?END?SysInit?*/
??/*?Initialize?all?configured?peripherals?*/
??MX_GPIO_Init();
??MX_TIM1_Init();
??MX_TIM2_Init();
??MX_TIM4_Init();
??MX_USART1_UART_Init();
??MX_TIM3_Init();
??/*?USER?CODE?BEGIN?2?*/
printf(“begin\n“);
HAL
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????7838??2020-06-07?11:38??.mxproject
?????文件????????2235??2020-06-07?11:38??Inc\main.h
?????文件???????16022??2020-06-07?11:38??Inc\stm32f1xx_hal_conf.h
?????文件????????2165??2020-06-07?11:38??Inc\stm32f1xx_it.h
?????文件?????????516??2020-06-03?22:02??Inc\y_debug.h
?????目錄???????????0??2020-06-03?21:53??MDK-ARM\DebugConfig\
?????文件????????2403??2017-11-23?15:41??MDK-ARM\DebugConfig\test_STM32F103C8_1.0.0.dbgconf
?????文件???????81070??2020-06-07?11:45??MDK-ARM\Jli
?????文件?????????755??2020-06-03?22:07??MDK-ARM\Jli
?????目錄???????????0??2020-06-03?21:53??MDK-ARM\RTE\
?????目錄???????????0??2020-06-03?21:53??MDK-ARM\RTE\_test\
?????文件?????????332??2020-06-03?21:53??MDK-ARM\RTE\_test\RTE_Components.h
?????文件???????38843??2020-06-07?11:38??MDK-ARM\startup_stm32f103xb.lst
?????文件???????12484??2020-06-07?11:38??MDK-ARM\startup_stm32f103xb.s
?????文件???????94269??2020-06-07?11:46??MDK-ARM\test.uvguix.11728
?????文件???????15800??2020-06-07?11:45??MDK-ARM\test.uvoptx
?????文件???????19973??2020-06-07?11:38??MDK-ARM\test.uvprojx
?????目錄???????????0??2020-06-07?11:45??MDK-ARM\test\
?????文件????????3024??2020-06-07?11:45??MDK-ARM\test\main.d
?????文件???????17260??2020-06-07?11:45??MDK-ARM\test\main.o
?????文件??????????51??2020-06-07?11:38??MDK-ARM\test\startup_stm32f103xb.d
?????文件????????5800??2020-06-07?11:38??MDK-ARM\test\startup_stm32f103xb.o
?????文件????????3049??2020-06-07?11:38??MDK-ARM\test\stm32f1xx_hal.d
?????文件???????21776??2020-06-07?11:38??MDK-ARM\test\stm32f1xx_hal.o
?????文件????????3063??2020-06-07?11:38??MDK-ARM\test\stm32f1xx_hal_cortex.d
?????文件???????22300??2020-06-07?11:38??MDK-ARM\test\stm32f1xx_hal_cortex.o
?????文件????????3057??2020-06-07?11:38??MDK-ARM\test\stm32f1xx_hal_dma.d
?????文件???????19156??2020-06-07?11:38??MDK-ARM\test\stm32f1xx_hal_dma.o
?????文件????????3059??2020-06-07?11:38??MDK-ARM\test\stm32f1xx_hal_exti.d
?????文件???????12392??2020-06-07?11:38??MDK-ARM\test\stm32f1xx_hal_exti.o
?????文件????????3061??2020-06-07?11:38??MDK-ARM\test\stm32f1xx_hal_flash.d
............此處省略41個文件信息
評論
共有 條評論