BL4S100 User’s Manual
52
setDecoder
int setDecoder(int channel_a, int channel_b, int channel_index,
char index_polarity);
FUNCTION DESCRIPTION
Sets up Quadrature Decoder functionality on the specified channels. The Quadrature
Decoder may optionally use an index channel.
PARAMETERS
channel_a
channel to use as Input A (also known as in-phase or I),
0–11 (pins IN0–IN11)
channel_b
channel to use as Input B (also known as quadrature or Q),
0–11 (pins IN0–IN11)
channel_index
channel to use as index input (-1 if not used),
0–11 (pins IN0–IN11)
NOTE:
The Quadrature Decoder count may still be reset by existing or new synch signals
set up on the same block of a particular RIO chip.
index_polarity
polarity of the index channel
(not used when channel_index set to -1)
0 — index on low level
non-zero — index on high level
RETURN VALUE
0 — success.
-EINVAL
— invalid parameter value.
-EACCESS
— resource needed by this function is not available.
SEE ALSO
brdInit, getCounter, resetCounter