aboutsummaryrefslogtreecommitdiffstats
path: root/cphidgetled.h
diff options
context:
space:
mode:
Diffstat (limited to 'cphidgetled.h')
-rw-r--r--cphidgetled.h55
1 files changed, 34 insertions, 21 deletions
diff --git a/cphidgetled.h b/cphidgetled.h
index e9ec6fe..ddce0e5 100644
--- a/cphidgetled.h
+++ b/cphidgetled.h
@@ -36,20 +36,7 @@ typedef enum {
* @param count The led count.
*/
CHDRGET(LED,LEDCount,int *count)
-/**
- * Gets the brightness of an LED.
- * @param phid An attached phidget LED handle.
- * @param index The LED index.
- * @param brightness The LED brightness (0-100).
- */
-CHDRGETINDEX(LED,DiscreteLED,int *brightness)
-/**
- * Sets the brightness of an LED.
- * @param phid An attached phidget LED handle.
- * @param index The LED index.
- * @param brightness The LED brightness (0-100).
- */
-CHDRSETINDEX(LED,DiscreteLED,int brightness)
+
/**
* Gets the current limit. This is for all ouputs.
* @param phid An attached phidget LED handle.
@@ -74,17 +61,39 @@ CHDRGET(LED,Voltage,CPhidgetLED_Voltage *voltage)
* @param voltage The Output Voltage.
*/
CHDRSET(LED,Voltage,CPhidgetLED_Voltage voltage)
-
-//Only exposed in debug library for now
-#if !defined(EXTERNALPROTO) || defined(DEBUG)
+/**
+ * Gets the brightness of an LED.
+ * @param phid An attached phidget LED handle.
+ * @param index The LED index.
+ * @param brightness The LED brightness (0-100).
+ */
CHDRGETINDEX(LED,Brightness,double *brightness)
+/**
+ * Sets the brightness of an LED.
+ * @param phid An attached phidget LED handle.
+ * @param index The LED index.
+ * @param brightness The LED brightness (0-100).
+ */
CHDRSETINDEX(LED,Brightness,double brightness)
+/**
+ * Gets the current limit of an LED.
+ * @param phid An attached phidget LED handle.
+ * @param index The LED index.
+ * @param limit The LED current limit (0-80 mA).
+ */
CHDRGETINDEX(LED,CurrentLimitIndexed,double *limit)
+/**
+ * Sets the current limit of an LED.
+ * @param phid An attached phidget LED handle.
+ * @param index The LED index.
+ * @param limit The LED current limit (0-80 mA).
+ */
CHDRSETINDEX(LED,CurrentLimitIndexed,double limit)
-#endif
#ifndef REMOVE_DEPRECATED
DEP_CHDRGET("Deprecated - use CPhidgetLED_getLEDCount",LED,NumLEDs,int *)
+DEP_CHDRGETINDEX("Deprecated - use CPhidgetLED_getBrightness",LED,DiscreteLED,int *brightness)
+DEP_CHDRSETINDEX("Deprecated - use CPhidgetLED_getBrightness",LED,DiscreteLED,int brightness)
#endif
#ifndef EXTERNALPROTO
@@ -96,6 +105,7 @@ DEP_CHDRGET("Deprecated - use CPhidgetLED_getLEDCount",LED,NumLEDs,int *)
#define LED64_CONTROL_PACKET 0x40
#define LED64_OUTLOW_PACKET 0x80
#define LED64_OUTHIGH_PACKET 0xc0
+
#define LED64_M3_OUT_LOW_PACKET 0x00
#define LED64_M3_OUT_HIGH_PACKET 0x20
#define LED64_M3_CONTROL_PACKET 0x40
@@ -103,8 +113,10 @@ DEP_CHDRGET("Deprecated - use CPhidgetLED_getLEDCount",LED,NumLEDs,int *)
//IN Packet Types
#define LED64_IN_LOW_PACKET 0x00
#define LED64_IN_HIGH_PACKET 0x80
+
#define LED64_M3_IN_LOW_PACKET 0x00
-#define LED64_M3_IN_HIGH_PACKET 0x40
+#define LED64_M3_IN_HIGH_PACKET 0x20
+#define LED64_M3_IN_MISC_PACKET 0x40
//Flags
#define LED64_PGOOD_FLAG 0x01
@@ -116,7 +128,7 @@ DEP_CHDRGET("Deprecated - use CPhidgetLED_getLEDCount",LED,NumLEDs,int *)
#define LED64_OE_FLAG 0x40
//M3 LED64
-#define LED64_M3_CURRENTLIMIT 80 //80 mA fixed TODO: make sure this is right!
+#define LED64_M3_CURRENTLIMIT 80 //80 mA max
struct _CPhidgetLED
{
@@ -133,6 +145,7 @@ struct _CPhidgetLED
unsigned char changeRequests;
double LED_PowerEcho[LED_MAXLEDS];
+ double LED_CurrentLimitEcho[LED_MAXLEDS];
unsigned char outputEnabledEcho[LED_MAXLEDS];
unsigned char ledOpenDetectEcho[LED_MAXLEDS];
unsigned char powerGoodEcho;
@@ -141,7 +154,7 @@ struct _CPhidgetLED
CPhidgetLED_Voltage voltageEcho;
CPhidgetLED_CurrentLimit currentLimitEcho;
- unsigned char TSDCount, TSDClearCount, PGoodErrState;
+ unsigned char TSDCount[4], TSDClearCount[4], TWarnCount[4], TWarnClearCount[4], PGoodErrState;
unsigned char controlPacketWaiting;
unsigned char lastOutputPacket;