Page 1 of 1

AT91SAM9261 and GPIO under WinCE 6.0 / C#

Posted: Tue Sep 21, 2010 7:50 am
by FmcBm

since WinCE 6.0 there is no longer the possibility to create direct pointer to the GPIO register. So I need a suitable driver to set/read the IO pins of my AT91SAM9261 controller, right? I have searched for such drivers on my WinCe (evaluation) installation but I can't find them. I found drivers for USB, UART, SPI, Network... but what driver for this problem I have to use? Btw. I create the software with C# and the .NET Compact Framework.

Best Regards


Re: AT91SAM9261 and GPIO under WinCE 6.0 / C#

Posted: Tue Sep 21, 2010 9:01 am
by bjoern.feld

though I am not familiar with the AT91SAM9261 CPU I assume that it does have a similar BSP structure as the AT91SAM9263-EK BSP that we are using.

The BSP offers a GPIO driver based on the Stream Driver Interface.

You have to add the GPIO driver from the BSP items catalog to your OS Design and rebuild the image.

Once the image is up and running on your board you can use standard file IO functions, i.e. CreateFile, DeviceIoControl and CloseHandle to control the driver.

These functions can easily be PInvoked from the .NET platform.
You might want to check out OpenNetCF. They offer a managed Stream Driver Interface class that wrapps all functions needed to communicate with a Stream Interface Driver.

For reference on the DeviceIoControl codes and the structures used as parameters refer to the GPIO drivers source Code.

After installing the BSP the main code should be located under