I have Ixora Board V1.3A with me connected with Apalis IMX6D 1GB V1.1C module with WinCE7.
I want to make the GPIOs of the Ixora Board work for my application, for which I am trying to test with LED4_RED on Ixora board connected to Pin no.178.
I am using vs2008 and TdxAllLibrariesDll.dll file for CE600(ARMv4l) for making it work using DLLImport.
But somehow, I am not able to achieve the same.
Following is the code snippet for the same.
Can somebody please guide on the same, why is it not working
namespace ASA_DemoToradex
{
public partial class Form1 : CcForm
{
public static class IoHelper
{
public static uIo APALIS_PIN(ushort number)
{
return new uIo
{
Number = number,
Type = tIoType.ioApalisPin
};
}
}
[DllImport("TdxAllLibrariesDll.dll",CharSet = CharSet.Auto)] ///< Importing DLL
public static extern IntPtr Imx6Gpio_Init(string registryPath); ///< External function declaration
[DllImport("TdxAllLibrariesDll.dll", CharSet = CharSet.Auto)]
public static extern void Imx6Gpio_SetDir(IntPtr hGpio, uIo io, tIoDirection dir);
[DllImport("TdxAllLibrariesDll.dll", CharSet = CharSet.Auto)]
public static extern void Imx6Gpio_SetLevel(IntPtr hGpio, uIo io, tIoLevel val);
[DllImport("TdxAllLibrariesDll.dll", CharSet = CharSet.Auto)]
public static extern void Imx6Gpio_ConfigureAsGpio(IntPtr hGpio, uIo io);
[DllImport("TdxAllLibrariesDll.dll")]
public static extern bool Imx6Gpio_Open(IntPtr hGpio);
IntPtr hGpio = Gpio_Init(null);
// For Ixora Board Test LEDs
uIo LED4_RED = IoHelper.APALIS_PIN(178);
Imx6Gpio_Open(hGpio);
System.Threading.Thread.Sleep(1000);
Imx6Gpio_ConfigureAsGpio(hGpio, LED4_RED);
Imx6Gpio_SetDir(hGpio, LED4_RED, tIoDirection.ioOutput);
System.Threading.Thread.Sleep(1000);
Imx6Gpio_SetLevel(hGpio, LED4_RED, tIoLevel.ioHigh);
System.Threading.Thread.Sleep(1000);
Imx6Gpio_SetLevel(hGpio, LED4_RED, tIoLevel.ioLow);
}
}