summaryrefslogtreecommitdiff
path: root/src/drivers
Commit message (Collapse)AuthorAge
* altos: Don't validate ADXL375 self test for maximum valueKeith Packard2018-12-30
| | | | | | | The data sheet says this is unreliable, and that we should be using an FFT anyways. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/adxl375: Clean up initialization, shortening self test periodKeith Packard2018-10-20
| | | | | | | Set the self test period to that suggested in the documentation. Eliminate some debug variables. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add ADXL375 driver [v2]Keith Packard2018-10-19
| | | | | | | Includes self-test code and multi-byte mode operation for reading sample registers. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/drivers: Use stdbool in ao_ms5607.cKeith Packard2018-10-13
| | | | | | We don't have TRUE and FALSE anymore (they were pdclib specific). Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add generic LED driver.Keith Packard2018-10-13
| | | | | | | | | | | This driver uses the generic GPIO functions and allows per-LED port and pin configuration. It supports up to 32 LEDs. Rename SoC-specific LED drivers. Remove enabled parameter to ao_led_init Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Eliminate 'pin' field from GPIO functionsKeith Packard2018-10-13
| | | | | | | This was used with the 8051 bit-addressing mode to provide single-instruction access to GPIO pins. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Use stdbool true/false instead of TRUE/FALSEKeith Packard2018-10-13
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* 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: Remove *_TO_DATA macrosKeith Packard2018-10-13
| | | | | | Now that we don't support 8051, we don't need these Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: use %lu for APRS altitude in sprintfKeith Packard2018-10-13
| | | | | | It's a long. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: sdcc doesn't have 'false' and 'true'.Keith Packard2018-10-02
| | | | | | Use FALSE and TRUE in ms5607.c driver instead. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/drivers: Shrink ao_ms5607.c code to fit on micropeak stillKeith Packard2018-10-02
| | | | | | | Use some code constructs that make the little AVR processor happier and save about 16 bytes of memory. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Remove spurious ao_mma655x_spi_index variableKeith Packard2018-08-15
| | | | | | This isn't used; was probably included for debugging at some point. 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: Make fewer LCO variables publicKeith Packard2018-07-04
| | | | | | | The lco common code doesn't need to share its internal values with the world; make most of them static. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Make LCO search directly drive pad/box displaysKeith Packard2018-07-04
| | | | | | Don't use ao_lco_show as that has other logic too. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Fix LCO display while searchingKeith Packard2018-07-04
| | | | | | Use lower level functions to control the display more directly Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Fix telelcotwo build for new ao_lco_bits.c fileKeith Packard2018-07-04
| | | | | | Lots of code motion; shouldn't have any functional changes. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: A bit more LCO code sharingKeith Packard2018-07-03
| | | | | | Missed drag race pad toggling in ao_lco_v2.c Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Share common LCO functions in ao_lco_bits.cKeith Packard2018-07-03
| | | | | | | Move common code out of ao_lco.c and ao_lco_v2.c into a shared file, ao_lco_bits.c. Update ao_lco.h to include shared functions. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/ao_pad: Move LED test to the monitor taskKeith Packard2018-06-17
| | | | | | | It sets the LEDs, so it's best to not start doing that until we've tested them. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/ao_pad: Turn on all LEDs for a moment at power upKeith Packard2018-06-17
| | | | | | Allow validation of all LED connections. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/ao_pad: Use AO_LED_TYPE for computing active LEDs.Keith Packard2018-06-17
| | | | | | instead of uint8_t 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/telelco-v0: Test display, show batt voltage at bootKeith Packard2018-06-17
| | | | | | Just like telelco v2 Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/telelco: Remove STATIC_TEST code from stand-alone LCO boxesKeith Packard2018-05-31
| | | | | | | This command conflicts with the 'debug' command in these devices and so wasn't usable anyways. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/telefire*: Do voltage tests in decivolts instead of ADC unitsKeith Packard2018-05-31
| | | | | | | | | | This requires that each pad device specify the ADC reference voltage and all relevant voltage divider resistor values explicitly so that the ADC values can be converted to decivolts and compared with one another. This should be easier to understand in the future when reading the code. 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>
* altos/ao_button.c: Support up to 16 buttonsKeith Packard2018-05-28
| | | | | | TeleLCO v2.0 has more than 4 Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/drivers: Pads with multi-port firing and pad selector DIP switchKeith Packard2018-05-21
| | | | | | | | | | | TeleFire 8 scrambles GPIOs to make layout cleaner, placing the 8 firing outputs across two GPIO ports. We're also adding an 8-unit selector for box number so that boards can be re-configured in the field. These override any ROM-configuration value; you can select the rom value by setting all switches to 'off'. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/ao_cc1120: Only call ao_packet_slave_stop when HAS_SLAVEKeith Packard2018-03-23
| | | | | | | Don't try to disable packet slave mode when the product doesn't support packet slave mode. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Use double buffering for ChaosKeyKeith Packard2018-01-07
| | | | | | | This improves the USB performance of ChaosKey so that it doesn't NAK during data transfers at all. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/drivers: Hook up mag sensor for MPU9250Keith Packard2017-12-11
| | | | | | | Set mag sensor to provide data at 100Hz. Set i2c master to pull mag data at sample rate (200Hz). Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/drivers: Start adding defines to get mag data out of MPU9250Keith Packard2017-12-05
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add MPU9250 driver (accel/gyro only for now)Keith Packard2017-10-12
| | | | | | | This is almost an exact copy of the MPU6000 driver, just a few minor register changes. Signed-off-by: Keith Packard <keithp@keithp.com>
* chaoskey: Wait for input data to stabilize before using itKeith Packard2017-09-12
| | | | | | | The ADC data takes a while to start working after power on; wait for the range of input values to look reasonable before using the data. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/rn4678: Add BLE supportKeith Packard2017-06-20
| | | | | | This just means ignoring the BLE connect status message. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add timeout to RN4678 status message codeKeith Packard2017-06-13
| | | | | | | | If we see the start of an RN4678 status message, but then output pauses, assume that this isn't the start of a status message and flush the pending data. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: HMC5883 output order is X Z YKeith Packard2017-06-11
| | | | | | | | | | Re-label everything to have the correct names. This doesn't actually change the code at all, so the eeprom and telemetry is all compatible. Matching changes on the host side will be required to actually process the data correctly, of course. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Update sensor data atomicallyKeith Packard2017-06-11
| | | | | | | | | | | Read data into a temp variable, block interrupts, then update the published value. The bug is easy to see with the HMC5883 which has to byte-swap the output of the chip, and hence can occasionally get caught with the wrong byte order data. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/ao_rn4678: Send '$$$' for new devices. Fix name setting code.Keith Packard2017-05-15
| | | | | | | | | New devices won't respond to the cmd pin we have configured, so get them to command mode by sending the $$$ string. Somehow I'd botched the name setting code and hadn't caught it as I hadn't tried a new device... Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add RN4678 Bluetooth module driverKeith Packard2017-05-13
| | | | | | | | | This works much like the old BTM module, but supports both bluetooth and bluetooth LE. I've poked at it briefly over BTLE to see that it appears to have the right name, but haven't attempted to communicate over BTLE yet. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/ms5607: Allow applications to not use the normal data ring and threadKeith Packard2017-04-27
| | | | | | | MicroPeak V2 has tasks, but doesn't want to use another thread just for the MS5607. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/ao_pad.c: Use #if HAS_LOG instead of #ifdef HAS_LOGKeith Packard2017-04-24
| | | | | | TeleFire v0.1 defines HAS_LOG to 0. Signed-off-by: Keith Packard <keithp@keithp.com>
* implement static test start and stop protocol for telefiretwo+telebtBdale Garbee2017-04-22
|
* eliminate spurious close bracesBdale Garbee2017-04-22
|
* add static test start and stop commands to radio protocol for telefiretwoBdale Garbee2017-04-22
|
* altos: Document a few more SPI mode bits in VGA driverKeith Packard2017-04-09
| | | | | | Just comment changes Signed-off-by: Keith Packard <keithp@keithp.com>