Re: Help in accessing GPIOs in an i.MX21 (ADS21 board)



Those don't appear to be standard DDK calls to me, but I'm no expert on any
i.MX21 BSPs. How have you P/Invoked them? GPIOHANDLE is probably an
IntPtr, GPIO_PORT you can probably create an enum for that corresponds
directly to what the C/C++ code uses, UINT32 is pretty obvious, 'uint', etc.
What value, integer value, are you passing in the GPIO_PORT parameters?

Paul T.

"Mario" <alphatommy@xxxxxxxxxxx> wrote in message
news:1158785258.148715.111740@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi Paul,

I have tried the following methods (their signatures are as follow):

1. INT8 DDKGetGpioSignalState(GPIOHANDLE gpiohandle, GPIO_PORT port,
UINT32 signal)
2. void DDKSetGpioSignalState(GPIOHANDLE gpiohandle, GPIO_PORT port,
UINT32 signal, UINT8 state, BOOL bInPowerMode)

3. UINT32 DDKGetGpioSignals(GPIOHANDLE gpiohandle, GPIO_PORT port,
UINT32 signalMask)

4. void DDKSetGpioSignals(GPIOHANDLE gpiohandle, GPIO_PORT port,
UINT32 signalMask, UINT32 stateMask)

GPIO_PORT is defined in the driver header as:

typedef enum {
GPIO_PORT_A,
GPIO_PORT_B,
GPIO_PORT_C,
GPIO_PORT_D,
GPIO_PORT_E,
GPIO_PORT_F,
GPIO_PORT_MAX,
} GPIO_PORT;

Thanks in advance for any input.

-- mario


Paul G. Tobey [eMVP] wrote:
What GPIO method calls?

Paul T.

"Mario" <alphatommy@xxxxxxxxxxx> wrote in message
news:1158076582.805617.137440@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,

Has anyone had any success in accessing (reading and writing) the GPIOs
in a Freescale i.MX21 (ADS21 board) from a managed code application?
The problem that I have is that regardless of which port parameter I
pass in the GPIO method calls, the GPIO driver always take Port_A as
default. The rest of the parameters are passed correctly. Any inputs
or suggestions on how to fix this is appreciated. Thanks.

I am not sure if this is the correct forum, but I did not get any
response after posting the same question in the freescale site for
almost two weeks.


-- mario




.



Relevant Pages

  • Re: Help in accessing GPIOs in an i.MX21 (ADS21 board)
    ... how is GPIOHANDLE declared by the unmanaged code? ... Paul G. Tobey wrote: ... I sent as Port I still see that the value ... UINT32 signalMask, UINT32 stateMask) ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Help in accessing GPIOs in an i.MX21 (ADS21 board)
    ... I sent as Port I still see that the value ... Paul G. Tobey wrote: ... For the method INT8 DDKGetGpioSignalState(GPIOHANDLE gpiohandle, ... UINT32 signalMask, UINT32 stateMask) ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Help in accessing GPIOs in an i.MX21 (ADS21 board)
    ... Paul G. Tobey wrote: ... For the method INT8 DDKGetGpioSignalState(GPIOHANDLE gpiohandle, ... GPIO_PORT port, UINT32 signal) ... UINT32 signalMask, UINT32 stateMask) ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Help in accessing GPIOs in an i.MX21 (ADS21 board)
    ... For the method INT8 DDKGetGpioSignalState(GPIOHANDLE gpiohandle, ... GPIO_PORT port, UINT32 signal) ... Paul G. Tobey wrote: ... UINT32 signalMask, UINT32 stateMask) ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Help in accessing GPIOs in an i.MX21 (ADS21 board)
    ... GPIOHANDLE is declared in the unmanaged code as typedef ... Paul G. Tobey wrote: ... I sent as Port I still see that the value ... UINT32 signalMask, UINT32 stateMask) ...
    (microsoft.public.dotnet.framework.compactframework)