Home

Windows CE 6.0 For BCT RE1 User Guide

image

Contents

1. BCTSetGPIOPinDirection Sets the directions of GPIO bits to either input or output DWORD WINAPI BCTSetGPIOPinDirection WORD wVal Parameters wVal in A bitmap of the required pin directions Bit set input Bit cleared output E g Passing a value of 0x05 into the function would set bits O and 2 to inputs and other bits to outputs Return Value If the function succeeds the return value is GPIO OK or GPIO OK SOME BITS BELONG TO PERIPHERAL If the function fails the return value is a nonzero error code defined in gpio h Remarks Bits 12 15 of wVal are ignored If some GPIO bits are shared with either the IRDA or I2S peripherals GPIO OK SOME BITS BELONG TO PERIPHERAL is returned This should be considered a warning and not an error If the GPIO pins are sharing with either the IRDA or I2S peripherals the bits relating to the peripheral s will be ignored Requirements Header Declared in GPIO h Library Use GPlIOapi lib DLL Requires GPlOapi dll Page 26 Hardware API libraries BCTReadGPIOPort Reads the current state of the GPIO port DWORD WINAPI BCTReadGPIOPort PWORD pwVal Parameters pwVal out A pointer to an 16 bit value that will hold the value of the GPIO port Return Value If the function succeeds the return value is GPIO OK or GPIO OK SOME BITS BELONG TO PERIPHERAL If the function fails the return value is a nonz
2. BCTEnableWatchdog Enables the RE1 watchdog to timeout in the time specified DWORD WINAPI BCTEnableWatchDog BYTE bTimeout Parameters bTimeout in The duration in 10 s of ms before a timeout is triggered Must be greater than 0 and less than 128 Return Value If the function succeeds the return value is WATCHDOG OK If the function fails the return value is a nonzero error code defined in watchdog h Remarks Requirements Header Declared in Watchdog h Library Use watchdog lib DLL Requires watchdog dll Page 31 Hardware API libraries BCTDisableWatchdog Disables the RE1 watchdog DWORD WINAPI BCTDisableWatchDog VOID Parameters Return Value If the function succeeds the return value is WATCHDOG OK If the function fails the return value is a nonzero error code defined in watchdog h Remarks Requirements Header Declared in Watchdog h Library Use watchdog lib DLL Requires watchdog dll BCTRefreshWatchdog Resets the watchdog counter to the timeout value DWORD WINAPI BCTRefreshWatchDog VOID Parameters Return Value If the function succeeds the return value is WATCHDOG OK If the function fails the return value is a nonzero error code defined in watchdog h Remarks Requirements Header Declared in Watchdog h amp azfavr h Library Use watchdog lib DLL Requires watchdog dll Page 32 Hardware API libraries System Reset The RE1 Windows CE 6
3. File View h x 2 4 e al B gt a 2 Certificates Date Time Dialing Display Internet Keyboard LCD Mouse Ontion Brightness v 82 a Stylus Properties E77 p TEES Double Tap Calibration INetwork and Owner Passwort EH Remove Stylus Dial up Co If your device isn t Programs FE p responding properly to your a JO taps you may need to zin TR amp recalibrate your screen stem olume Sounds To start the recalibration process tap Recalibrate Visual Studio 2005 Remote Tools Visual 2005 includes remote tools that can be used for managing Windows CE images and debugging Windows CE applications All the remote tools require an ActiveSync connection The remote tools must be run from the start menu rather than within Visual Studio at location Start gt Programs gt Microsoft Visual Studio 2005 Visual Studio Remote Tools Programs em VEEZCENIS gi IE Microsoft Office 2 Fe Documents gt i Internet Explorer 3 2 Settings Des E i Microsoft Windows Embedded Studio E 22 Search ig Borland C 4 5 gt Remote Process Viewer a I Atman vr Ae Remote Registry Editor Q9 Help and Support ir Atmel AVR Tools Cia Remote Spy E 2 Run e Microsoft ActiveSync Remote Zoom In g C CDBurnerXP Pro 3 E Y The table below details the remote tools available and their purpose Remote Tool Purpose Re
4. 1 Open Visual Studio 2005 Click on File gt New gt Project to begin a new project Start Page Microsoft Visual Studio File Edt View Project Target Tools Window Community Help New gt 31 Project Ctrl Shift N jg register E Open website rer Close 1j Fite Ctrl GI Close sc Project From Existing Code a igi Save all Ctrl Shift 5 E T t For Your Review C Specification Version 3 0 Relea n Thu 09 Aug 2007 18 51 41 GMT Download and read a draf 39 specification and give us your feedback di t New Hands on Labs and Samples Available for Visua re Thu 09 Aug 2007 18 51 42 GMT Use these resources to ge with the latest version of your favorite Cif compiler in Visual Recent Projects Beta 2 Download Visual Studio 2008 Beta 2 Exit eb site Thu 09 Aug 2007 18 48 52 GMT See all of the improvemen T TT eb Site coming in Visual Studio 2008 with next generation Web devel eaten integrated development For the Microsoft Office system and industry leading designers for Windows Vista Getting Started The Evolution Of LINO And Its Impact On The Desian What s new in C 2005 Catalog Items View cYSolution Explorer Output 1X Show output from Windows CE Debug 8 4 E TEJE Er mor List Output Ready 2 Under the Visual C language click smart device Select Win32 Sm
5. 6 L break t There are no usable controls in this group Drag an item onto this text to add it to the toolbox HEt SeeasQs else printf inInvalid Optionin H aA ALE 7 Under Configuration Properties gt Linker gt Input add GPIOAPI lib to the Additional dependencies GPIOSample Property Pages E Common Properties References E Configuration Properties General Debugging Deployment CiC E Linker General Input Manifest File Debugging System Optimization Embedded IDL Advanced Command Line XML Document Generator Browse Information Build Events Custom Build Step Authenticode Signing iso ca Ega d eu rises Configuration Jactive Debua gt Platform and click OK Jactive BCTRE1CE6SDKGeneric MIPSID T Configuration Manager Ignore All Default Libraries No Ignore Specific Library Module Definition File Add Module to Assembly Embed Managed Resource File Force Symbol References Delay Loaded DLLs Assembly Link Resource Adi NOINHERIT Additional Dependencies Specifies additional items to add to the link line ex kernel32 lib configuration specific Page 15 Software Development 8 We are now ready to compile and build the sample application From the Build menu click on Rebuild Solution If the compile and
6. Results 1 get Find Symbol Results Rebuild All succeeded Ln it Coli chi INS amp Page 16 Software Development 9 Visual Studio 2005 SPI supports deploying applications automatically to the target device and debugging applications remotely This requires an ActiveSync connection Using a USB A B cable attach the development machine to the REI device port and ensure that the REI is turned on 10 Ensure Microsoft ActiveSync is connected zix Eile View Tools Help Syne Schedule Ex Explore Guest G Connected b Hide Details amp Information Type Status J 11 We can now deploy our application remotely from Visual Studio From the Debug menu click on Start Debugging Visual studio should now download the application to the target and run it GPIOSample Microsoft Visual Studio ioj xl File Edit View Project Build Debug Target Tools Window Community Help D au caga Windows BCTREICEGSDKGeneric MIPE g usb MES BCTREICE6SDKGeneric MIPSII Device P Start Debugging 5 BRL Sj m S 3 URL 7 PN b Stat Without Debugging Ctri F5 Pid gp Attach to Process x EM lt X E 4 um E Gopal Exceptions CtrhAlt E Br il General eq Solution GPIOSample 1 98 step Into Fil C Gl cprosamp
7. after a set amount of time This feature is useful for power saving when the device is not in use Only the external power idle mode is implemented In the below screen shot the device is configured to automatically dim the backlight after 2 minutes of inactivity Page 5 r My Device e Recycle Bin ele 2 Hu Internet Explorer 1 d Media Player Introduction Save battery life by automatically turning off the backlight when not needed Turn off backlight when using Battery power and device is idle for more than E minute v V External power and device is idle moe 2minutes v e A Display Properties SD Card a snaa RE1 includes a Micro SD card interface which confirms to specification version 1 1 and supports cards up to 4GB in size Note SDHC cards are not supported at this time Windows CE optionally includes hive registry support on the SD Card which allows registry settings to be persisted through a cold boot If an SD card is used to hold the hive registry the SD card becomes none removable and the must be inserted from system start up Other Peripherals The Windows CE 6 0 has support for 10 100 Ethernet stylus touch screen and AC97 Audio all of which are implemented as standard OS components Watchdog and I2C support is also provided in the form of API s Page 6 Installation Development tool installation Application development target
8. build was successful the output window should state 1 succeeded 0 failed GPIOSample Microsoft Visual Studio A x File Edit View Project Build Debug Target Tools Window Community Help id Er ES d od Build Solution F7 b Debug BCTREICE6SDKGeneric MIPE s usb E BCTREICE6SDKGeneric MIPSII ___Bebulld Solution CtrirAlteFz D mS Deploy Solution SE T AEE ji Build GPIOSample od Solution GPIOSample 1 Rebuild GPIOSample Writing bit d with Value LL M nic BYTE dr There are no usable controls E Gil Gprosample Deploy GPIOSample de BCTSetGPIOBit BYTE dwBitMap 1B00L an in this group Drag an item Ei Gy Header Files nCode GPIO OK onto this text to add it to the n stdafx h Clean GPIOSample toolbox Resource Files Project Onl ly i oe Bir Source Fies Ld Failed dYin dwReturnCode 2 aPIOSample Batch Bulls C stdafx cpp Configuration Manager E ReadMe txt ae B compile Ctrl F7 nBit Written n printf in else if dwOption 6 break H else 0 printf inInvalid OptionYn ES H exit 0 EDEN Show output from Build 8 4 S l Build log was saved at file c iDocuments and Settings drobinson Desktop GP a l GPIOSample 0 error s 0 warning s Rebuild All 1 succeeded 0 failed 0 skipped v 4 gt 4 gt so i ca a E Output Find
9. changed The library exports two functions which are detailed below BCTSetLCDBrightness Sets the LCD brightness to the value specified DWORD WINAPI BCTSetLCDBrightness BYTE bBrightness Parameters bBrightness in The brightness value to write Return Value If the function succeeds the return value is RE1 LCD OK If the function fails the return value is a nonzero error code defined in BCTLCDBrightnessAPI h Remarks When bBrightness is set to 0 the LCD will be at its dimmest Requirements Header Declared in BCTLCDBrightnessAPI h Library BCTLCDBrightnessAPI lib DLL BCTLCDBrightnessAPI dll Page 24 Hardware API libraries BCTGetLCDBrightness Retrieves the current LCD brightness DWORD WINAPI BCTGetLCDBrightness PBYTE bBrightness Parameters bBrightness out A pointer to a byte that will hold the current LCD brightness Return Value If the function succeeds the return value is RE1 LCD OK If the function fails the return value is a nonzero error code defined in BCTLCDBrightnessAPI h Remarks When bBrightness is set to 0 the LCD will be at its dimmest Requirements Header Declared in BCTLCDBrightnessAPI h Library BCTLCDBrightnessAPI lib DLL BCTLCDBrightnessAPI dll Page 25 Hardware API libraries GPIO API The GPIO API library provides access to the 12 available GPIO pins on the REI platform The library exports five functions which are detailed below
10. platform allows the system to be reset using system events The two available system events are Event Name Event Description REI EVENT COLD BOOT RESET When set causes a system warm boot REI EVENT WARM BOOT RESET When set causes a system cold boot Please see the ResetSystemSample application included in the Windows CE 6 0 SDK for details on how to use these events Page 33 Hardware API libraries Appendix A Windows CE components included in the generic Windows CE image for RE1 SYSGEN ACM MSFILTER SYSGEN ASYNCMAC SYSGEN AS BASE SYSGEN ATL SYSGEN AUDIO SYSGEN AUDIO ACM SYSGEN AUDIO STDWAVEFILES SYSGEN AUTH SYSGEN AUTH SCHANNEL SYSGEN AUTORAS SYSGEN AYGSHELL SYSGEN CEDDK SYSGEN CEPLAYER SYSGEN CERTS SYSGEN CMD SYSGEN COMMCTRL SYSGEN C
11. MAGING PNG DECODE SYSGEN IMAGING PNG ENCODE SYSGEN IMM SYSGEN INETCPL SYSGEN IPHLPAPI SYSGEN IRDA SYSGEN JSCRIPT AUTHOR SYSGEN JSCRIPT ENCODE SYSGEN LOCALAUDIO SYSGEN MENU OVERLAP SYSGEN MINGDI SYSGEN MINGWES SYSGEN MININPUT SYSGEN MINWMGR SYSGEN MLANG SYSGEN MODEM SYSGEN MSGQUEUE SYSGEN MSHTML SYSGEN MSMQ SYSGEN MSPART SYSGEN MSXML DOM SYSGEN MSXML XQL SYSGEN NDIS SYSGEN NDISUIO SYSGEN NETUTILS SYSGEN NKCOMPR SYSGEN NKMAPFILE SYSGEN NOTIFY SYSGEN PM SYSGEN PPP SYSGEN PRINTING SYSGEN PWORD SYSGEN QVGAP SYSGEN REDIR SYSGEN RELFSD SYSGEN SDBUS SYSGEN SD MEMORY SYSGEN SERDEV SYSGEN SERVICES SYSGEN SHDOCVW SYSGEN SHELL SYSGEN STANDARDSHELL SYSGEN STDIO SYSGEN STDIOA SYSGEN STOREMGR SYSGEN STREAMAUDIO SYSGEN STRSAFE SYSGEN TAPI SYSGEN TCPIP SYSGEN TCPIP6 SYSGEN TIMESVC DST SYSGEN TOOLHELP SYSGEN TOUCH SYSGEN UIPROXY SYSGEN UNIMO SYSGI SYSGI DEM SYSGEN URLMON SYSGEN USB SYSGEN USBFN N USBEN SERIAL SYSGEN USBFN STORAGE SYSGEN USB HID N USB HID CLIENTS SYSGEN USB HID KEYBOARD SYSGEN USB HID MOUS Gl N USB PRINTER SYSG A Fe o DE SYSGEN _ AS EN USB STORAGE SYSGEN VBSCRIPT AUTHOR SYSGEN VBSCRIPT ENCODE SYSGEN VBSCRIPT MSGBOX SYSGEN VEM SYSGEN WCELOAD SYSGEN WININET SYSGEN WINSOCK Page 34
12. N key to see more text G Accept Decline m ces Page 7 Installation 4 Enter user and company name information and click next Customer Information eS Please enter your customer information AN lue Chip Technology lue Chip Technology 5 Choose complete installation iy Windows CE 6 0 SDK for BCT RE1 Setup Choose Setup Type Choose the setup type that best suits your needs 6 Click next i8 Windows CE 6 0 SDK for BCT RE1 Destination Folders Page 8 Installation 7 Click install fe Windows CE 6 0 SDK for BCT RE1 Setup xj Ready to Install The Setup Wizard is ready to begin the Complete installation amp Click Install to begin the installation If you want to review or change any of your installation settings click Back Click Cancel to exit the wizard 8 After the installation completes click the Finish button ii Windows CE 6 0 SDK for BCT RE1 Setup eS Completing the Windows CE 6 0 SDK for BCT RE1 Setup Wizard Click the Finish button to exit the Setup Wizard 9 The installation of the BCT RE1 SDK is now complete By default the RE1 SDK installs to location C Program Files Windows CE Tools wce600 BCTRE1CE6SDKGeneric In this location the following folders will be copied Folder Description Include This folder holds all the header files required to build an application for the RE1 platform Lib This folder
13. OMMDLG SYSGEN CONNMC SYSGEN CONSOLE SYSGEN CORELOC SYSGEN CORESTRA SYSGEN CPP EH AND RTTI SYSGEN CREDMAN SYSGEN CRYPTO SYSGEN CTLPNL SYSGEN CURSOR SYSGEN DCOM SYSGEN DEVICE SYSGEN DEVLOAD SYSGEN DHCPSRV SYSGEN DISPLAY SYSGEN DOTNETV2 SYSGEN DOTNETV2 SUPPORT SYSGEN DSHOW SYSGEN DSHOW ACMWRAP SYSGEN DSHOW DISPLAY SYSGEN DSHOW DMO SYSGEN DSHOW IMAADPCM SYSGEN DSHOW MP3 SYSGEN DSHOW MPEGA SYSGEN DSHOW MPEGSPLITTER SYSGEN DSHOW MSADPCM SYSGEN DSHOW MSG711 SYSGEN DSHOW MSGSM610 SYSGEN DSHOW WAV SYSGEN DSHOW WAVEOUT SYSGEN DSHOW WMA SYSGEN DSHOW WMA VOICE SYSGEN DSHOW WMP SYSGEN DSHOW WMT SYSGEN DSHOW WMT ASXV1 SYSGEN DSHOW WMT ASXV2 SYSGEN DSHOW WMT ASXV3 SYSGEN DSHOW WMT HTTP SYSGEN DSHOW WMT LOCAL SYSGEN DSHOW WMT MMS SYSGEN DSHOW WMT MULTI SYSGEN DSHOW WMT NSC SYSGEN ETHERNET SYSGEN EXFAT SYSGEN FATFS SYSGEN FIBER SYSGEN FMTMSG SYSGEN FMTRES SYSGEN FONTS ARIAL 1 30 SYSGEN FONTS COUR 1 30 SYSGEN FONTS SYMBOL SYSGEN FONTS TAHOMA 1 07 SYSGEN FONTS TIMES 1 30 SYSGEN FONTS WEBDINGS SYSGEN FONTS WINGDING SYSGEN FSDBASE SYSGEN FSPASSWORD SYSGEN FSRAMROM SYSGEN FSREGHIVE SYSGEN FSREPLBIT SYSGEN FULL CRT SYSGEN GDI ALPHABLEND SYSGEN GRADFILL SYSGEN HTTPD SYSGEN IESAMPLE SYSGEN IE JSCRIPT SYSGEN IE VBSCRIPT SYSGEN IMAGING SYSGEN IMAGING BMP DECODE SYSGEN IMAGING BMP ENCODE SYSGEN IMAGING GIF DECODE SYSGEN IMAGING GIF ENCODE SYSGEN IMAGING JPG DECODE SYSGEN IMAGING JPG ENCODE SYSGEN I
14. art Device Project and give the project the name GPIOSample Click OK New Project 2 xl Be ere Project types Templates oo E Business Intelligence Projects Visual Studio installed templates E Visual C ATL Wat Smart Device Project amc Smart Device ActiveX Control CLR a MFC Smart Device Application a MFC Smart Device DLL General Y Smart Device Project MFC Smart Device My Templates Win32 Other Languages jJSearch Online Templates Other Project Types Platform Builder For CE 6 0 4 win32 or Console project For Windows Mobile and other Windows CE based devices Name errosa 00s Location Jc Documents and Settings drabinson Desktop BYE Solution Name ariosample IV Create directory For solution 7 cm Page 11 Software Development 3 The smart device project wizard should now start Click next to begin The REI SDK installed in the previous section should now be populated in the Installed SDKs list Arrange the list boxes so that BCTRE1ICE6SDKGeneric is the only SDK in the Selected SDK s list Click Next Win32 Smart Device Project Wizard GPIOSample 2 xl C Overview Select platform SDKs to be added to the current project Platforms Selected SDKs Application Settings Pocket PC 2003 Smartphone 2003 Blue Chip Technology ETX C7 SDK Windows Mobile 5 0 Pocket PC SC APEX ZF SDK ISTANDARDSDK_500 BCT ETX CN700 CE 6 0 SDK Platfor
15. byte to write HEX scanf s x amp dwValue printf n nWriting Port 4xh n t WORD dwValue dwReturnCode BCTWriteGPIOPort WORD dwValue if dwReturnCode GPIO OK printf Failed to write byte with error code d n dwReturnCode printf Byte written n printf n else if dwOption 3 printf n nPlease enter a bitmap for pin Directions HEX scanf s x amp dwBitMap printf n nWriting Port directions 2xh n t WORD dwBitMap dwReturnCode BCTSetGPIOPinDirection WORD dwBitMap if dwReturnCode GPIO OK printf Failed to set pin directions with error code d n dwReturnCode Page 13 Software Development else printf Bit directions written n printf Mn else if dwOption 4 printf n nPlease enter which bit value to read 0 11 scanf s sd amp dwBitMap printf n nReading bit d n t BYTE dwBitMap dwReturnCode BCTGetGPIOBit BYTE dwBitMap amp iValue if dwReturnCode GPIO OK printf Failed to read bit with error code d n dwReturnCode printf Read bit value d n iValue printf nyy else if dwOption 5 printf n nPlease enter which bit value to write 0 11 scanf s d amp dwBitMap printf n nPlease enter 1 to set or 0 to clear scanf s sd amp dwValue if dwValue 1 dwValue 1 if dwValue lt 0 dwValue 0 printf nWriti
16. e GPlIOapi lib DLL Requires GPlOapi dll Page 28 Hardware API libraries BCTSetGPIOBit Sets an individual bit to a value specified DWORD WINAPI BCTSetGPIOBit WORD wBitNumber BOOL iVal Parameters wBitNumber in The bit that should be written Acceptable values 0 11 iVal in The value to be written to the bit TRUE Set FALSE Clear Return Value If the function succeeds the return value is GPIO OK If the function fails the return value is a nonzero error code defined in gpio h Remarks Requirements Header Declared in GPIO h Library Use GPlIOapi lib DLL Requires GPlOapi dll Page 29 Hardware API libraries BCTGetGPIOBit Gets the value of an individual bit DWORD WINAPI BCTGetGPIOBit WORD wBitNumber PBOOL piVal Parameters wBitNumber in The bit that should be read Acceptable values 0 11 iVal in A pointer to a BOOL that will hold the state of the pin TRUE Set FALSE Clear Return Value If the function succeeds the return value is GPIO OK If the function fails the return value is a nonzero error code defined in gpio h Remarks Requirements Header Declared in GPIO h Library Use GPlIOapi lib DLL Requires GPlOapi dll Page 30 Hardware API libraries Watchdog API The Watchdog API allows the system watchdog to be used to cause a system reset in the event of an unresponsive application The library exports four functions which are detailed below
17. ero error code defined in gpio h Remarks Bits 12 15 of pwVal should be ignored If some GPIO bits are shared with either the IRDA or I2S peripherals GPIO OK SOME BITS BELONG TO PERIPHERAL is returned This should be considered a warning and not an error If the GPIO pins are sharing with either the IRDA or I2S peripherals the bits relating to the peripheral will be undefined Requirements Header Declared in GPIO h Library Use GPlIOapi lib DLL Requires GPlOapi dll Page 27 Hardware API libraries BCTWriteGPIOPort Writes to the GPIO port DWORD WINAPI BCTWriteGPIOPort WORD wVal Parameters wVal in The word that gets written to the GPIO port Return Value If the function succeeds the return value is GPIO OK If the function fails the return value is a nonzero error code defined in gpio h Remarks Bits 12 15 of wVal are ignored If some GPIO bits are shared with either the IRDA or I2S peripherals GPIO OK SOME BITS BELONG TO PERIPHERAL is returned This should be considered a warning and not an error If the GPIO pins are sharing with either the IRDA or I2S peripherals the bits relating to the peripheral will be ignored GPIO 11 belongs to a separate physical peripheral at the silicon level compared to the rest of the GPIO pins This incurs a latency between bit 11 being set in relation to the rest of the port Requirements Header Declared in GPIO h Library Us
18. holds all the library files required to build an application for the RE1 platform Sample applications This folder holds some sample applications that can be used as references while creating applications for RE1 The examples demonstrate how to interface to the RE1 hardware libraries Page 9 Software Development Sample Applications The Windows CE 6 0 SDK for REI includes four sample applications that demonstrate the use of REI specific API s The sample applications are detailed below Application Description BrightnessController This sample can be used for evaluating the brightness control capability of the RE1 platform A binary of this sample is included in the Windows CE 6 image and can be accessed from the control panel GPlOSample This sample can be used for evaluating the general purpose input outputs of the RE1 platform This application makes use of the GPIOAPI dll API library WatchdogSample This sample demonstrates how to operate the RE1 watchdog using the watchdog API ResetSystemSample This sample demonstrates how to reset an RE1 system using system events Page 10 Software Development Software development This section describes how to create an RE1 Windows CE 6 0 application using the SDK and deploy the application to the RE1 device using Microsoft ActiveSync over USB The sample application created will demonstrate how to use the RE1 GPlOapi to manipulate the GPIO bits
19. ing Windows CE 6 for RE1 requires Microsoft Visual Studio 2005 SP1 Microsoft Active sync 4 5 or greater and the RE1 software development kit The version of Visual Studio 2005 chosen must support smart device development Ensure that Visual studio is fully installed along with active sync before following the steps below to install the BCT RE1 SDK 1 Launch the RE1 SDK installer file from the support CD BCT RE1 CE6 SDK Generic msi Windows Installer Package 5 892 KB 2 Click next fe Windows CE 6 0 SDK for BCT RE1 Setup Welcome to the Windows CE 6 0 SDK for BCT RE1 Setup Wizard The Setup Wizard will install Windows CE 6 0 SDK for BCT RE1 on your computer Click Next to continue or Cancel to exit the Setup Wizard 3 Acceptthe licence agreement and click next 1E Windows CE 6 0 SDK for BCT RE1 License Agreement xj End User License Agreement aE Be sure to carefully read and understand the following end user license agreement e3 and then indicate whether you accept or do not accept the terms of the agreement This software will not be installed on your development workstation unless you accept the terms of the end user license agreement For your future reference you can print the text of the end user license agreement by clicking the PRINT button SOFTWARE LICENSE TERMS WINDOWS EMBEDDED CE 6 0 CUSTOMIZED OEM SOFTWARE DEVELOPMENT KIT for Windows CE 6 0 SDK for BCT RE1 1 0 0 m Press the PAGE DOW
20. it for an undefined period before retrying Requirements Header Declared in SMBUS h Library Use SMBUSAPI lib DLL Requires SMBUSAPI dll Page 21 Hardware API libraries BCTSmbusBufferedWrite Sends a command and writes up to 16 bytes of data DWORD WINAPI BCTSmbusBufferedWrite BYTE bDeviceAddress BYTE bCommand BYTE bdata BYTE bBytesToWrite Parameters bDeviceAddress in The slave address on the SMBUS to send the command to bCommand in The SMBUS command identifier bdata in An pointer to an array of bytes to write bBytesToWrite in The number of bytes to write Return Value If the function succeeds the return value is SMBUS OK If the function fails the return value is a nonzero error code defined in SMBUS h Remarks As the SMBUS architecture is a two wire interface it operates on a first come first served bases For this reason the driver also operates in the same way and limits access to its functions to one process at a time If the SMBUS is accessed while already in use the error code SMBUS DRIVER LOCKED BY OTHER PROCESS will be returned and is normal The application should wait for an undefined period before retrying This function supports sending a maximum of 16 bytes at a time This function can also be used for SMBUS quick writes by setting the bBytesToWrite to O This will cause the function to send the command without a data phase Requirement
21. le There are no usable controls s CE Step over Fio enter which bit value to write 0 17 in this group Drag an item Ge Header Files ItMap onto this text to add it to the hi stdafx h toolbox a lenter 1 to set or D to clear Gi Resource Files Now Breskpoint o ER Ei Gy Source Files ue PIOSample F stdafx cpp rryawvar zy E Readme txt t dwValue 1 if dwValue lt 0 dwValue 0 printf inWriting bit d with Value d n t BYTE dt dwReturnCode BCTSetGPIOBit BYTE dwBitMap BOOL dwi if dwReturnCode GPIO OK t cap printf Failed din dwReturnCode jos Z else t print nBit Written n ee Ns Output Ax Show output from Build 18 4 y Ll c Documents and Settings drobinson Desktop GP ded 0 failed 0 skipped gt 4 gt Aso i ca Ega output gj Find Results 1 JZ Find Symbol Results Rebuild All succeeded init Coli Chi NS Z7 If deployment fails ensure that the USB A B cable is attached and ActiveSync is connected Page 17 System amp Development Tools System and Development tools Registry Settings Windows CE 6 0 for REI optionally comes with hive based registry support This allows registry settings to be persisted through a cold boot The Registry Settings utility accessible from the system control panel can be used to set how often the volatile registry is backed up to solid state media and also perform manual com
22. m Builder 4 Select console application from the Application type selection box and click finish Win32 Smart Device Project Wizard GPIOSample 21x m E Project Settings Overview Application type Platforms C Windows application Application Settings Console application C pu Static library Additional options T Empty project I Export symbols v precompiled header Page 12 Software Development 5 Modify the GPIOSample cpp file to include the following code include stdafx h include lt windows h gt include lt commctrl h gt include lt gpio h gt int _tmain int argc TCHAR argv TCHAR envp DWORD dwReturnCode DWORD dwOption 0 DWORD dwValue DWORD dwBitMap WORD wValue BOOL iValue printf BCT RE1 GPIO sample application V1 00 n while 1 fflush stdin printf n t1 Read PORT n printf Nt2 Write a WORD to PORT n printf t3 Set Pin directions Wn printf Nt4 Get bit n printf Nt5 Set bit n printf Nt6 Exitin print t tPlease enter an Option 1 6 scanf s sd amp dwOption fflush stdin if dwOption 1 printf n nReading Port n t dwReturnCode BCTReadGPIOPort amp wValue if dwReturnCode GPIO OK printf Failed to read byte with error code d n dwReturnCode printf Read value 4xh n wValue printe AN else if dwOption 2 printf n nPlease enter the
23. mits It is possible for a custom application to manage the persisting the hive registry using the Windows API function RegFlushKey In the event that a registry change makes the system unusable a factory reset will force the registry to be restored to its default state on next boot Refer to the REI user manual for details on how to achive this File View h x z E mc ry YP amp J gt g Accessibility Certificates Date Time Display Display Internet Keyboard Mouse Network and Owner Resolution Options Dial up Co e 2 yop wy Password Regional Registry Remove Storage Stylus System jettings Settings Programs Manager Persistent Registry Settings Update system and user hive files S Alternately O Together Update period secs 180 Flush Now J Registry Control Utility v2 00 00 2007 Blue Chip Technology Ltd All Rights Reserved start amp Control Panel Persistent Registry Settings lt b 10 54 AM Regedit Windows CE 6 0 for RE comes with a built in registry editor in the style of the standard Windows registry editor To access it load regedit from either the command prompt or Run menu Page 18 System amp Development Tools Touch Screen Calibration The touch screen can be calibrated using the built in calibration utility To access it open the Stylus Properties window from the system control panel
24. mote File Viewer Used to browse a remote CE device for files and folders The same can be achieved using the Explore option in ActiveSync Remote Registry Editor Used to remotely view and edit a Windows CE registry Remote Heap Walker Used to remotely view the memory allocation heap on a CE device Remote Spy Used to remotely view Windows Messages on a CE device Remote Process Viewer Used to remotely view processes running on a Windows CE device Remote Zoom In Used to retreive a current snap shot of a CE device desktop Page 19 Hardware API libraries RE1 Hardware API Libraries SMBUS API The SMBUSAPI is provided to give developers a simple mechanism for accessing devices attached the REI SMBUS compatible bus The four SMBUSAPI functions provided are detailed over the next pages BCTSmbusWriteByte Sends a command and writes a byte of data to a device on the SMBUS DWORD WINAPI BCTSmbusWriteByte BYTE bDeviceAddress BYTE bCommand BYTE bData Parameters bDeviceAddress in The slave address on the SMBUS to send the command to bCommand in The SMBUS command identifier bData in A byte of data to pass in with the command For commands that do not require any data be passed in set this value to 0x00 Return Value If the function succeeds the return value is SMBUS OK If the function fails the return value is a nonzero error code defined in SMBUS h Remarks As the SMBUS architecture is a
25. ncluded in the generic Windows CE image for RE1 34 Introduction Introduction The content of this document provides all the necessary information required to get started with application development under Windows CE 6 0 for the RE1 platform It covers e An overview of the Windows CE 6 0 Boot Process e Peripheral support included in Windows CE 6 0 e Howto install the tools necessary to develop applications that run under Windows CE 6 0 e How to start developing applications e Howto use the Hardware API functions supported under RE1 Windows CE 6 0 initialisation and booting overview The RE1 boot process begins with the execution of a Windows CE boot loader The boot loader which is configurable using the RE1 USB device port in conjunction with accompanying desktop configuration utility performs the following initialisation steps e Setup initial processor registers e Test for configuration mode or normal Windows CE boot e Setup LCD display and show a custom splash screen e Locate a Windows CE 6 0 image e Boot Windows CE 6 0 Image The boot loader can be used for updating Windows CE images Splash screens and even the boot loader itself The boot loader is also used to enable or disable peripherals and configure the required LCD panel connected to a BCT RE1 The RISC engine supports booting from either onboard NOR flash or over Ethernet using Windows KITL Again the boot source is selectable using the boot loader configura
26. ng bit d with Value d n t BYTE dwBitMap BOOL dwValue dwReturnCode BCTSetGPIOBit BYTE dwBitMap BOOL dwValue if dwReturnCode GPIO OK printf Failed d n dwReturnCode printf nBit Written Wn else if dwOption 6 break else printf nInvalid Option n exit 0 Page 14 Software Development 6 Asthis application is using functions exported by the GPIOAPI library we need to link this project to the file GPIOAPI lib From the Project menu click properties GPIOSample Microsoft Visual Studio File Edit View Build Debug iBl E4 gg js Add Class BCTREICE6SDKGen i Add New Item i Add Existing Item i Device Solution Explorer IDA Tools Window Community Help b Debug Target BCTRE1CE6SDKGeneric MIPS v TR he a Z Bp usb Ctrl Shift A Shift At A mE Exclude From Project CA Solution GPIOSa 3 show alll Files amp CR cPIOSampl Ei Gy Header A n std Resource Ei By Source Files GPIOSample stdafx cpp E ReadMe txt Set as StartUp Project jose BCTSetGPIOBit BYTE dwBitMap BOOL dwV turnCode GPIO OK GPlOSample Properties Alt F7 exit 0 nlriting bit td with Value d n t BYTE ace printf Failed din dwReturnCode H else t printf inBit Writtenin F printf in F else if dwOption
27. on development and is configured for 115200 baud 8 data bits 1 stop bit and no parity Please see RE1 Single Board Computer User Guide for details on configuring this port using the configuration utility From Windows CE 6 0 BSP 1 02 the transmit line of the RS422 485 interface is software controllable to be enabled or disabled by using the DTR control line When DTR is enabled the TX line is enabled When DTR is disabled the TX line is disabled Backlight control A sample brightness control application is included in the Windows CE image to allow the brightness to be easily changed using the control panel in Windows Explorer The sample application is included as source with the Windows CE SDK to demonstrate how to change the brightness using a custom application To try the sample LCD Brightness application navigate to the control panel and double click on LCD Brightness File View M2 x 4 A Pr A2 i E E oO D b amp Q Certificates Date Time Dialing Display Internet Keyboard LCD Mouse Options Brightness e 6 90 9 DJ g Network and Owner Password PC Regional Remove Stylus System Dial up Co Connection Settings Programs Jo BGT RET Brightness Controller Volume amp 3 Sounds Use the plus and minus buttons to adjust the brightness 0 255 caesia c 2009 Blue Chip Technology Ltd The backlight is also configurable in the Display Properties dialogue to allow the screen to be automatically dimmed
28. on if the IRDA driver and I2S driver are enabled By default the IRDA and 12S peripherals are disabled in the boot loader so all 12 GPIO pins are available The IRDA driver is configured to use COM6 when enabled and can be accessed in the same way as a serial port Testing for COM6 being present in the system is a method of a custom application testing if the IRDA port is enabled At time of writing there is no I2S support implemented in the Windows CE image Contact Blue Chip Technology sales for details Real Time Clock The BCT RE1 includes a battery backed real time clock This allows the system time to be remembered through a cold boot Calls to either SetSystemTime or SetLocalTime automatically cause the new time to be saving into the battery backed clock Serial Ports Two RS232 ports and one RS422 485 port are exposed as standard COM ports in Windows CE Please see the following table for details of how each physical port is mapped in Windows CE Header Signal Type Control Lines Windows CE COM port P11 RS422 485 RS422 485 No COM1 P11 RS232 RS232 No COM2 When not in kernel debugging mode P10 RS232 Yes COM3 Page 4 Introduction COM has a dual purpose in Windows CE It can be configured as either a Windows CE standard COM port available to applications or as a kernel debug port useful during OS low level development When configured for kernel debug COM is unavailable for applicati
29. s Header Declared in SMBUS h Library Use SMBUSAPI lib DLL Requires SMBUSAPI dll Page 22 Hardware API libraries BCTSmbusBufferedRead Sends a command and reads up to 16 bytes of data DWORD WINAPI BCTSmbusBufferedRead BYTE bDeviceAddress BYTE bCommand BYTE bdatal BYTE bBytesToRead Parameters bDeviceAddress in The slave address on the SMBUS to send the command to bCommand in The SMBUS command identifier bData out A pointer to an array of bytes to read into bBytesToRead in The number of bytes to read Return Value If the function succeeds the return value is SMBUS OK If the function fails the return value is a nonzero error code defined in SMBUS h Remarks As the SMBUS architecture is a two wire interface it operates on a first come first served bases For this reason the driver also operates in the same way and limits access to its functions to one process at a time If the SMBUS is accessed while already in use the error code SMBUS DRIVER LOCKED BY OTHER PROCESS will be returned and is normal The application should wait for an undefined period before retrying This function supports reading a maximum of 16 bytes at a time Requirements Header Declared in SMBUS h Library Use SMBUSAPI lib DLL Requires SMBUSAPI dll Page 23 Hardware API libraries LCD Brightness API The LCD brightness API library allows the brightness of compatible LCD s to be
30. s M WA Ne Windows CE 6 0 For BCT REI User Guide Document Reference Windows CE User Guide Document Issue 1 02 Contents siegefo Ufeii o o ee RC OL 3 Windows CE 6 0 initialisation and booting overview ueeseseeeeeeeeeennenen ennemis 3 Development tool installation eer etc crit ace ka Eia c eae reae ndn 7 Software development ccccessccccccecsesessnsecececeseeseaeaeceeecesseseausecesecesseseaaeseeeeeceseesaeaeseeeescusseseaaeaeeeeeess 11 System and Development tools eene nennen neni E enne tria EEEE EAEE AE nasse 18 Registry Settiligs uices ee bedccecdseandddatesncedesesanddabaaccecestancdda airaa E Ea iE aiiin it 18 REG COG sce eene eene E E E MTM 18 Touch Sereen CalibratlOD un cuntur teme e t eret eoe Tot Ortus ide ee bote n rate denen Foe eed 19 Visual Studio 2005 Remote Tools sssssssssseseseseeeeeeeee ener nennen inttr en nennen nnne nennen 19 RE1 Hardware API Libraries erii eri cete eec beete re he hese ede heey cb dn re oec Ceo dida 20 SMBUS AP 20 ECD Brightness AP Is teet over iesu ide E E E nw ssgussasie E SE 24 GPIO API 26 Watchdog APIs nieto bI BHP MPO nei ime Men iM PE 31 SVSEOITL IReSQD o ciem aut A E E OEE tae 33 Appendix A Windows CE components i
31. tion utility For full details on configuring the boot loader over USB using the desktop configuration utility please see the document RE1 Single Board Computer User Guide Windows CE 6 0 follows the standard boot process except drivers are configured to dynamically load dependent on their configuration in the boot loader If the Windows CE image supports the hive based registry the registry is restored from SD Card media during boot This allows the OS to persist registry settings through a cold boot Page 3 Introduction Windows CE 6 0 Peripheral Support The optional generic Windows CE 6 0 image included with an RE1 features support for the following on board peripherals USB Host The BCT RE1 features support for an OHCI compatible USB host Operating system support for HID and Mass storage devices is included in the image USB Device In Windows CE the USB device port is implemented as a Microsoft ActiveSync device Using ActiveSync 4 5 or greater it is possible to debug and deploy applications using Visual Studio as well as view the internal RISC engine files system in an explorer style interface GPIO IRDA and I2S The Windows CE GPIO driver supports up to a maximum of 12 separate pins all configurable as either inputs or outputs Two GPIO pins are mutually exclusive with the IRDA port and three pins are mutually exclusive with the I2S peripheral The pins available to the GPIO driver are dynamically configured based
32. two wire interface it operates on a first come first served bases For this reason the driver also operates in the same way and limits access to its functions to one process at a time If the SMBUS is accessed while already in use the error code SMBUS DRIVER LOCKED BY OTHER PROCESS will be returned and is normal The application should wait for an undefined period before retrying Requirements Header Declared in SMBUS h Library Use SMBUSAPI lib DLL Requires SMBUSAPI dll Page 20 Hardware API libraries BCTSmbusReadByte Sends a command and reads a byte of data from a device on the SMBUS DWORD WINAPI BCTSmbusReadByte BYTE bDeviceAddress BYTE bCommand PBYTE pbData Parameters bDeviceAddress in The slave address on the SMBUS to send the command to bCommand in The SMBUS command identifier pbData out A pointer to an 8 bit value to hold the data returned Return Value If the function succeeds the return value is SMBUS OK If the function fails the return value is a nonzero error code defined in SMBUS h Remarks As the SMBUS architecture is a two wire interface it operates on a first come first served bases For this reason the driver also operates in the same way and limits access to its functions to one process at a time If the SMBUS is accessed while already in use the error code SMBUS DRIVER LOCKED BY OTHER PROCESS will be returned and is normal The application should wa

Download Pdf Manuals

image

Related Search

Windows CE 6.0 For BCT RE1 User Guide

Related Contents

LASCAR DPM 750S-BL 3½ Digit Backlit LCD Voltmeter Module service manual    Lenovo IdeaCentre K3 series user manual                

Copyright © All rights reserved.
DMCA: DMCA_mwitty#outlook.com.