
TPMC118-SW-95 – QNX6 Neutrino Device Driver
Page 11 of 30
3.3.1 DCMD_TP118_READENC
NAME
DCMD_TP118_READENC – Read encoder value
DESCRIPTION
This devctl function reads the value of a specified encoder channel. A pointer to the callers message
buffer (
TP118_READENC
) and the size of this structure is passed by the parameters
data_ptr
and
n_bytes
to the device.
The
TP118_READENC
structure has the following layout:
typedef struct
{
int
channel;
long
value;
} TP118_READENC, *PTP118_READENC;
channel
This argument specifies the encoder channel that shall be read. Valid values are 1 up to 6.
value
This parameter will return the actual value of the encoder. Before reading encoder values the
channels shall be configured.