DSPRelated.com
Forums

help in GPIO

Started by aliaa June 24, 2008
i am new in DSP i am using c5510 i need to use GPIO but i couldn't
found any example so i tried my code but the compiler couldn't
recognize the function names or definitions and i have the following
errors:
, line 51: error: identifier "GPIO_Handle" is undefined
, line 52: error: identifier "hGPio" is undefined
, line 52: error: identifier "GPIO_PGPIO_PIN1" is undefined
, line 53: error: declaration may not appear after executable
statement in block
, line 53: error: identifier "GPIO_Config" is undefined
, line 53: error: identifier "GPIO_PGPIO_PIN1_OUTPUT" is undefined
, line 54: error: expected a ";"
, line 55: error: too many arguments in function call

this my code can any one tell me what to do.
#include
#include
#include
#include <_csl_pgpio.h>
#include <_csl_pgpiodat.h>
#include <_csl_pgpiohal.h>
#include
void main()
{
GPIO_Handle hGPIO;
hGPio = GPIO_open(GPIO_PGPIO_PIN1,0);
GPIO_Config myConfig = {GPIO_PGPIO_PIN1_OUTPUT}
GPIO_config(hGPIO, &myConfig);
GPIO_pinEnable ( hGPIO, GPIO_PGPIO_PIN1);

}
thanks
On Tue, Jun 24, 2008 at 09:25:09AM -0000, aliaa wrote:
> i am new in DSP i am using c5510 i need to use GPIO but i couldn't
> found any example so i tried my code but the compiler couldn't
> recognize the function names or definitions and i have the following
> errors:
> , line 51: error: identifier "GPIO_Handle" is undefined
> , line 52: error: identifier "hGPio" is undefined
> , line 52: error: identifier "GPIO_PGPIO_PIN1" is undefined
> , line 53: error: declaration may not appear after executable
> statement in block
> , line 53: error: identifier "GPIO_Config" is undefined
> , line 53: error: identifier "GPIO_PGPIO_PIN1_OUTPUT" is undefined
> , line 54: error: expected a ";"
> , line 55: error: too many arguments in function call
>
> this my code can any one tell me what to do.
>
> **snip**

As far as I can tell, GPIO_Handle, GPIO_Config etc. are only used on the
5502, not on the 5510. With the 5510 you can just enable the pins, set the
direction of each and write/read from them. If I'm wrong, I'd appreciate a
pointer from someone. I'd also appreciate any info anyone could give me
about using a timer to recover from any errors on a GPIO comms bus I'm
working with.

Cheers

Chris
--
Chris Eilbeck
Chris-

> On Tue, Jun 24, 2008 at 09:25:09AM -0000, aliaa wrote:
> > i am new in DSP i am using c5510 i need to use GPIO but i couldn't
> > found any example so i tried my code but the compiler couldn't
> > recognize the function names or definitions and i have the following
> > errors:
> > , line 51: error: identifier "GPIO_Handle" is undefined
> > , line 52: error: identifier "hGPio" is undefined
> > , line 52: error: identifier "GPIO_PGPIO_PIN1" is undefined
> > , line 53: error: declaration may not appear after executable
> > statement in block
> > , line 53: error: identifier "GPIO_Config" is undefined
> > , line 53: error: identifier "GPIO_PGPIO_PIN1_OUTPUT" is undefined
> > , line 54: error: expected a ";"
> > , line 55: error: too many arguments in function call
> >
> > this my code can any one tell me what to do.
> >
> > **snip**
>
> As far as I can tell, GPIO_Handle, GPIO_Config etc. are only used on the
> 5502, not on the 5510. With the 5510 you can just enable the pins, set the
> direction of each and write/read from them. If I'm wrong, I'd appreciate a
> pointer from someone. I'd also appreciate any info anyone could give me
> about using a timer to recover from any errors on a GPIO comms bus I'm
> working with.

I only have 5502 CSL-based project examples handy, but I would have to say it doesn't
make sense why 5510 CSL would not also support GPIO functions. The GPIO
functionality on the two devices is the same, although of course the pin mapping is
different. GPIO is nothing and complex has been around for many years.

What library files are you including? Can you use other CSL functions? Is your
project using DSP/BIOS?

-Jeff
--- In c..., Jeff Brower wrote:
>
> Chris-
>
> > On Tue, Jun 24, 2008 at 09:25:09AM -0000, aliaa wrote:
> > > i am new in DSP i am using c5510 i need to use GPIO but i couldn't
> > > found any example so i tried my code but the compiler couldn't
> > > recognize the function names or definitions and i have the following
> > > errors:
> > > , line 51: error: identifier "GPIO_Handle" is undefined
> > > , line 52: error: identifier "hGPio" is undefined
> > > , line 52: error: identifier "GPIO_PGPIO_PIN1" is undefined
> > > , line 53: error: declaration may not appear after executable
> > > statement in block
> > > , line 53: error: identifier "GPIO_Config" is undefined
> > > , line 53: error: identifier "GPIO_PGPIO_PIN1_OUTPUT" is undefined
> > > , line 54: error: expected a ";"
> > > , line 55: error: too many arguments in function call
> > >
> > > this my code can any one tell me what to do.
> > >
> > > **snip**
> >
> > As far as I can tell, GPIO_Handle, GPIO_Config etc. are only used
on the
> > 5502, not on the 5510. With the 5510 you can just enable the
pins, set the
> > direction of each and write/read from them. If I'm wrong, I'd
appreciate a
> > pointer from someone. I'd also appreciate any info anyone could
give me
> > about using a timer to recover from any errors on a GPIO comms bus I'm
> > working with.
>
> I only have 5502 CSL-based project examples handy, but I would have
to say it doesn't
> make sense why 5510 CSL would not also support GPIO functions. The GPIO
> functionality on the two devices is the same, although of course the
pin mapping is
> different. GPIO is nothing and complex has been around for many years.
>
> What library files are you including? Can you use other CSL
functions? Is your
> project using DSP/BIOS?
>
> -Jeff
>

