00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #if !defined(__DEVICE_H__)
00022 #define __DEVICE_H__
00023
00024
00025 typedef struct _tag_device * LPDEVICE;
00026
00027
00028 typedef enum _tag_key_event {
00029
00030 KEY_UP_PRESS = 1,
00031 KEY_DOWN_PRESS = 2,
00032 KEY_LEFT_PRESS = 3,
00033 KEY_RIGHT_PRESS = 4,
00034 KEY_ENTER_PRESS = 5,
00035 KEY_EXIT_PRESS = 6,
00036 KEY_UP_RELEASE = 7,
00037 KEY_DOWN_RELEASE = 8,
00038 KEY_LEFT_RELEASE = 9,
00039 KEY_RIGHT_RELEASE = 10,
00040 KEY_ENTER_RELEASE = 11,
00041 KEY_EXIT_RELEASE = 12
00042
00043 } PACKET_KEY_EVENT;
00044
00045
00046
00047 typedef void (* pfnFanReportListener)(void * context,
00048 unsigned int fan_id,
00049 unsigned int rpm);
00050
00051 typedef void (* pfnTempReportListener)(void * context,
00052 unsigned int sensor_id,
00053 double degrees_c);
00054
00055 typedef void (* pfnKeyEventListener)(void * context,
00056 PACKET_KEY_EVENT key_event);
00057
00058
00059
00060 LCD_API int deviceCreate(const char * pszClass,
00061 const char * pszPort,
00062 LPDEVICE * ppDevice);
00063
00064 LCD_API int deviceDispose(LPDEVICE * ppDevice);
00065
00066 LCD_API int deviceStart(LPDEVICE pDevice);
00067
00068 LCD_API int deviceStop(LPDEVICE pDevice);
00069
00070
00071 LCD_API int deviceSetCallbackTemperature(LPDEVICE pDevice,
00072 pfnTempReportListener pfn,
00073 void * context);
00074
00075 LCD_API int deviceSetCallbackFan(LPDEVICE pDevice,
00076 pfnFanReportListener pfn,
00077 void * context);
00078
00079 LCD_API int deviceSetCallbackKeyEvent(LPDEVICE pDevice,
00080 pfnKeyEventListener pfn,
00081 void * context);
00082
00083
00084 LCD_API int deviceSetBacklight(LPDEVICE pdevice,
00085 unsigned int backlightValue);
00086
00087 LCD_API int deviceClear(LPDEVICE pdevice);
00088
00089 LCD_API int deviceSetContrast(LPDEVICE pdevice,
00090 unsigned int contrastValue);
00091
00092 LCD_API int deviceSetLED(LPDEVICE pDevice,
00093 unsigned int led_id,
00094 unsigned int nRed,
00095 unsigned int nGreen,
00096 unsigned int nBlue);
00097
00098 LCD_API int deviceWriteText(LPDEVICE pdevice,
00099 unsigned int x,
00100 unsigned int y,
00101 char * strData,
00102 unsigned int width);
00103
00104 LCD_API int deviceSetTemperatureReporting(LPDEVICE pdevice,
00105 unsigned int mask);
00106
00107 LCD_API int deviceSetFanReporting(LPDEVICE pdevice,
00108 unsigned int mask);
00109
00110 LCD_API int deviceSetFanPower(LPDEVICE pdevice,
00111 unsigned int fan_id,
00112 unsigned int nFanPower);
00113
00114 LCD_API int deviceSetFanFailsafeTimeout(LPDEVICE pDevice,
00115 unsigned int mask,
00116 int milliseconds);
00117
00118
00119
00120 #endif
00121