COM AM35 WinCE: Difference between revisions
From Wiki-DB
Jump to navigationJump to search
Ageisreiter (talk | contribs) |
Ageisreiter (talk | contribs) |
||
(15 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== FAQ == | |||
:'''Q: I'm not able to start ActiveSync connection via USB?''' | |||
:'''A:''' 1. Connect USB cable 2. Go to Network and Dial-Up Connections 3. Launch USB connection | |||
:'''Q: How to save hive registry''' | |||
:'''A:''' Use SaveHiveRegistry tool, which is stored on development microSD card. | |||
== Downloads == | |||
:'''CAN Demo Binary and Source''' | |||
:* [[media:CANDemo_V1.1.0.0.zip|CAN Demo binary (v1.1.0.0)]] | |||
:* [[media:CANDemo_source_V1.1.0.0.zip|CAN Demo source code (v1.1.0.0)]] | |||
:'''Software Development Kit''' | |||
:* [[media:DHCOM_AM35x_Standard_SDK.zip|WinEC 7 SDK for DHCOM AM35x core module]] | |||
== Audio Codec == | |||
=== Record input selection === | |||
:'''Select Microphone as the recorder device''' | |||
:{| class="wikitable" | |||
|''<code> wavmixer –s IN 2 1 </code>'' | |||
|} | |||
:'''Select LineIn as the recorder device''' | |||
:{| class="wikitable" | |||
|''<code> wavmixer –s IN 2 0 </code>'' | |||
|} | |||
=== Microphone boost === | |||
:'''Enable 20dB Mic boost''' | |||
:{| class="wikitable" | |||
|''<code> wavmixer –s IN 3 1 </code>'' | |||
|} | |||
== USB Camera demo == | |||
=== Description === | |||
:This DDrawTest application could be used to show USB camera live stream. The application can be found on the development microSD card. | |||
=== How to change resolution === | |||
:{| class="wikitable" | |||
|''<code> HKLM\Drivers\USB\ClientDrivers\Video_Class\[PreferredWidth] </code>'' | |||
|} | |||
:{| class="wikitable" | |||
|''<code> HKLM\Drivers\USB\ClientDrivers\Video_Class\[PreferredHeight] </code>'' | |||
|} | |||
: Note: Possible resolutions depends on the used usb camera. | |||
== CAN demo == | |||
=== Description === | |||
:This sample application send CAN messages and tries to receive CAN messages during the duration time. | |||
:Note: The application uses the extended CAN ID. | |||
=== Usage === | |||
:{| class="wikitable" | |||
|''<code> candemo <options> </code>'' | |||
|} | |||
:-d = duration time [ms] | |||
:-b = baudrate [kHz] | |||
:-idrx = receiver ID | |||
:-idtx = AM35x (transmitter) ID | |||
:'''default options''' | |||
::Baudrate default = 100kHz | |||
::Duration default = 10000ms | |||
::idrx (Receiver ID) default = 0x79 | |||
::idtx (AM35x ID) default = 0x78 | |||
:'''example''' | |||
::duration = 10sec., baudrate = 500kHz, idrx = 0x79 (121d), idtx = 0x78 (120d) | |||
::candemo -d10000 -b500 -idtx120 -idrx121 | |||
== DHHalLib (function library) == | == DHHalLib (function library) == | ||
The DHHalLib provides hardware related functions for Windows Embedded CE 6 and Windows Embedded Compact 7. All the functionality is available from the user mode. | The DHHalLib provides hardware related functions for Windows Embedded CE 6 and Windows Embedded Compact 7. All the functionality is available from the user mode. | ||
Line 191: | Line 252: | ||
:'''PWM''' | :'''PWM''' | ||
:{| class="wikitable" | :{| class="wikitable" | ||
|''<code> bool | |''<code> bool SetPWM(ULONG Period, ULONG DutyCycle) </code>'' | ||
|} | |} | ||
:Input values: | :Input values: | ||
::<code> | ::<code>ULONG Period</code> = Period in us | ||
::<code>ULONG DutyCycle</code> = Duty cycle in percent | |||
:Return value: <code>bool</code> --> true = success; false = failed | :Return value: <code>bool</code> --> true = success; false = failed | ||
Line 247: | Line 309: | ||
:{| class="wikitable" | :{| class="wikitable" | ||
|''<code> void SoftReset() </code>'' | |''<code> void SoftReset() </code>'' | ||
|} | |} |
Latest revision as of 13:29, 5 February 2014
FAQ
- Q: I'm not able to start ActiveSync connection via USB?
- A: 1. Connect USB cable 2. Go to Network and Dial-Up Connections 3. Launch USB connection
- Q: How to save hive registry
- A: Use SaveHiveRegistry tool, which is stored on development microSD card.
Downloads
- CAN Demo Binary and Source
- Software Development Kit
Audio Codec
Record input selection
- Select Microphone as the recorder device
wavmixer –s IN 2 1
- Select LineIn as the recorder device
wavmixer –s IN 2 0
Microphone boost
- Enable 20dB Mic boost
wavmixer –s IN 3 1
USB Camera demo
Description
- This DDrawTest application could be used to show USB camera live stream. The application can be found on the development microSD card.
How to change resolution
HKLM\Drivers\USB\ClientDrivers\Video_Class\[PreferredWidth]
HKLM\Drivers\USB\ClientDrivers\Video_Class\[PreferredHeight]
- Note: Possible resolutions depends on the used usb camera.
CAN demo
Description
- This sample application send CAN messages and tries to receive CAN messages during the duration time.
- Note: The application uses the extended CAN ID.
Usage
candemo <options>
- -d = duration time [ms]
- -b = baudrate [kHz]
- -idrx = receiver ID
- -idtx = AM35x (transmitter) ID
- default options
- Baudrate default = 100kHz
- Duration default = 10000ms
- idrx (Receiver ID) default = 0x79
- idtx (AM35x ID) default = 0x78
- example
- duration = 10sec., baudrate = 500kHz, idrx = 0x79 (121d), idtx = 0x78 (120d)
- candemo -d10000 -b500 -idtx120 -idrx121
DHHalLib (function library)
The DHHalLib provides hardware related functions for Windows Embedded CE 6 and Windows Embedded Compact 7. All the functionality is available from the user mode.
Version numbers
- Read DHHalLib version
unsigned long DHHalLibGetVersion()
- Return value:
unsigned long
--> version number (e.g. 0x01040001 for version 1.4.0.1)
- BSP version
unsigned long BSPGetVersion()
- Return value:
unsigned long
--> version number (e.g. 0x01040001 for version 1.4.0.1) - Note: The version number information is stored in the following registry key:
[HKEY_LOCAL_MACHINE\Ident] dword:"BSPVersionNumber"
- Read image version
unsigned long WinCEImageGetVersion()
- Return value:
unsigned long
--> version number (e.g. 0x01040001 for version 1.4.0.1)
I2C
- Open
bool I2COpen(unsigned char cI2CPort)
- Input values:
unsigned char cI2CPort
= DHCOM I2C port number (1.. 2)
- Return value:
bool
--> true = success; false = failed
- Close
void I2CClose(unsigned char cI2CPort)
- Input values:
unsigned char cI2CPort
= DHCOM I2C port number (1.. 2)
- Read
bool I2CRead( unsigned char cI2CPort, unsigned char cDevId, unsigned char cI2CReg, bool bSendStop, unsigned char *pOutBuffer)
- Input values:
unsigned char cI2CPort
= DHCOM I2C port number (1.. 2)unsigned char iDevId
= I2C device address (0..127)unsigned char iI2CReg
= I2C device register address (0..255)bool bSendStop
= NOT SUPPORTEDunsigned char *pOutBuffer
= Pointer to the read byte
- Return value:
bool
--> true = success; false = failed
- Write
bool I2CWrite( unsigned char cI2CPort, unsigned char cDevId, unsigned char cI2CReg, unsigned char cValue, bool bSendStop)
- Input values:
unsigned char cI2CPort
= DHCOM I2C port number (1.. 2)unsigned char iDevId
= I2C device address (0..127)unsigned char iI2CReg
= I2C device register address (0..255)unsigned char iValue
= Value to be writtenbool bSendStop
= NOT SUPPORTED
- Return value:
bool
--> true = success; false = failed
- Read multiple bytes
bool I2CReadMultipleBytes( unsigned char cI2CPort, unsigned char cDevId, unsigned char cI2CReg, unsigned char cBytes, bool bSendStop, unsigned char *pOutBuffer)
- Input values:
unsigned char cI2CPort
= DHCOM I2C port number (1.. 2)unsigned char iDevId
= I2C device address (0..127)unsigned char iI2CReg
= I2C device register address (0..255)unsigned char cBytes
= Number of bytes to be read (max. 255)bool bSendStop
= NOT SUPPORTEDunsigned char *pOutBuffer
= Pointer to the read buffer
- Return value:
bool
--> true = success; false = failed
- Write multiple bytes
bool I2CWriteMultipleBytes( unsigned char cI2CPort, unsigned char cDevId, unsigned char cI2CReg, unsigned char cBytes, bool bSendStop, unsigned char *pInBuffer)
- Input values:
unsigned char cI2CPort
= DHCOM I2C port number (1.. 2)unsigned char iDevId
= I2C device address (0..127)unsigned char iI2CReg
= I2C device register address (0..255)unsigned char cBytes
= Number of bytes to be written (max. 255)bool bSendStop
= NOT SUPPORTEDunsigned char *pInBuffer
= Pointer to the input buffer
- Return value:
bool
--> true = success; false = failed
- Bus scan
bool I2CProbe(unsigned char cI2CPort, unsigned char cDevId)
- Description:
- Scans the bus for the specified device address. Is this achievable, then the function returns "true".
- Input values:
unsigned char cI2CPort
= DHCOM I2C port number (1.. 2)unsigned char iDevId
= I2C device address (0..127)
- Return value:
bool
--> true = success; false = failed
GPIO
- Note: These functions can only access the DHCOM standard GPIOs. The mapping is done with the following enum.
enum DHCOM_GPIOEnum { DHCOM_GPIO_A, DHCOM_GPIO_B, DHCOM_GPIO_C, DHCOM_GPIO_D, DHCOM_GPIO_E, DHCOM_GPIO_F, DHCOM_GPIO_G, DHCOM_GPIO_H, DHCOM_GPIO_I, DHCOM_GPIO_J, DHCOM_GPIO_K, DHCOM_GPIO_L, DHCOM_GPIO_M, DHCOM_GPIO_N, DHCOM_GPIO_O, DHCOM_GPIO_P, DHCOM_GPIO_Q, DHCOM_GPIO_R, DHCOM_GPIO_S, DHCOM_GPIO_T, DHCOM_GPIO_U, DHCOM_GPIO_V, DHCOM_GPIO_W, DHCOM_GPIO_NOT_DEFINED };
- Direction
bool GPIOSetDirection( DHCOM_GPIOEnum eGpio, bool bInOut, bool bDefaultState)
- Input values:
DHCOM_GPIOEnum eGpio
= DHCOM GPIO pin namebool bInOut
= GPIO direction (1 = input / 0 = output)bool bDefaultState
= Default state (0 = low / 1 = high)
- Return value:
bool
--> true = success; false = failed
- Set state
void GPIOSetPin(DHCOM_GPIOEnum eGpio, bool bState)
- Input values:
DHCOM_GPIOEnum eGpio
= DHCOM GPIO pin namebool bState
= pin state ( 0 = low / 1 = high)
- Read state
bool GPIOGetPin(DHCOM_GPIOEnum eGpio)
- Input values:
DHCOM_GPIOEnum eGpio
= DHCOM GPIO pin name
- Return value:
bool
--> 0 = low; 1 = high
Memory
- Read physical address
int ReadPhysicalAddress(int iPhyAddr, unsigned char cRegSize)
- Input values:
int iPhyAddr
= Physical addressunsigned char cRegSize
= Register size (16 = 16bit; 32 = 32bit)
- Return value:
int
--> current value of the physical address
- Write physical address
int WritePhysicalAddress( int iPhyAddr, unsigned char cRegSize, int iValue, bool bReadBack)
- Input values:
int iPhyAddr
= physical addressunsigned char cRegSize
= Register size (16 = 16bit; 32 = 32bit)int iValue
= Value to be writtenbool bReadBack
= true --> the current value is read back after the write; false --> the current value isn’t read back after the write
- Return value:
int
--> content of the physical address after write, ifbReadBack
= true. Otherwise the function returns 0.
- Map physical memory
PVOID UserMmMapIoSpace(ULONG PhysicalAddress, ULONG NumberOfBytes, BOOLEAN CacheEnable)
- Note: Not supported from WinEC7.
- UnMap physical memory
void UserMmUnmapIoSpace(PVOID BaseAddress, ULONG NumberOfBytes)
- Note: Not supported from WinEC7.
Backlight
- PWM
bool SetPWM(ULONG Period, ULONG DutyCycle)
- Input values:
ULONG Period
= Period in usULONG DutyCycle
= Duty cycle in percent
- Return value:
bool
--> true = success; false = failed
Touch screen
- Calibrate touch
bool CalibrateTouch()
- Return value:
bool
--> true = success; false = failed
- Save calibration data
bool SaveTouchCalibrationData()
- Description:
- This function sets the registry entry
[HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\TOUCH] dword:"TouchCalibrationDone"
to the value 1. For saving the value permanent please callSaveRegistry()
afterwards.
- This function sets the registry entry
- Return value:
bool
--> true = success; false = failed
- Clear calibration data
bool ClearTouchCalibrationData()
- Description:
- This function sets the registry entry
[HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\TOUCH] dword:"TouchCalibrationDone"
to the value 0. For saving the value permanent please callSaveRegistry()
afterwards.
- This function sets the registry entry
- Return value:
bool
--> true = success; false = failed
Registry
- Save HIVE registry
bool SaveRegistry()
- Return value:
bool
--> true = success; false = failed
- Create backup
bool CreateRegistryBackup()
- Description:
- This function generates the files ave_HKLM_Reg.srg and Save_HKLCU_Reg.srg in the folder \Storage Card\. These files can be used at a later time to restore the registry.
- Return value:
bool
--> true = success; false = failed
- Restore backup
bool RestoreRegistryBackup()
- Description:
- This function restores the registry from the files Save_HKLM_Reg.srg and Save_HKLCU_Reg.srg in the folder \Storage Card\. Afterwards a restart is carried out automatically. If the backup files are not present, then the function returns the return value flase.
- Return value:
bool
--> true = this never happens because a soft reset is performed; false = failed
Watchdog & Reset
- Soft reset
void SoftReset()