这是我的程序:
#include"stdio.h"
#include<stdint.h>
#include<stdbool.h>
#include "inc/tm4c1233e6pm.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/pwm.h"
#include "driverlib/gpio.h"
#include "driverlib/sysctl.h"
#include "driverlib/pin_map.h"
#include "driverlib/uart.h"
#include "driverlib/interrupt.h"
#include "inc/hw_gpio.h"
#include "inc/hw_ints.h"
//********************UART_GPIO初始化************************
void UART0_init(void)
{
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); //复用功能时钟
GPIOPinTypeUART(GPIO_PORTA_BASE,GPIO_PIN_0|GPIO_PIN_1); //配置PAO、PA1为UART1 的 RXD0,TXD0,他怎么知道哪个是rx哪个是tx呢??
GPIOPinConfigure(GPIO_PA0_U0RX);
GPIOPinConfigure(GPIO_PA1_U0TX);
//配置PA0 PA1为串口引脚
UARTConfigSetExpClk(UART0_BASE,SysCtlClockGet(), 9600,
(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
UART_CONFIG_PAR_NONE));
IntMasterEnable(); //全局中断使能
IntEnable(INT_UART0); //使能串口0中断
UARTIntEnable(UART0_BASE, UART_INT_RX | UART_INT_RT); //使能串口0接收中断和接收超时中断
UARTEnable(UART0_BASE); //使能串口1(UARTO)发送和接收
}
//*****************UART中断处理*****************************
void UART0_Handler(void)
{
uint32_t ITStatus;
ITStatus = UARTIntStatus(UART0_BASE, true); //中断标志位
UARTIntClear(UART0_BASE, ITStatus); //清除中断标志
while(UARTCharsAvail(UART0_BASE)) //确认接收 FIFO 中是否有数据
{
UARTCharPutNonBlocking(UART0_BASE,UARTCharGetNonBlocking(UART0_BASE));
}
}
//*****************主函数调用*****************************
void main ()
{
UART0_init();
while(1);
}
其中这两个变量没有定义:GPIOPinConfigure(GPIO_PA0_U0RX);
GPIOPinConfigure(GPIO_PA1_U0TX);
错误提示:#20 identifier "GPIO_PA0_U0RX" is undefined
#20 identifier "GPIO_PA0_U0TX" is undefined