From 8f3c91e91b634adaca77dac6cf314445cceefc78 Mon Sep 17 00:00:00 2001 From: Jonathan McCrohan Date: Fri, 19 Oct 2012 19:38:06 +0100 Subject: Imported Upstream version 2.1.8.20120912 --- cphidgetencoder.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'cphidgetencoder.h') diff --git a/cphidgetencoder.h b/cphidgetencoder.h index c706a92..f6168b2 100644 --- a/cphidgetencoder.h +++ b/cphidgetencoder.h @@ -4,7 +4,7 @@ /** \defgroup phidenc Phidget Encoder * \ingroup phidgets - * Calls specific to the Phidget Encoder. See the product manual for more specific API details, supported functionality, units, etc. + * These calls are specific to the Phidget Encoder object. See your device's User Guide for more specific API details, technical information, and revision details. The User Guide, along with other resources, can be found on the product page for your device. * @{ */ @@ -59,6 +59,13 @@ CHDRSETINDEX(Encoder,Position,int position) * @param userPtr A pointer for use by the user - this value is passed back into the callback function. */ CHDREVENTINDEX(Encoder,PositionChange,int time,int positionChange) +/** + * Sets an encoder index handler. This is called when there is a pulse on the index pin. + * @param phid An attached phidget encoder handle + * @param fptr Callback function pointer. This returns the encoder position at which the index pulse occured. + * @param userPtr A pointer for use by the user - this value is passed back into the callback function. + */ +CHDREVENTINDEX(Encoder,IndexChange,int indexPosition) /** * Gets the position of the last index pulse, as referenced to \ref CPhidgetEncoder_getPosition. * This will return EPHIDGET_UNKNOWN if there hasn't been an index event, or if the encoder doesn't support index. @@ -99,6 +106,8 @@ struct _CPhidgetEncoder { void *fptrInputChangeptr; int (CCONV *fptrPositionChange) (CPhidgetEncoderHandle, void *, int, int, int); void *fptrPositionChangeptr; + int (CCONV *fptrIndexChange) (CPhidgetEncoderHandle, void *, int, int); + void *fptrIndexChangeptr; unsigned char inputState[ENCODER_MAXINPUTS]; @@ -110,7 +119,7 @@ struct _CPhidgetEncoder { int indexPosition[ENCODER_MAXENCODERS]; - unsigned char outputPacket[8]; + unsigned char outputPacket[MAX_OUT_PACKET_SIZE]; unsigned int outputPacketLen; } typedef CPhidgetEncoderInfo; -- cgit v1.2.3