Pelles C is a freely available integrated development environment (IDE) that includes an assembler, C compiler, linker, editor, debugger and many project management utilities. It provides support for Microsoft Windows and Pocket PC. Click here for more details and terms of use.
This article demonstrates how Pelles C 7.00 can be used to develop applications for WinCE.
Connect your Toradex Module with the development PC. If you use Windows XP or an earlier version you need to install ActiveSync. Windows 7/8 will automatically use Windows Mobile Device Center.
Ignore this warning and click on Next.
Click on Build to build the database. After the database is created, click on Close to go to main window. Installation procedure is complete and IDE is ready to use. Following image shows the main window:
To create a new project, go to File > New > Project. A New project window will open as shown below:
A console output window will open on the Toradex module as shown below:
Go to Tools > Capture Screen from Pocket PC File > New bitmap to get the target screen image remotely or you can use Remote Display tool also.
This demo shows the use of Toradex GPIO library to toggle the SODIMM pin number 133.
polib.exe /machine:arm GpioLib.dll -out:GpioLib.lib
For example:
d:\vcpp_gpioToggle_demo\lib>polib.exe /machine:arm GpioLib.dll -out:GpioLib.lib
This will generate a lib file with name GpioLib.lib under d:\vcpp_gpioToggle_demo > lib directory.
#include <windows.h> #include "GpioLib.h" int WINAPI WinMain(HINSTANCE hInstance, ///< Handle to current instance. HINSTANCE hPrevInstance, ///< Handle to previous instance. LPWSTR lpCmdLine, ///< Pointer to command line. int nCmdShow) ///< Show state of window. { DWORD loopCount = 0; printf("Welcome to Toradex.\n"); InitGPIOLib(); ///< Initializes GPIO library. printf("Executing demo application to show GPIO as Output...\n"); SetPinAltFn(133, -1, DIR_OUT); ///< Sets SODIMM Pin 133 as GPIO(-1) and set to Output. for (loopCount = 0; loopCount < 20; loopCount++) { SetPinLevel(133, FALSE); ///< Sets the logic level of SODIMM pin 133 to LOW. Sleep(500); SetPinLevel(133, TRUE); ///< Sets the logic level of SODIMM pin 133 to HIGH. Sleep(500); } DeInitGPIOLib(); ///< Releases resources used by GPIO library and de-initializes GPIO library. printf("Press enter to exit the program.\n"); getchar(); return 0; }- Copy GpioLib.dll from vcpp_gpioToggle_demo > lib and paste it to FlashDisk > System on your WinCE device. - Go to Project and Build and Execute the application.
Download
You can download this demo project from here.