GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;GPIO_InitPeripheral(USARTx_GPIO, &GPIO_InitStructure);// RX引脚GPIO_InitStructure.Pin = USARTx_RxPin; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;GPIO_InitPeripheral(USARTx_GPIO, &GPIO_InitStructure);// 复用GPIO_ConfigPinRemap(USARTx_RMP,...
因为引脚默认是JTAG功能,现在需要配置为其他功能,这里需要使能复用时钟 */RCC_EnableAPB2PeriphClk(RCC_APB2_PERIPH_AFIO, ENABLE);/* Disable the Serial Wire Jtag Debug Port*/GPIO_ConfigPinRemap(GPIO_RMP_SW_JTAG_NO_NJTRST, ENABLE);while(1)
GPIO_Structure_Initialize( &myGPIOA_RXTX );myGPIOA_RXTX.Pin = UART1_RX_Pin;myGPIOA_RXTX....
");/* System Clocks Configuration */RCC_Configuration();/* Configure the GPIO ports */GPIO_Configuration();ADC_EnableBypassFilter(ADC, ENABLE);while(1){ADC_ConfigChannel(ADC, ADC_CTRL_CH_3);ADC_Enable(ADC, ENABLE);while(ADC_GetFlagStatus(ADC,ADC_FLAG_DONE) == RESET);ADC_ClearFlag(ADC...
18 // GPIO_PinRemapConfig(GPIO_FullRemap_TIM3 ,ENABLE); 19 20 TIM_TimeBaseStructure.TIM_Period = arr; //设置在下一个更新事件装入活动的自动重装载存放器周期的值 计数到5000为500ms 21 TIM_TimeBaseStructure.TIM_Prescaler = psc; //设置用来作为TIM*时钟频率除数的预分频值10Khz的计数频率 22 TIM...
GPIO port configuration lock register (GPIOx_ PLOCK)...86 5.3.10 GPIO alternate function low register (GPIOx_AFL)...87 5.3.11 GPIO alternate function high register (GPIOx_AFH) ...
.pin_mask = (1 << ((p_pin) & 0x0f)), \ .gpio = GPIO##p_port, \ .af = p_af, \ .adc_num = p_adc_num, \ .adc_channel = p_adc_channel, \ }1 change: 1 addition & 0 deletions 1 ports/wch/bsp/ch32v30x.ld Show comments View file Edit file Delete file ...
30/ 定时中断,最小单位钟频率=72MHz/36KHz=2KHz31TIM3_Int_Init(9999,35999) ;3233GPIO_Config(); /LED,PWM 端口初始化 ,配置 PC13,PA2,PA334TIM2_PWM_Init(47999,2 ); /分频。最小单位钟频率 =/(2+1)=24Mhz35while(1)381 #include 23 / 通用定时器3 中断初始化4 / 这 9、里时钟选择为...
30 /定时中断,最小单位钟频率=72mhz/36khz=2khz31 tim3_int_init(9999,35999) ;3233 gpio_config(); /led,pwm端口初始化,配置pc13,pa2,pa334 tim2_pwm_init(47999,2 ); /分频。最小单位钟频率=72000000/(2+1)=24mhz3536 while(1)37 3839 40 1 #include timer.h23 /通用定时器3中断初始化4 ...
GPIO_ConfigPinRemap(GPIO_RMP_SW_JTAG_SW_ENABLE, ENABLE); rt_pin_mode(LED1_PIN, PIN_MODE_OUTPUT); rt_pin_mode(LED2_PIN, PIN_MODE_OUTPUT);//init MQrt_thread_mdelay(1000);ret= rt_mq_init(&mq,"MsgQ", &msg_pool[0], 1, sizeof(msg_pool), RT_IPC_FLAG_PRIO);if(ret!= RT_EOK...