Hi, I've been working to add SAMv7 Qencoder interface and see that Qencoder driver expects QEIOC_POSITION to be int32_t value. The issue is that SAMv7 has 16 bit timer counter interface and the SW extension to 32 bits (by adding adding or subtracting UINT16_MAX+1 when counter matches 0xffff) does not seems to work reliably because sometimes pulses are incremented / decremented not by 1 by the HW.
The question that I have is whether the Qencder position is expected to count to negative values "INT16_MIN, ..., -2, -1, 0, 1, 2, .. INT16_MAX" or position can be in range "0 ... UINT16_MAX" or there are not strict requirements? Best regards, Petro