26 lines
473 B
C
26 lines
473 B
C
|
|
//#include <stdint.h>
|
||
|
|
#include "stm32g0xx_hal.h"
|
||
|
|
|
||
|
|
#define LED_PIN 4
|
||
|
|
|
||
|
|
int main(void)
|
||
|
|
{
|
||
|
|
HAL_Init();
|
||
|
|
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||
|
|
|
||
|
|
GPIO_InitTypeDef GPIO_InitStruct;
|
||
|
|
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||
|
|
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||
|
|
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
|
||
|
|
|
||
|
|
GPIO_InitStruct.Pin = GPIO_PIN_4;
|
||
|
|
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||
|
|
|
||
|
|
while(1)
|
||
|
|
{
|
||
|
|
HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_4);
|
||
|
|
HAL_Delay(100);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|