server/OLD/device.h

00001 /*
00002  * Copyright Ian Burnett 2005, 2006.
00003  *
00004  * This file is part of Ian's Interactive LCD controller (IILC).
00005  * 
00006  * IILC is free software; you can redistribute it and/or modify it under
00007  * the terms of the GNU General Public License as published by the Free
00008  * Software Foundation; either version 2 of the License, or (at your
00009  * option) any later version.
00010  *
00011  * IILC is distributed in the hope that it will be useful, but WITHOUT
00012  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00013  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00014  * for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License along
00017  * with IILC; if not, write to the Free Software Foundation, Inc.,
00018  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
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 /* __DEVICE_H__ */
00121 

Generated on Mon Jul 17 01:36:11 2006 for IILC by  doxygen 1.4.6