-
Notifications
You must be signed in to change notification settings - Fork 0
STM32_L4R5_NUCLEO
minichao9901 edited this page Mar 24, 2024
·
4 revisions
LD1: PC7
LD2: PB7
LD3: PB14
Button: PC13
ST-LINK UART: lpuart1(PG7/PG8)
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_LPUART1_UART_Init();
MX_USART3_UART_Init();
MX_USB_OTG_FS_PCD_Init();
/* USER CODE BEGIN 2 */
char str[]="hello world!\r\n";
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
//HAL_StatusTypeDef HAL_UART_Transmit(UART_HandleTypeDef *huart, const uint8_t *pData, uint16_t Size, uint32_t Timeout)
HAL_UART_Transmit(&hlpuart1,
str,
strlen(str),
1000
);
HAL_UART_Transmit(&huart3,
str,
strlen(str),
1000
);
//void HAL_GPIO_TogglePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
HAL_GPIO_TogglePin(GPIOB, LD2_Pin|LD3_Pin);
HAL_GPIO_TogglePin(GPIOC,LD1_Pin);
HAL_Delay(1000);
}
/* USER CODE END 3 */
}