undefined reference to `GPIOSetDir' and undefined reference to `GPIOSetValue'

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

undefined reference to `GPIOSetDir' and undefined reference to `GPIOSetValue'

648件の閲覧回数
lpcware
NXP Employee
NXP Employee
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.
ラベル(1)
0 件の賞賛
3 返答(返信)

531件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_Paul on Mon Aug 26 06:38:49 MST 2013
Which example code are you using?
The GPIOSetValue() function is normally found in the gpio.c file, and also defined in gpio.h.  Make sure these files can be found in your project.  If you are using the example code from: http://www.lpcware.com/content/nxpfile/sample-code-bundle-lpc11xx-peripherals-using-nxp-lpcxpresso
then the gpio.c file can be found in the "LPC11xx-LPCXpresso-CMSIS-update\gpio\Common\src" directory.
0 件の賞賛

531件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wzq12138 on Sun Aug 25 23:43:26 MST 2013
thank you ,in fact ,I want to use the uart to control the led on p1-20.the main is that when i send a code like FF or anything onthers ,the led on p1-20 will be lighten,and then when i send a code from the computer by the uart,the led on p1-20 will not be lighten .my english is poor ,do you understand me ,can you write the code for me ,thank you very much.
0 件の賞賛

531件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Fri Aug 23 00:29:48 MST 2013
They are CMSIS calls. You need to link with a CMSIS library.
0 件の賞賛