|
Typedefs |
typedef struct _CPhidgetEncoder * | CPhidgetEncoderHandle |
Functions |
int | CPhidgetEncoder_create (CPhidgetEncoderHandle *phid) |
int | CPhidgetEncoder_getInputCount (CPhidgetEncoderHandle phid, int *count) |
int | CPhidgetEncoder_getInputState (CPhidgetEncoderHandle phid, int index, int *inputState) |
int | CPhidgetEncoder_set_OnInputChange_Handler (CPhidgetEncoderHandle phid, int(*fptr)(CPhidgetEncoderHandle phid, void *userPtr, int index, int inputState), void *userPtr) |
int | CPhidgetEncoder_getEncoderCount (CPhidgetEncoderHandle phid, int *count) |
int | CPhidgetEncoder_getPosition (CPhidgetEncoderHandle phid, int index, int *position) |
int | CPhidgetEncoder_setPosition (CPhidgetEncoderHandle phid, int index, int position) |
int | CPhidgetEncoder_set_OnPositionChange_Handler (CPhidgetEncoderHandle phid, int(*fptr)(CPhidgetEncoderHandle phid, void *userPtr, int index, int time, int positionChange), void *userPtr) |
int | CPhidgetEncoder_set_OnIndex_Handler (CPhidgetEncoderHandle phid, int(*fptr)(CPhidgetEncoderHandle phid, void *userPtr, int index, int indexPosition), void *userPtr) |
int | CPhidgetEncoder_getIndexPosition (CPhidgetEncoderHandle phid, int index, int *position) |
int | CPhidgetEncoder_getEnabled (CPhidgetEncoderHandle phid, int index, int *enabledState) |
int | CPhidgetEncoder_setEnabled (CPhidgetEncoderHandle phid, int index, int enabledState) |
Detailed Description
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.
Typedef Documentation
Function Documentation
Creates a Phidget Encoder handle.
- Parameters:
-
| phid | A pointer to an unallocated Phidget Encoder handle. |
Gets the number of digital inputs supported by this board.
- Parameters:
-
| phid | An attached phidget encoder handle |
| count | The input count. |
Gets the state of a digital input.
- Parameters:
-
| phid | An attached phidget encoder handle |
| index | The input index. |
| inputState | The input state. Possible values are PTRUE and PFALSE. |
Sets an input change handler. This is called when a digital input changes.
- Parameters:
-
| phid | An attached phidget encoder handle |
| fptr | Callback function pointer. |
| userPtr | A pointer for use by the user - this value is passed back into the callback function. |
Gets the number of encoder inputs supported by this board.
- Parameters:
-
| phid | An attached phidget encoder handle |
| count | The encoder input count. |
Gets the current position of an encoder.
- Parameters:
-
| phid | An attached phidget encoder handle |
| index | The encoder input index. |
| position | The current position |
Sets the current position of an encoder.
- Parameters:
-
| phid | An attached phidget encoder handle |
| index | The encoder input index. |
| position | The new position |
Sets an encoder position change handler. This is called when an encoder position changes.
- Parameters:
-
| phid | An attached phidget encoder handle |
| fptr | Callback function pointer. Note that positionChange is a relative not absolute change and time is the time in ms since the last position change event. |
| userPtr | A pointer for use by the user - this value is passed back into the callback function. |
Sets an encoder index handler. This is called when there is a pulse on the index pin.
- Parameters:
-
| phid | An attached phidget encoder handle |
| fptr | Callback function pointer. This returns the encoder position at which the index pulse occured. |
| userPtr | A pointer for use by the user - this value is passed back into the callback function. |
Gets the position of the last index pulse, as referenced to CPhidgetEncoder_getPosition. This will return EPHIDGET_UNKNOWN if there hasn't been an index event, or if the encoder doesn't support index.
- Parameters:
-
| phid | An attached phidget encoder handle |
| index | The encoder index. |
| position | The index position. |
Gets the enabled state of an encoder. This is whether the encoder is powered or not.
- Parameters:
-
| phid | An attached phidget encoder handle |
| index | The encoder index. |
| enabledState | The enabled state. Possible values are PTRUE and PFALSE. |
Sets the enabled state of an encoder. This is whether the encoder is powered or not.
- Parameters:
-
| phid | An attached phidget encoder handle |
| index | The encoder index. |
| enabledState | The enabled state. Possible values are PTRUE and PFALSE. |