summaryrefslogtreecommitdiff
path: root/src/drivers/ao_quadrature.c
Commit message (Collapse)AuthorAge
* altos: Make cmd number parsing functions return valueKeith Packard2018-10-13
| | | | | | Don't use a global variable to hold the result. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Remove 8051 address space specifiersKeith Packard2018-10-13
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Fetch current quadrature status at startup timeKeith Packard2018-07-04
| | | | | | | This avoids having the state appear to change the first time we look at the device. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/driver: Improve quadrature debouncing for mechanical encodersKeith Packard2018-06-17
| | | | | | | Track state of encoder better and only bump values when the full motion is detected (all four states). Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/driver: Add support for one-step-per-click quadrature encoderKeith Packard2018-05-28
| | | | | | | The mechanical encoders go through all four steps per click while the optical ones have a single step per click. Support both kinds. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/drivers: Make quadrature debounce longer by default. Fix state trackingKeith Packard2018-05-28
| | | | | | | | | This increases the default debounce time for quadrature encoders to 30ms, which cleans up the mechanical encoders on TeleLCO v0.2. Also change state tracking to explicitly check for expected state values to avoid mis-triggering. Signed-off-by: Keith Packard <keithp@keithp.com>
* Switch from GPLv2 to GPLv2+Keith Packard2016-07-12
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Make quadrature debounce per-pin rather than per-deviceKeith Packard2014-05-15
| | | | | | | Debouncing per-pin means we don't lose transitions, which makes counting a lot more precise. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Simplify quadrature trackingKeith Packard2014-05-09
| | | | | | | | | | | | Set the timer to 200Hz for a 5ms debounce interval. Then, simply look for transitions ending in both bits in the encoder being off, which indicates the the encoder is resting in a detent. If bit '2' is turning off, the encoder was rotated clockwise, otherwise the encoder was rotated counter clockwise. This is a lot more reliable, although still not perfect. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add fast-timer API. Use for quadrature and button driversKeith Packard2013-06-09
| | | | | | | This splits the fast-timer portion out of the debounce helper code and shares that with the quadrature driver which now uses it directly. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add debounce helper. Use in button and quadrature drivers for TeleLCOKeith Packard2013-06-09
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Test multiple quadrature devices. Export quadrature count.Keith Packard2012-08-27
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add button driver and event queueKeith Packard2012-08-06
| | | | | | | With this, a single task can wait for any button or quadrature input device. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Support multiple quadrature encoders.Keith Packard2012-08-06
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Fix up quadrature driverKeith Packard2012-08-06
| | | | | | Mostly works now, should work reliably with a bit of input filtering. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add quadrature driverKeith Packard2012-08-06
Signed-off-by: Keith Packard <keithp@keithp.com>