COM iMX6 WinCE: Difference between revisions

From Wiki-DB
Jump to navigationJump to search
Capfel (talk | contribs)
Ageisreiter (talk | contribs)
No edit summary
Line 10: Line 10:
: 3. Start ASRDisp.exe.
: 3. Start ASRDisp.exe.


== <br/>WEC7 Downloads(function library) ==
== <br/>Binary BSP user guide ==
:'''DHHalLib'''
:{| class="wikitable"
|''<code> [[media:DHHalLib_IMX6_WinCE.zip|Download DHHalLib Library Version 1.0.0.0]] </code>''
|}


:'''DHHalLib Demo App Source Code'''
:{| class="wikitable"
|''<code> [[media:DHHalLib_Test_App.zip|Download DHHalLib Test App Source Code]] </code>''
|}
:'''DHHalLib Demo App Binary'''
:{| class="wikitable"
|''<code> [[media:DHHalLib_Test_App_Binary.zip|Download DHHalLib Test App Binary File]] </code>''
|}


== <br/>WEC7 DHHalLib (function library) ==
== <br/>WEC7 DHHalLib (function library) ==

Revision as of 10:20, 19 May 2016


FAQ


WEC7 Tools

CE Remote Display Application

The Remote Display allows to operate the target device's Win CE desktop from a Windows PC. It requires a USB ActiveSync connection.
Download X86 remote display application (over ActiveSync connection)
Usage
1. Extract the zip file on your PC.
2. Wait for the ActiveSync connection to be ready.
3. Start ASRDisp.exe.


Binary BSP user guide


WEC7 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)

GPIO

Note: These functions can only access the DHCOM standard GPIOs. The mapping is done with the following enum.
  typedef 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
  }*pDHCOM_GPIOEnum;
Direction
bool GPIOSetDirection( DHCOM_GPIOEnum eGpio, bool bInOut, bool bDefaultState)
Input values:
DHCOM_GPIOEnum eGpio = DHCOM GPIO pin name
bool 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 name
bool 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
Set Interrupt
bool GPIOSetInterrupt(DHCOM_GPIOEnum eGpio, HANDLE *hEvent, unsigned long ulTimeout)
Input values:
DHCOM_GPIOEnum eGpio = DHCOM GPIO pin name
HANDLE *hEvent = external EventHandle Pointer
bool bState = GPIO Interrupt State
Return value: bool --> true = success; false = failed
Clear Interrupt
bool GPIOClearInterrupt(DHCOM_GPIOEnum eGpio)
Note: Gpio Interrupt cannot disable by Hardware.
Input values:
DHCOM_GPIOEnum eGpio = DHCOM GPIO pin name
Return value: bool --> true = success; false = failed

I2C

Note: These freqencies can only be set. The mapping is done with the following enum.
  typedef enum DHCOM_I2CEnum
  {
   DHCOM_I2C0=0,
   DHCOM_I2C1,
   DHCOM_I2C2,
   DHCOM_I2C3,
   DHCOM_I2C_NOT_DEFINED
  }*pDHCOM_I2CEnum;
Note: These freqencies can only be set. The mapping is done with the following enum.

typedef enum DHCOM_I2CFREQMode

  {
   I2C_100K=0,
   I2C_400K,
   I2C_800K,I2C_1600K,
   I2C_2400K,
   I2C_3200K
  }*pDHCOM_I2CFREQMode;
