一、电路设计
ACM32F403开发板
实现结果:通过串口发送每秒的时间
二、运行结果
三、部分代码
#include "APP.h"UART_HandleTypeDef Uart_Handle;/*********************************************************************************
* Function : Uart_Init
* Description : Uart Initialization
**********************************************************************************/
void Uart_Init(uint32_t fu32_Baudrate)
{Uart_Handle.Instance = UART1;Uart_Handle.Init.BaudRate = fu32_Baudrate;Uart_Handle.Init.WordLength = UART_WORDLENGTH_8B;Uart_Handle.Init.StopBits = UART_STOPBITS_1;Uart_Handle.Init.Parity = UART_PARITY_NONE;Uart_Handle.Init.Mode = UART_MODE_TX_RX_DEBUG;Uart_Handle.Init.HwFlowCtl = UART_HWCONTROL_NONE;HAL_UART_Init(&Uart_Handle);printf("MCU is running, HCLK=%dHz, PCLK=%dHz\n", System_Get_SystemClock(), System_Get_APBClock());
}/*********************************************************************************
* Function : main
* Description : The application entry point.
* Input : None
* Output : None
**********************************************************************************/
int main(void)
{System_Init();Uart_Init(115200);/* Function:RTC_TIME_DATE_SET_GET、RTC_ALARM、RTC_TAMPER、RTC_STANDBY_RTC_WAKEUP、*/APP_RTC_Test(RTC_TIME_DATE_SET_GET); while(1){}
}