A digital encoder is a rotary control that encodes its output as a sequence of pulses. Generic HID supports rotary encoders that output their movement as incremental quadrature code. Digital Encoders typically have the appearance of a panel mount potentiometer, or a machine control dial.
A Digital Encoder has two outputs, A and B. These make up the "waveform" of a quadrature signal, with the A and B waveforms out of phase by 90°. Only one signal ever changes at a time, and from this, Generic HID can determine if the encoder is moving forward or backward.
Digital encoders must be connected to Interrupt ports, that is, one of PE4..7, PB0..7, PD0..3.
The Generic HID represents the digital encoder as an 8-bit input, with wrap around. This means it will count up to 255, then wrap to 0 (or down to 0, then wrap to 255). It is up to the application using the device to then make use of this information. Hidcomp/hidconfig handles this information correctly.
Care must be taken with the current consumption of digital encoders. The larger industrial encoders can draw 100mA, which can overload a USB device. See the section on USB Power for more information.
There is currently no support for mechanical encoders. Mechanical encoders are a cheaper version of the digital encoders, that generate the A/B signal through mechanical contacts. They need pull-up resistors and debounce code to work correctly.
Components can be given an optional name. This is seen in the Test tab. Not all applications support the name. Hidcomp/hidconfig supports names.
The UsagePage and Usage of the Digital Encoder. See Usages for more information.
The size of the encoder counter in bits. GenericHID supports up to 16 bit numbers meaning they can count from 0 to 216-1 (65535). The counter will wrap around the minimum/maximum values.
Depending on the software reading the values, 8 bits is usually enough.
Defines the amount of electrical current used by the LED in mA. This is used to estimate the USB power draw. See the section on Power for more information. As mentioned above, industrial style dials can use a large amount of current.