Open
bool I2COpen(DHCOM_I2CEnum eI2CPort, DHCOM_I2CFREQMode eI2CFreq)
Input values:
DHCOM_I2CEnum eI2CPort = DHCOM I2C port name (e.g. DHCOM_I2C0)
DHCOM_I2CFREQMode eI2CFreq = DHCOM I2C port freqency name(e.g. I2C_100K)
Return value: bool --> true = success; false = failed
Close
void I2CClose(DHCOM_I2CEnum eI2CPort)
Input values:
DHCOM_I2CEnum eI2CPort = DHCOM I2C port name (e.g. DHCOM_I2C0)
Read
bool I2CRead(DHCOM_I2CEnum eI2CPort, DHCOM_I2CFREQMode eI2CFreq, unsigned char cDevId, unsigned char cI2CReg, unsigned char *pOutBuffer)
Input values:
DHCOM_I2CEnum eI2CPort = DHCOM I2C port name (e.g. DHCOM_I2C0)
DHCOM_I2CFREQMode eI2CFreq = DHCOM I2C port freqency name(e.g. I2C_100K)
unsigned char cDevId = I2C device address (0..127)
unsigned char cI2CReg = I2C device register address (0..255)
unsigned char *pOutBuffer = Pointer to the read byte
Return value: bool --> true = success; false = failed
Write
bool I2CWrite(DHCOM_I2CEnum eI2CPort, DHCOM_I2CFREQMode eI2CFreq, unsigned char cDevId, unsigned char cI2CReg, unsigned char cValue)
Input values:
DHCOM_I2CEnum eI2CPort = DHCOM I2C port name (e.g. DHCOM_I2C0)
DHCOM_I2CFREQMode eI2CFreq = DHCOM I2C port freqency name(e.g. I2C_100K)
unsigned char cDevId = I2C device address (0..127)
unsigned char cI2CReg = I2C device register address (0..255)
unsigned char cValue = Value to be written
Return value: bool --> true = success; false = failed
Read multiple bytes
bool I2CReadMultipleBytes(DHCOM_I2CEnum eI2CPort, DHCOM_I2CFREQMode eI2CFreq, unsigned char cDevId, unsigned char cI2CReg, unsigned char cBytes, unsigned char *pOutBuffer)
Input values:
DHCOM_I2CEnum eI2CPort = DHCOM I2C port name (e.g. DHCOM_I2C0)
DHCOM_I2CFREQMode eI2CFreq = DHCOM I2C port freqency name(e.g. I2C_100K)
unsigned char cDevId = I2C device address (0..127)
unsigned char cI2CReg = I2C device register address (0..255)
unsigned char cBytes = Number of bytes to be read (max. 255)
unsigned char *pOutBuffer = Pointer to the read buffer
Return value: bool --> true = success; false = failed
Write multiple bytes
bool I2CWriteMultipleBytes(DHCOM_I2CEnum eI2CPort, DHCOM_I2CFREQMode eI2CFreq, unsigned char cDevId, unsigned char cI2CReg, unsigned char cBytes, unsigned char *pInBuffer)
Input values:
DHCOM_I2CEnum eI2CPort = DHCOM I2C port name (e.g. DHCOM_I2C0)
DHCOM_I2CFREQMode eI2CFreq = DHCOM I2C port freqency name(e.g. I2C_100K)
unsigned char cDevId = I2C device address (0..127)
unsigned char cI2CReg = I2C device register address (0..255)
unsigned char cBytes = Number of bytes to be read (max. 255)
unsigned char *pInBuffer = Pointer to the input buffer
Return value: bool --> true = success; false = failed

KITL

Restart
bool RestartPowerKITL()
Input values:
Return value: bool --> true = success; false = failed
Control
bool ControlPowerKITL(bool bEnable)
Input values:
bool bEnable = Enable/Disable KITL Connection
Return value: bool --> true = success; false = failed

Backlight

Backlight Level
bool SetBacklightLevel(int Level)
Note: In DHHalLib Version 1.0.0.0 only Backlight Enable/Disable available. (Value 0 = Disable, Value 1 to 255 = Enable)
Input values:
int Level = Backlight Level (0 ... 255)
Return value: bool --> true = success; false = failed
Backlight Timeout
bool SetBacklightSuspend(int Timeout, bool bEnable)
Note: In DHHalLib Version 1.0.0.0 not available.
Input values:
int Timeout = Timeout for Backlight (seconds)
bool bEnable = Enable/Disable Timeout Backlight --> true = On; false = Off
Return value: bool --> true = success; false = failed

Touch screen

Calibrate touch
bool CalibrateTouch()
Return value: bool --> true = success; false = failed
Clear calibration data
bool ClearTouchCalibrationData()
Description:
This function delete the registry entry [HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\TOUCH] dword:"TouchCalibrationDone" . For saving the value permanent please call SaveRegistry() afterwards.
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()