#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <stm32l0xx_hal.h>
#define LED_PORT GPIOB
#define LED_PIN GPIO_PIN_3
#define LED_PORT_CLK_ENABLE __HAL_RCC_GPIOB_CLK_ENABLE
#define VCP_TX_Pin GPIO_PIN_2
#define VCP_RX_Pin GPIO_PIN_15
UART_HandleTypeDef huart2;
void SystemClock_conf(void);
static void MX_USART2_UART_Init(void);
void osSystickHandler(void){
if ((HAL_GetTick() % 500) == 0){
HAL_GPIO_TogglePin(LED_PORT, LED_PIN);
}
}
void initGPIO(){
GPIO_InitTypeDef GPIO_Config;
GPIO_Config.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_Config.Pull = GPIO_NOPULL;
GPIO_Config.Speed = GPIO_SPEED_FREQ_HIGH;
GPIO_Config.Pin = LED_PIN;
LED_PORT_CLK_ENABLE();
HAL_GPI_Init(LED_PORT, &GPIO_Config);
__HAL_RCC_GPIOB_CLK_ENABLE();
}
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, STM32!");
}
void loop() {
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
}
Loading
st-nucleo-l031k6
st-nucleo-l031k6