I include this files
#include
#include
#include
#include <_csl_pgpio.h>
#include <_csl_pgpiodat.h>
#include <_csl_pgpiohal.h>
#include
and GPIO_pinEnable function colored blue in the code.
and i used those function to enable me to out 4 digits to control
motors by H-bridge can any one know how to do that with GPIO or any
thing else.
Ali-

> I include this files
> #include
> #include
> #include
> #include <_csl_pgpio.h>
> #include <_csl_pgpiodat.h>
> #include <_csl_pgpiohal.h>
> #include
> and GPIO_pinEnable function colored blue in the code.
> and i used those function to enable me to out 4 digits to control
> motors by H-bridge can any one know how to do that with GPIO or any
> thing else.

It sounds like you already have it working with GPIO. What is the question?

-Jeff
I think what Jeff meant by "what libraries are you including" is not only
your #include statements, but also what you are telling the compiler and the
linker. For them to be able to _find_ the libraries you want to #include,
you have to tell them where they are, i.e. a path or similar direction.

If I recall correctly, you can set the csl lib from the .cdb (?) file, under
Global Settings or something. There will be a field there for which csl
library you want to use, and you simply write the name of it there.

You also have to give library and include paths to the compiler and linker.
Read the compiler and linker instructions to find out which flags you have
to use. E.g. -i is the flag for include-paths.

Without correct directions your program can't be linked properly and the
calls you are trying to make won't work.

HTH.
-Sima

On Sat, Jun 28, 2008 at 9:46 PM, aliaa wrote:

> --- In c... , Jeff Brower
> wrote:
> >
> > Chris-
> >
> > > On Tue, Jun 24, 2008 at 09:25:09AM -0000, aliaa wrote:
> > > > i am new in DSP i am using c5510 i need to use GPIO but i couldn't
> > > > found any example so i tried my code but the compiler couldn't
> > > > recognize the function names or definitions and i have the following
> > > > errors:
> > > > , line 51: error: identifier "GPIO_Handle" is undefined
> > > > , line 52: error: identifier "hGPio" is undefined
> > > > , line 52: error: identifier "GPIO_PGPIO_PIN1" is undefined
> > > > , line 53: error: declaration may not appear after executable
> > > > statement in block
> > > > , line 53: error: identifier "GPIO_Config" is undefined
> > > > , line 53: error: identifier "GPIO_PGPIO_PIN1_OUTPUT" is undefined
> > > > , line 54: error: expected a ";"
> > > > , line 55: error: too many arguments in function call
> > > >
> > > > this my code can any one tell me what to do.
> > > >
> > > > **snip**
> > >
> > > As far as I can tell, GPIO_Handle, GPIO_Config etc. are only used
> on the
> > > 5502, not on the 5510. With the 5510 you can just enable the
> pins, set the
> > > direction of each and write/read from them. If I'm wrong, I'd
> appreciate a
> > > pointer from someone. I'd also appreciate any info anyone could
> give me
> > > about using a timer to recover from any errors on a GPIO comms bus I'm
> > > working with.
> >
> > I only have 5502 CSL-based project examples handy, but I would have
> to say it doesn't
> > make sense why 5510 CSL would not also support GPIO functions. The GPIO
> > functionality on the two devices is the same, although of course the
> pin mapping is
> > different. GPIO is nothing and complex has been around for many years.
> >
> > What library files are you including? Can you use other CSL
> functions? Is your
> > project using DSP/BIOS?
> >
> > -Jeff
> > I include this files
> #include
> #include
> #include
> #include <_csl_pgpio.h>
> #include <_csl_pgpiodat.h>
> #include <_csl_pgpiohal.h>
> #include and GPIO_pinEnable function colored blue in the code.
> and i used those function to enable me to out 4 digits to control
> motors by H-bridge can any one know how to do that with GPIO or any
> thing else.
>
>
>
--- In c..., "Jeff Brower" wrote:
>
> Ali-
>
> > I include this files
> > #include
> > #include
> > #include
> > #include <_csl_pgpio.h>
> > #include <_csl_pgpiodat.h>
> > #include <_csl_pgpiohal.h>
> > #include
> >
> >
> > and GPIO_pinEnable function colored blue in the code.
> > and i used those function to enable me to out 4 digits to control
> > motors by H-bridge can any one know how to do that with GPIO or any
> > thing else.
>
> It sounds like you already have it working with GPIO. What is the
question?
>
> -Jeff
>
no this errors appear when i tried to write simple code to test gpio

line 51: error: identifier "GPIO_Handle" is undefined
> > , line 52: error: identifier "hGPio" is undefined
> > , line 52: error: identifier "GPIO_PGPIO_PIN1" is undefined