From: "Morris, Richard" <Richard.Morris@lifetech.com>
To: EnneGi <enricogiordano1992@gmail.com>
Cc: "ecos-discuss@ecos.sourceware.org" <ecos-discuss@ecos.sourceware.org>
Subject: Re: [ECOS] Re: How to create a GPIO driver
Date: Thu, 14 Mar 2013 21:10:00 -0000 [thread overview]
Message-ID: <174B0313-B7C1-4E9A-A55A-B02EA0759900@lifetech.com> (raw)
In-Reply-To: <1363291147348-225465.post@n7.nabble.com>
You will need to adapt the macro to the needs of the LPC17XX. It will have different configuration that the STM32.
To do this you will need to read the GPIO section of the LPC17XX user manual and adapt the code from the STM32 to the LPC17XX.
--Richard
On Mar 14, 2013, at 12:59 PM, EnneGi <enricogiordano1992@gmail.com> wrote:
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!
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
next prev parent reply other threads:[~2013-03-14 21:10 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-10 18:19 [ECOS] " EnneGi
2013-03-10 18:59 ` Andrew Lunn
2013-03-10 19:23 ` Ilija Kocho
2013-03-10 22:57 ` [ECOS] " EnneGi
2013-03-11 14:24 ` Morris, Richard
2013-03-11 16:52 ` EnneGi
2013-03-12 14:49 ` [ECOS] " Morris, Richard
2013-03-12 22:17 ` [ECOS] " EnneGi
2013-03-13 15:36 ` Morris, Richard
2013-03-14 14:41 ` EnneGi
2013-03-14 15:05 ` Michael Jones
2013-03-14 15:24 ` EnneGi
2013-03-14 15:26 ` EnneGi
2013-03-14 15:32 ` Michael Jones
2013-03-14 15:35 ` EnneGi
2013-03-14 15:43 ` [ECOS] " Michael Jones
2013-03-14 15:53 ` [ECOS] " EnneGi
2013-03-14 15:58 ` Michael Jones
2013-03-14 16:09 ` [ECOS] " Morris, Richard
2013-03-14 17:08 ` [ECOS] " EnneGi
2013-03-14 18:17 ` [ECOS] " Morris, Richard
2013-03-14 18:27 ` [ECOS] " EnneGi
2013-03-14 19:59 ` EnneGi
2013-03-14 21:10 ` Morris, Richard [this message]
2013-03-15 19:09 ` EnneGi
2013-03-15 22:14 ` EnneGi
2013-03-14 15:06 ` EnneGi
2013-03-14 15:21 ` Michael Jones
2013-03-12 22:36 ` EnneGi
2013-03-11 14:11 ` [ECOS] " Morris, Richard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=174B0313-B7C1-4E9A-A55A-B02EA0759900@lifetech.com \
--to=richard.morris@lifetech.com \
--cc=ecos-discuss@ecos.sourceware.org \
--cc=enricogiordano1992@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).