Content originally posted in LPCWare by wzq12138 on Thu Aug 22 20:50:29 MST 2013
My LPCxpresso board is lpc11c24,and I want to try the uart,and my code is
#include "LPC11xx.h"
#include "driver_config.h"
#include "target_config.h"
#include "gpio.h"
#include "uart.h"
#define TX_EN GPIOSetValue(0,19,0);
extern volatile uint32_t UARTCount;/
extern volatile uint8_t UARTBuffer[BUFSIZE];
uint8_t aa[10]="2010.5.9AM"; /
uint8_t bb[1];
int UARTRec()
{
uint8_t BufferPtr;
while((LPC_UART->LSR & 0x01) == 0);
BufferPtr = LPC_UART->RBR;
return BufferPtr;
}
int main (void)
{
UARTInit(115200);
UARTCount=1; //
bb[0]=0x00; /
GPIOSetDir(0,19,1 ); //error: undefined reference to `GPIOSetDir'
TX_EN; //error: undefined reference to `GPIOSetValue'
UARTSend((uint8_t *) aa,10); /
while (1)
{
if ( UARTCount != 0 ) /
{
LPC_UART->IER = IER_THRE | IER_RLS;
bb[0]=UARTRec(); //
UARTSend((uint8_t *) bb,1);
LPC_UART->IER = IER_THRE | IER_RLS | IER_RBR;
}
}
}
and the error is above ,can you help me.