Re: Help in accessing GPIOs in an i.MX21 (ADS21 board)
- From: "Mario" <alphatommy@xxxxxxxxxxx>
- Date: 20 Sep 2006 15:27:31 -0700
Hi Paul,
For the method INT8 DDKGetGpioSignalState(GPIOHANDLE gpiohandle,
GPIO_PORT port, UINT32 signal)
I did the following:
[DllImport ("mx21ddk.dll")] //mx21ddk.dll contains the methods that
I am calling
public static extern Int16 DDKGetGpioSignalState(IntPtr gpiohandle,
GPIO_PORT port, UInt32 signal);
The reason why I used Int16 is because there is no Int16 in C#.
//GPIO in C#
public enum
{
GPIO_PORT_A,
GPIO_PORT_B,
GPIO_PORT_C,
GPIO_PORT_D,
GPIO_PORT_E,
GPIO_PORT_F,
GPIOPORTMAX
}
Please let me know if you see any errors. Thanks.
mario
Paul G. Tobey [eMVP] wrote:
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
.
- Follow-Ups:
- Re: Help in accessing GPIOs in an i.MX21 (ADS21 board)
- From: Paul G. Tobey [eMVP]
- Re: Help in accessing GPIOs in an i.MX21 (ADS21 board)
- References:
- Help in accessing GPIOs in an i.MX21 (ADS21 board)
- From: Mario
- Re: Help in accessing GPIOs in an i.MX21 (ADS21 board)
- From: Paul G. Tobey [eMVP]
- Re: Help in accessing GPIOs in an i.MX21 (ADS21 board)
- From: Mario
- Re: Help in accessing GPIOs in an i.MX21 (ADS21 board)
- From: Paul G. Tobey [eMVP]
- Help in accessing GPIOs in an i.MX21 (ADS21 board)
- Prev by Date: Re: .Net CF 2.0 Installation Failure on Pocket LOOX 560
- Next by Date: Re: Help in accessing GPIOs in an i.MX21 (ADS21 board)
- Previous by thread: Re: Help in accessing GPIOs in an i.MX21 (ADS21 board)
- Next by thread: Re: Help in accessing GPIOs in an i.MX21 (ADS21 board)
- Index(es):
Relevant Pages
|