Go to the documentation of this file.00001 #ifndef __CPHIDGETLED
00002 #define __CPHIDGETLED
00003 #include "cphidget.h"
00004
00011 DPHANDLE(LED)
00012 CHDRSTANDARD(LED)
00013
00017 typedef enum {
00018 PHIDGET_LED_CURRENT_LIMIT_20mA = 1,
00019 PHIDGET_LED_CURRENT_LIMIT_40mA,
00020 PHIDGET_LED_CURRENT_LIMIT_60mA,
00021 PHIDGET_LED_CURRENT_LIMIT_80mA
00022 } CPhidgetLED_CurrentLimit;
00026 typedef enum {
00027 PHIDGET_LED_VOLTAGE_1_7V = 1,
00028 PHIDGET_LED_VOLTAGE_2_75V,
00029 PHIDGET_LED_VOLTAGE_3_9V,
00030 PHIDGET_LED_VOLTAGE_5_0V
00031 } CPhidgetLED_Voltage;
00032
00038 CHDRGET(LED,LEDCount,int *count)
00039
00040
00045 CHDRGET(LED,CurrentLimit,CPhidgetLED_CurrentLimit *currentLimit)
00051 CHDRSET(LED,CurrentLimit,CPhidgetLED_CurrentLimit currentLimit)
00057 CHDRGET(LED,Voltage,CPhidgetLED_Voltage *voltage)
00063 CHDRSET(LED,Voltage,CPhidgetLED_Voltage voltage)
00070 CHDRGETINDEX(LED,Brightness,double *brightness)
00077 CHDRSETINDEX(LED,Brightness,double brightness)
00084 CHDRGETINDEX(LED,CurrentLimitIndexed,double *limit)
00091 CHDRSETINDEX(LED,CurrentLimitIndexed,double limit)
00092
00093 #ifndef REMOVE_DEPRECATED
00094 DEP_CHDRGET("Deprecated - use CPhidgetLED_getLEDCount",LED,NumLEDs,int *)
00095 DEP_CHDRGETINDEX("Deprecated - use CPhidgetLED_getBrightness",LED,DiscreteLED,int *brightness)
00096 DEP_CHDRSETINDEX("Deprecated - use CPhidgetLED_getBrightness",LED,DiscreteLED,int brightness)
00097 #endif
00098
00099 #ifndef EXTERNALPROTO
00100
00101 #define LED_MAXLEDS 64
00102
00103
00104 #define LED64_NORMAL_PACKET 0x00
00105 #define LED64_CONTROL_PACKET 0x40
00106 #define LED64_OUTLOW_PACKET 0x80
00107 #define LED64_OUTHIGH_PACKET 0xc0
00108
00109 #define LED64_M3_OUT_LOW_PACKET 0x00
00110 #define LED64_M3_OUT_HIGH_PACKET 0x20
00111 #define LED64_M3_CONTROL_PACKET 0x40
00112
00113
00114 #define LED64_IN_LOW_PACKET 0x00
00115 #define LED64_IN_HIGH_PACKET 0x80
00116
00117 #define LED64_M3_IN_LOW_PACKET 0x00
00118 #define LED64_M3_IN_HIGH_PACKET 0x20
00119 #define LED64_M3_IN_MISC_PACKET 0x40
00120
00121
00122 #define LED64_PGOOD_FLAG 0x01
00123 #define LED64_CURSELA_FLAG 0x02
00124 #define LED64_CURSELB_FLAG 0x04
00125 #define LED64_PWRSELA_FLAG 0x08
00126 #define LED64_PWRSELB_FLAG 0x10
00127 #define LED64_FAULT_FLAG 0x20
00128 #define LED64_OE_FLAG 0x40
00129
00130
00131 #define LED64_M3_CURRENTLIMIT 80 //80 mA max
00132
00133 struct _CPhidgetLED
00134 {
00135 CPhidget phid;
00136
00137 double LED_Power[LED_MAXLEDS];
00138 double LED_CurrentLimit[LED_MAXLEDS];
00139 CPhidgetLED_Voltage voltage;
00140 CPhidgetLED_CurrentLimit currentLimit;
00141
00142 double nextLED_Power[LED_MAXLEDS];
00143 double lastLED_Power[LED_MAXLEDS];
00144 unsigned char changedLED_Power[LED_MAXLEDS];
00145 unsigned char changeRequests;
00146
00147 double LED_PowerEcho[LED_MAXLEDS];
00148 double LED_CurrentLimitEcho[LED_MAXLEDS];
00149 unsigned char outputEnabledEcho[LED_MAXLEDS];
00150 unsigned char ledOpenDetectEcho[LED_MAXLEDS];
00151 unsigned char powerGoodEcho;
00152 unsigned char outputEnableEcho;
00153 unsigned char faultEcho;
00154 CPhidgetLED_Voltage voltageEcho;
00155 CPhidgetLED_CurrentLimit currentLimitEcho;
00156
00157 unsigned char TSDCount[4], TSDClearCount[4], TWarnCount[4], TWarnClearCount[4], PGoodErrState;
00158
00159 unsigned char controlPacketWaiting;
00160 unsigned char lastOutputPacket;
00161
00162 } typedef CPhidgetLEDInfo;
00163
00164 #endif
00165
00167 #endif