00001
00047 #pragma once
00048 #include <windows.h>
00049
00050
00051 #ifdef __cplusplus
00052 extern "C" {
00053 #endif
00054
00077 #define GPS_EVENT_DEFAULT_NAME L"JS_GPS_1HZ_SIGNAL"
00078
00097 #define DOCK_EVENT_NAME L"JS_DOCK_EVENT"
00098
00115 DWORD JSGetAmbientTemp(DWORD * pdwTemp);
00116
00117
00147 typedef struct
00148 {
00149 WORD Battery1_TotalCapacity;
00150 WORD Battery2_TotalCapacity;
00151
00152 WORD Battery1_Voltage;
00153 WORD Battery2_Voltage;
00154
00155 INT16 Battery1_Current;
00156 INT16 Battery2_Current;
00157
00158 WORD Battery_Interval;
00159
00160 INT16 Battery1_Temperature;
00161 INT16 Battery2_Temperature;
00162
00163 BYTE Battery1_Percentage;
00164 BYTE Battery2_Percentage;
00165
00166 BYTE Battery_Flags;
00167
00168
00169
00170 BYTE Reserved;
00171 } TK6000_BATTERY_INFO;
00172
00173
00174 #define BATTERY_1_PRESENT 0x08
00175 #define BATTERY_1_CHARGING 0x04
00176 #define BATTERY_2_PRESENT 0x02
00177 #define BATTERY_2_CHARGING 0x01
00178
00179
00213 typedef struct
00214 {
00215
00216 WORD Battery1_Percentage;
00217 WORD Battery2_Percentage;
00218
00219
00220 WORD Battery1_Voltage;
00221 WORD Battery2_Voltage;
00222
00223
00224
00225 INT16 Battery1_Current;
00226 INT16 Battery2_Current;
00227
00228
00229 INT16 Battery1_Temperature;
00230 INT16 Battery2_Temperature;
00231
00232
00233 WORD Battery1_TimeToFull;
00234 WORD Battery2_TimeToFull;
00235
00236
00237 WORD Battery1_TimeToEmpty;
00238 WORD Battery2_TimeToEmpty;
00239
00240
00241 DWORD Battery_Flags;
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261 } MESA_BATTERY_INFO;
00262
00263
00264 #define MESA_STATUS_EXT_POWER_PRESENT 0x00000100
00265 #define MESA_STATUS_BAT1_PRESENT 0x00000200
00266 #define MESA_STATUS_BAT2_PRESENT 0x00000400
00267 #define MESA_STATUS_EXT_POWER_CONNECTED 0x00000800
00268 #define MESA_STATUS_BAT1_CONNECTED 0x00001000
00269 #define MESA_STATUS_BAT2_CONNECTED 0x00002000
00270 #define MESA_STATUS_BAT1_CHARGING 0x00004000
00271 #define MESA_STATUS_BAT2_CHARGING 0x00008000
00272 #define MESA_STATUS_BAT1_BQ_OK 0x00100000
00273 #define MESA_STATUS_BAT2_BQ_OK 0x00200000
00274 #define MESA_STATUS_BAT1_OK_TO_CHARGE 0x02000000
00275 #define MESA_STATUS_BAT2_OK_TO_CHARGE 0x04000000
00276 #define MESA_STATUS_BAT1_CHARGE_ERROR 0x08000000
00277 #define MESA_STATUS_BAT2_CHARGE_ERROR 0x10000000
00278
00279
00280
00310 typedef struct
00311 {
00312 WORD Battery_Voltage;
00313 INT16 Battery_Current;
00314
00315 WORD Battery_Interval;
00316 INT16 Battery_Temperature;
00317 WORD Battery_Capacity;
00318 BYTE Battery_Percentage;
00319 BYTE Battery_Flags;
00320
00321
00322 } ALLEGRO_BATTERY_INFO;
00323
00324
00325 #define BATTERY_CHARGEKNOWN 0x10 // This is set if the charge percentage is
00326
00327 #define BATTERY_PRESENT 0x08
00328 #define BATTERY_CHARGING 0x04
00329 #define BATTERY_ALKALINE 0x02 // This is set if an alkaline battery is installed
00330 #define BATTERY_VEHICLEMODE 0x01 // This is set if in vehicle charge mode
00331
00332
00346 #define ARCHER_BATTERY_INFO ALLEGRO_BATTERY_INFO
00347
00371 DWORD JSGetBatteryStatus(VOID * pBattInfo, DWORD * pdwSize);
00372
00373
00390 DWORD JSGetDisplayType(DWORD * pdwDispType);
00391
00392
00413 DWORD JSGetPlatformName(TCHAR * szDeviceString, DWORD * pdwLen);
00414
00415
00416 #define BLUETOOTH_NOT_PRESENT 0
00417 #define BLUETOOTH_921600 1
00418 #define BLUETOOTH_115200 2
00419
00436 typedef struct
00437 {
00438 DWORD dwBluetoothHardware;
00439 DWORD dwWiFiHardware;
00440 } JS_RADIO_INFO;
00441
00460 typedef struct
00461 {
00462 DWORD dwBluetoothHardware;
00463 DWORD dwWiFiHardware;
00464 DWORD dwCellHardware;
00465 DWORD dwGPSHardware;
00466 } JS_EXP_RADIO_INFO;
00467
00488 DWORD JSGetRadioInfo(VOID * pRadioInfo, DWORD * pdwSize);
00489
00490
00510 DWORD JSGetSerialNumber(TCHAR * szSerialString, DWORD * pdwLen);
00511
00512
00513 #define PWR_SUSPEND 1
00514 #define PWR_RESET 2
00515 #define PWR_POWER_OFF 3
00516 #define PWR_CLEAN_BOOT_ROOT 4
00517 #define PWR_CLEAN_BOOT_STORAGE 5
00518 #define PWR_CLEAN_BOOT_REGISTRY 6
00519 #define PWR_CLEAN_BOOT_ALL 7
00520
00545 DWORD JSSetPower(DWORD dwPowerCode);
00546
00547 #define POWER_CURRENT 0
00548 #define POWER_BATTERY 1
00549 #define POWER_EXTERNAL 2
00550
00575 DWORD JSGetBacklightBrightness(DWORD * pdwLCDBright, DWORD dwPower);
00576
00577
00602 DWORD JSSetBacklightBrightness(DWORD dwLCDBright, DWORD dwPower);
00603
00604
00621 DWORD JSGetBacklightState(DWORD * pdwEnable);
00622
00623
00640 DWORD JSSetBacklightState(DWORD dwEnable);
00641
00642
00667 DWORD JSGetBluetoothOverrideState(DWORD * pdwEnable);
00668
00669
00694 DWORD JSSetBluetoothOverrideState(DWORD dwEnable);
00695
00696
00710 DWORD JSGetContrast(DWORD * pdwContrast);
00711
00712
00725 DWORD JSSetContrast(DWORD dwContrast);
00726
00727
00739 DWORD JSGetExpansionPower(DWORD * pdwOn);
00740
00741
00760 DWORD JSSetExpansionPower(DWORD dwOn);
00761
00762
00776 DWORD JSGetExp2GPIOWakeSource(DWORD * pdwEnable);
00777
00778
00802 DWORD JSSetExp2GPIOWakeSource(DWORD dwEnable);
00803
00804 #define MESA_EXP_GPIO_0 0x00000001 //41 (1:9)
00805 #define MESA_EXP_GPIO_1 0x00000002 //42 (1:10)
00806 #define MESA_EXP_GPIO_2 0x00000004 //43 (1:11)
00807 #define MESA_EXP_GPIO_3 0x00000008 //44 (1:12)
00808 #define MESA_EXP_GPIO_4 0x00000010 //45 (1:13)
00809 #define MESA_EXP_GPIO_5 0x00000020 //46 (1:14)
00810 #define MESA_EXP_GPIO_6 0x00000040 //47 (1:15)
00811 #define MESA_EXP_GPIO_7 0x00000080 //48 (1:16)
00812 #define MESA_EXP_GPIO_8 0x00000100 //87 (2:23)
00813 #define MESA_EXP_GPIO_9 0x00000200 //89 (2:25)
00814 #define MESA_EXP_GPIO_10 0x00000400 //90 (2:26)
00815 #define MESA_EXP_GPIO_11 0x00000800 //91 (2:27)
00816 #define MESA_EXP_GPIO_12 0x00001000 //92 (2:28)
00817 #define MESA_EXP_GPIO_13 0x00002000 //109 (3:13)
00818 #define MESA_EXP_GPIO_14 0x00004000 //110 (3:14)
00819 #define MESA_EXP_GPIO_15 0x00008000 //111 (3:15)
00820 #define MESA_EXP_GPIO_16 0x00010000 //112 (3:16)
00821
00822 #define MESA_COM1_RXD MESA_EXP_GPIO_0 //41 (1:9)
00823 #define MESA_COM1_TXD MESA_EXP_GPIO_1 //42 (1:10)
00824 #define MESA_COM1_CTS MESA_EXP_GPIO_2 //43 (1:11)
00825 #define MESA_COM1_DCD MESA_EXP_GPIO_3 //44 (1:12)
00826 #define MESA_COM1_DSR MESA_EXP_GPIO_4 //45 (1:13)
00827 #define MESA_COM1_RI MESA_EXP_GPIO_5 //46 (1:14)
00828 #define MESA_COM1_DTR MESA_EXP_GPIO_6 //47 (1:15)
00829 #define MESA_COM1_RTS MESA_EXP_GPIO_7 //48 (1:16)
00830 #define MESA_GPIO_FLASH MESA_EXP_GPIO_8 //87 (2:23)
00831 #define MESA_SPI_CLK MESA_EXP_GPIO_9 //89 (2:25)
00832 #define MESA_SPI_CSB MESA_EXP_GPIO_10 //90 (2:26)
00833 #define MESA_SPI_MOSI MESA_EXP_GPIO_11 //91 (2:27)
00834 #define MESA_SPI_MISO MESA_EXP_GPIO_12 //92 (2:28)
00835 #define MESA_COM3_RTS MESA_EXP_GPIO_13 //109 (3:13)
00836 #define MESA_COM3_RXD MESA_EXP_GPIO_14 //110 (3:14)
00837 #define MESA_COM3_TXD MESA_EXP_GPIO_15 //111 (3:15)
00838 #define MESA_COM3_CTS MESA_EXP_GPIO_16 //112 (3:16)
00839
00840 #define MESA_COM1_MASK 0x000000FF
00841 #define MESA_SPI_MASK 0x00001E00
00842 #define MESA_COM3_MASK 0x0001E000
00843 #define MESA_GPIO_MASK 0x0001FFFF
00844
00845 #define MESA_NUM_GPIO 17
00846
00847
00848 #define GPIO_PULL_DEFAULT 0x0000
00849 #define GPIO_PULL_NEITHER 0x8000
00850 #define GPIO_PULL_DOWN 0xA000
00851 #define GPIO_PULL_UP 0xC000
00852 #define GPIO_PULL_MASK 0xE000
00853
00854
00855 #define GPIO_SUSPEND_INPUT 0x280
00856 #define GPIO_SUSPEND_OUTPUT_LO 0x200
00857 #define GPIO_SUSPEND_OUTPUT_HI 0x300
00858 #define GPIO_SUSPEND_KEEPER 0x380
00859 #define GPIO_SUSPEND_MASK 0x380
00860
00861
00862 #define EXP_IRQ_EDGE_RISE 0x0010
00863 #define EXP_IRQ_EDGE_FALL 0x0020
00864 #define EXP_IRQ_EDGE_BOTH 0x0030
00865 #define EXP_IRQ_EDGE_NONE 0x0040
00866 #define EXP_IRQ_EDGE_MASK 0x0070
00867
00868
00869 #define EXP_PULL_NONE 0
00870 #define EXP_PULL_KEEPER 0x80 // Keeper will apply a pull in the same direction as it is being driven
00871 #define EXP_PULL_DOWN_360K 0xC0
00872 #define EXP_PULL_UP_100K 0xE0
00873 #define EXP_PULL_UP_75K 0xD0
00874 #define EXP_PULL_UP_22K 0xF0
00875
00876
00877 #define EXP_SUSPEND_STATE_KEEPER 0 // Keep the same state it is in for suspend
00878 #define EXP_SUSPEND_STATE_OUT_LOW 1 // Turn into GPIO mode and drive out low
00879 #define EXP_SUSPEND_STATE_OUT_HIGH 2 // Turn into GPIO mode and drive out high
00880 #define EXP_SUSPEND_STATE_IN_PNONE 3 // Turn into GPIO mode, input, no pullup or pulldown
00881 #define EXP_SUSPEND_STATE_IN_PKEEP 4 // Turn into GPIO mode, input, using pull keeper
00882 #define EXP_SUSPEND_STATE_IN_360K_PD 5 // Turn into GPIO mode, input, using 360K pull down
00883 #define EXP_SUSPEND_STATE_IN_75K_PU 6 // Turn into GPIO mode, input, using 75K pull up
00884 #define EXP_SUSPEND_STATE_IN_100K_PU 7 // Turn into GPIO mode, input, using 100K pull up
00885 #define EXP_SUSPEND_STATE_IN_22K_PU 8 // Turn into GPIO mode, input, using 22K pull up
00886
00887
00888
00889
00890 #define EXP_GPIO_INTR_AND_WAKE 15
00891
00892
00917 DWORD JSGetGPIO(DWORD * pdwGPIOLevel);
00918
00919
00961 DWORD JSSetGPIO(DWORD dwGPIOLevel, DWORD dwMask);
00962
00963
00985 DWORD JSGetGPIODirection(DWORD * pdwGPIODirection);
00986
00987
01030 DWORD JSSetGPIODirection(DWORD dwGPIODirection, DWORD dwMask);
01031
01032
01033 #define VK_OEM_F1 0xE9
01034 #define VK_OEM_F2 0xEA
01035 #define VK_OEM_F3 0xEB
01036 #define VK_OEM_F4 0xEC
01037 #define VK_OEM_F5 0xED
01038 #define VK_OEM_F6 0xEE
01039 #define VK_OEM_F7 0xEF
01040 #define VK_OEM_F8 0xF0
01041 #define VK_OEM_F9 0xF1
01042 #define VK_OEM_F10 0xF2
01043 #define VK_OEM_F11 0xF3
01044 #define VK_OEM_F12 0xF4
01045 #define JS_SHIME_MODE_NONE 0
01046 #define JS_SHIME_MODE_FKEY 1
01047 #define JS_SHIME_MODE_FKEY_LOCK 2
01048
01062 DWORD JSGetKeyboardCustomMode( DWORD *pdwKeyboardMode );
01063
01064
01081 DWORD JSSetKeyboardCustomMode( DWORD dwKeyboardMode );
01082
01083
01084 #define LED_OFF 0x00
01085 #define LED_RED 0x01
01086 #define LED_GREEN 0x02
01087 #define LED_AMBER 0x03
01088 #define LED_BLUE 0x04
01089 #define LED_MESA_MASK 0x06
01090
01091
01092 #define LED_A2_GREEN_USER 0x08 // If this bit is set, the Green LED is under USER control (otherwise, internal control)
01093 #define LED_A2_BLUE_USER 0x10 // If this bit is set, the Blue LED is under USER control
01094 #define LED_A2_GREEN_ON LED_GREEN // If this bit is set, and the Green LED is under USER control, then the green LED will be on
01095 #define LED_A2_BLUE_ON LED_BLUE // If this bit is set, and the Blue LED is under USER control, then the blue LED will be on
01096 #define LED_A2_BLUE_PRIOR 0x20 // If this bit is set, the Blue LED has priority over the green
01097
01098
01135 DWORD JSGetLEDStatus(DWORD * pdwLEDStatus);
01136
01137
01171 DWORD JSSetLEDStatus(DWORD dwLEDStatus);
01172
01209 DWORD JSSetLEDStatusEx(DWORD dwLEDStatus, DWORD dwMask);
01210
01211
01226 DWORD JSGetPort(DWORD dwPortNumber, DWORD * pdwPortValue);
01227
01228
01243 DWORD JSSetPort(DWORD dwPortNumber, DWORD dwPortValue);
01244
01245
01246
01247
01248 #define PROC_SPEED_208 2
01249 #define PROC_SPEED_312 3
01250 #define PROC_SPEED_416 4
01251 #define PROC_SPEED_520 5
01252 #define PROC_SPEED_624 6
01253 #define PROC_SPEED_PERFORMANCE 97
01254 #define PROC_SPEED_POWER_SAVE 98
01255 #define PROC_SPEED_AUTO 99
01256 #define PROC_SPEED_AR2_760 760
01257 #define PROC_SPEED_AR2_1000 1000
01258
01290 DWORD JSGetProcessorSpeed(DWORD * pdwProcSpeedCode);
01291
01292
01314 DWORD JSSetProcessorSpeed(DWORD dwProcSpeedCode);
01315
01316 #define GPIO_BIT_RI_POWER 0x40000000
01317
01333 DWORD JSGetRingInPower(DWORD * pdwOn);
01334
01335
01355 DWORD JSSetRingInPower(DWORD dwOn);
01356
01357
01376 DWORD JSGetStickyKeyBrightness(DWORD * pdwKeyBright, DWORD dwPower);
01377
01378
01396 DWORD JSSetStickyKeyBrightness(DWORD dwKeyBright, DWORD dwPower);
01397
01398
01417 DWORD JSGetTouchScreenState(DWORD * pdwEnable);
01418
01419
01438 DWORD JSSetTouchScreenState(DWORD dwEnable);
01439
01440
01456 DWORD JSGetWifiPower(DWORD * pdwState);
01457
01458
01474 DWORD JSSetWifiPower(DWORD dwState);
01475
01476
01477
01478 #define VOLUME_MDOC_USER 1
01479
01494 DWORD JSFormatVolume(DWORD dwVolumeId);
01495
01509 typedef struct
01510 {
01511 BYTE slaveAddress;
01512 BYTE registerAddress;
01513 BYTE registerData;
01514 } MESA_I2C_INFO;
01515
01516 typedef struct
01517 {
01518 BYTE slaveAddress;
01519 WORD registerAddress;
01520 BYTE registerData;
01521 } MESA_SCCB_INFO;
01522
01545 DWORD JSGetI2CRegister(VOID * pI2CInfo, DWORD dwSize);
01546
01566 DWORD JSSetI2CRegister(VOID * pI2CInfo, DWORD dwSize);
01567
01591 DWORD JSGetGPIOAltState(DWORD * pdwGPIOAltState);
01592
01629 DWORD JSSetGPIOAltState(DWORD dwGPIOAltState, DWORD dwMask);
01630
01657 DWORD JSGetGPIOPull(DWORD dwGPIO, DWORD * pdwGPIOPullDirection);
01658
01690 DWORD JSSetGPIOPull(DWORD dwGPIO, DWORD dwPullDirection);
01691
01721 DWORD JSGetGPIOSuspend(DWORD dwGPIO, DWORD * pdwSuspendState);
01722
01756 DWORD JSSetGPIOSuspend(DWORD dwGPIO, DWORD dwSuspendState);
01757
01782 DWORD JSGetExpIRQState(DWORD * pdwExpIRQState);
01783
01809 DWORD JSSetExpIRQState(DWORD dwExpIRQState);
01810
01811
01845 typedef struct
01846 {
01847 DWORD dwModulesPresent;
01848 TCHAR wszModelNumber[8];
01849 DWORD dwRamSize;
01850 DWORD dwStorageSize;
01851 WCHAR wszBoardRevision[16];
01852 WCHAR wszPICVersion[64];
01853 WCHAR wszBootloaderVersion[8];
01854 WCHAR wszOSVersion[64];
01855 WCHAR wszOSBuildNumber[64];
01856 DWORD dwLanguageCode;
01857 } MESA_DEVICE_INFO;
01858
01859 typedef struct
01860 {
01861 DWORD dwModulesPresent;
01862 TCHAR wszModelNumber[8];
01863 DWORD dwRamSize;
01864 DWORD dwStorageSize;
01865 WCHAR wszBoardRevision[16];
01866 WCHAR wszPICVersion[64];
01867 WCHAR wszBootloaderVersion[8];
01868 WCHAR wszOSVersion[64];
01869 WCHAR wszOSBuildNumber[64];
01870 DWORD dwLanguageCode;
01871 WCHAR wczPackageNumber[16];
01872 } A2_JSAPI_DEVICE_INFO;
01873
01874
01875 #define MODULES_PRESENT_BLUETOOTH 0x00000001
01876 #define MODULES_PRESENT_WIFI 0x00000002
01877 #define MODULES_PRESENT_GPS 0x00000004
01878 #define MODULES_PRESENT_CAMERA 0x00000008 // MTP9111 camera module
01879 #define MODULES_PRESENT_GSM 0x00000010
01880 #define MODULES_PRESENT_FLASH 0x00000020 // Should be set if CAMERA or OV5640_CAMERA is set
01881 #define MODULES_PRESENT_CDMA 0x00000040
01882 #define MODULES_PRESENT_OV5640_CAMERA 0x00000080 // OV5640 camera module
01883
01884
01900 DWORD JSGetDeviceInfo(VOID * pDeviceInfo, DWORD * pdwSize);
01901
01902 #define IRQ_EVENT_DEFAULT_NAME L"EXP_IRQ_EVENT"
01903
01938 DWORD JSInitInterrupt(DWORD dwTrigger);
01939
01951 DWORD JSStopInterrupt();
01952
01968 DWORD JSGetCellModemPower(DWORD * pdwPowerState);
01969
01985 DWORD JSSetCellModemPower(DWORD dwPowerState);
01986
01998 DWORD JSGetDockStatus(BOOL * pfDocked);
01999
02000
02001 #ifdef __cplusplus
02002 }
02003 #endif