1 问题
在利用USART 结构体进行初始化操作时,
根据函数库提供的例子进行初始化时候
compiling main.c...
../User/main.c(73): error: #134: expected a field name
../User/main.c(78): error: #136: struct "<unnamed>" has no field "USART_Clock"
../User/main.c(79): error: #136: struct "<unnamed>" has no field "USART_CPOL"
../User/main.c(80): error: #136: struct "<unnamed>" has no field "USART_CPHA"
../User/main.c(81): error: #136: struct "<unnamed>" has no field "USART_LastBit"
../User/main.c - 5 Error(s), 0 Warning(s).
通过查看相关头文件 时候 发现
typedef struct
{
uint32_t USART_BaudRate;
uint16_t USART_WordLength;
uint16_t USART_StopBits;
uint16_t USART_Parity;
uint16_t USART_Mode;
uint16_t USART_HardwareFlowControl;
} USART_InitTypeDef;
typedef struct
{
uint16_t US