金牌会员
 
- 积分
- 1163
- 金钱
- 1163
- 注册时间
- 2019-10-22
- 在线时间
- 226 小时
|
5金钱
USART_TypeDef结构体中也没有USART1啊,这个指针变量是咋传递的啊,对这种指针变量做入口参数的一直不太明白
USART_SendData(USART1, USART_RX_BUF[t]);//向串口1发送数据 void USART_SendData(USART_TypeDef* USARTx, uint16_t Data)
{
/* Check the parameters */
assert_param(IS_USART_ALL_PERIPH(USARTx));
assert_param(IS_USART_DATA(Data));
/* Transmit Data */
USARTx->DR = (Data & (uint16_t)0x01FF);
}
typedef struct
{
__IO uint16_t SR;
uint16_t RESERVED0;
__IO uint16_t DR;
uint16_t RESERVED1;
__IO uint16_t BRR;
uint16_t RESERVED2;
__IO uint16_t CR1;
uint16_t RESERVED3;
__IO uint16_t CR2;
uint16_t RESERVED4;
__IO uint16_t CR3;
uint16_t RESERVED5;
__IO uint16_t GTPR;
uint16_t RESERVED6;
} USART_TypeDef;
#define USART1 ((USART_TypeDef *) USART1_BASE)
|
|