Basic infrastructure for rotary encoder.