当看到这个活动,很激动,并积极参加了,也期待到手之后学习学习,到了NUCLEO-G431RB评估板之后,就网上找找芯片资料.果然STM32资料丰富,以前玩8位-16位单片机比较多,这次捣鼓了一段时间,也问了下学长们。板子引出了很多接口,可以用杜邦线拓展很多测试模块,整体布局非常合理美观,看着舒服,板子标识很详细,看着图纸基本能找到相对应的参数,跳帽接口也很灵活,这个板还有很多要学习,继续加油吧。 /* Reset of all
peripherals, Initializes the Flashinterface and the Systick. */ HAL_Init(); /* Configure thesystem clock */ SystemClock_Config(); /* Initialize allconfigured peripherals */ /* USER CODEBEGIN 2 */ /* -1- InitializeLEDs mounted on NUCLEO-G431RB RevC board */ BSP_LED_Init(LED2); /* -2- ConfigureExternal line 13 (connected to PC.13 pin) in interrupt mode */ EXTI15_10_IRQHandler_Config(); /* Infinite loop*/ /* USER CODEBEGIN WHILE */ while (1) { } static void EXTI15_10_IRQHandler_Config(void) { GPIO_InitTypeDef GPIO_InitStructure; /* Enable GPIOCclock */ __HAL_RCC_GPIOC_CLK_ENABLE(); /* ConfigurePC.13 pin as input floating */ GPIO_InitStructure.Mode = GPIO_MODE_IT_FALLING; GPIO_InitStructure.Pull = GPIO_NOPULL; GPIO_InitStructure.Pin = USER_BUTTON_PIN; HAL_GPIO_Init(GPIOC, &GPIO_InitStructure); /* Enable and setlines 10 to 15 Interrupt to the lowest priority */ HAL_NVIC_SetPriority(EXTI15_10_IRQn, 2, 0); HAL_NVIC_EnableIRQ(EXTI15_10_IRQn); } voidHAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) { if (GPIO_Pin == USER_BUTTON_PIN) { /* Toggle LED2 */ BSP_LED_Toggle(LED2); }
|