This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to create a GPIO driver


I use this test main:

#include <cyg/infra/diag.h>
#include <cyg/hal/var_io.h>

int main (void)
{

  diag_printf("setting gpio\n");

  cyg_uint32 v_led_ok = CYGHWR_HAL_LPC17XX_PIN_OUT(B,  14, OPENDRAIN, NONE, 
2MHZ); 

    // Turn the LED on 
  CYGHWR_HAL_LPC17XX_GPIO_OUT(v_led_ok, 1); 

    // Turn the LED off 
  CYGHWR_HAL_LPC17XX_GPIO_OUT(v_led_ok, 0);  

  diag_printf("DONE\n");

  while(1)
    {;}

  return 0;

  }


and, when I compile, the compiler give me this error:


gpio.c:9: warning: implicit declaration of function
âCYGHWR_HAL_LPC17XX_GPIOâ
gpio.c:9: error: âBâ undeclared (first use in this function)
gpio.c:9: error: (Each undeclared identifier is reported only once
gpio.c:9: error: for each function it appears in.)
gpio.c:9: error: âOUT_2MHZâ undeclared (first use in this function)
gpio.c:9: error: âOUT_OPENDRAINâ undeclared (first use in this function)
make: *** [gpio.o] Error 1


what should I change?

Thanks a lot!



--
View this message in context: http://sourceware-org.1504.n7.nabble.com/How-to-create-a-GPIO-driver-tp224910p225465.html
Sent from the Sourceware - ecos-discuss mailing list archive at Nabble.com.

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]