Quote:
Customer Question:
Can I access the GPIOs (J38) using a simple application for the LoCE image or do I need your BSP for that ?
Do you have a sample application (with source code)that access the GPIOs ?
To use GPIO signals on any platform with our LoCE BSP or NK.bins (Images), you can simply create an application using a tool such as Embedded Visual C++. You can then download over ActiveSync or simply put the application on a CF card.
The application needs to correctly map a physical address space for the memory mapped areas needed. Also, be sure to correctly initialize the GPIO pins (don't make any assumptions). Follow the guidelines in the specific processor's User Guide for the GPIO.
typical steps:
0) Do your homework, make sure another peripheral isn't using the signal. Trace the signal back to the processor pin on the SOM schematic, if available or the HW Spec. Make sure you know how you need to initialize the GPIO signal using the processor's User Manual.
1) Map the physical HW registers to virtual addresses [MmMapIoSpace]
2) Initialize the proper HW registers to set up the GPIO pin using the new virtual addresses. (Specific to each processor)
3) Read/Write from the GPIO signal using the virtual addresses for the GPIO data registers. (Specific to each processor)
We have a sample application (very simple) that shows how to set up the virtual memory area you want to access. We also have posted a sample driver that may be useful.
(WinCE Sample Hardware Access Application)
http://www.logicpd.com/downloads/637/
(WinCE Sample Foo Driver)
http://www.logicpd.com/downloads/476/
Hope this helps and good luck,
-Mike