H = high bits of position (18 in current implementation)
D = direction bits of position (always 2)
L = low bits of position (12 in current implementation)
I = low bits of index (14 in current implementation)
position logic (works when 4096 or fewer counts between polling times):
old-counts: H D L
new-data: D'L'
if(D==b00 && D'==b11) H'=H-1;
if(D==b11 && D'==b00) H'=H+1;
new-counts: H'D'L'
old index logic is just like position logic (works for 4096 or fewer counts)
new index logic (works when 16384 or fewer counts between indexes):
old-index: H I
new-data: I'
candidate-1: H I'
candidate-2: H'I'
if(candidate-1 between old-counts and new-counts)
new-index: candidate-1
else
new-index: candidate-2
XXX how is "between" defined?