summaryrefslogtreecommitdiff
path: root/src/drivers
Commit message (Collapse)AuthorAge
* altos: Integrate BMX160 into data codeKeith Packard2019-09-16
| | | | | | Get conversion functions written and fix up a few warnings Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add bmx160 driverKeith Packard2019-09-16
| | | | | | This just adds the driver, it doesn't hook it up yet Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Replace ao_xmem functions with direct mem callsKeith Packard2019-09-15
| | | | | | We no longer need to wrap these functions Signed-off-by: Keith Packard <keithp@keithp.com>
* drivers: Use 'main_value' instead of 'main'Keith Packard2019-09-15
| | | | | | GCC can emit a warning when programs redefine 'main'. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Use fast timer for buttons instead of edge-triggered ISRKeith Packard2019-08-12
| | | | | | | | | | | | | If the button bounces between the triggering interrupt and the button state check, we could lose the final state change of the button and send an incorrect event to the application. In the worst case, the button would end up in exactly the wrong state, toggling in the wrong direction. Use the fast timer to poll all buttons instead so that there is only one check of each button at each poll interval (instead of the interrupt and the state check). This makes buttons reliably debounced. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Record all failed sensors and report status at power upKeith Packard2019-07-16
| | | | | | | | Use DATA bits to mark which sensors have failed, then report that in beeps at startup time to help diagnose hardware failures while still allowing the board to be used over USB. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Allow ms5607 driver to either set ao_sensor_errors or panicKeith Packard2019-07-15
| | | | | | | | | | Products that want to remain usable (over USB) after a sensor failure don't want to panic when the ms5607 fails, but products with limited ROM space don't want to have extra code to check for the sensor failure and panic. Change the MS5607 driver to allow either option, and then make the micropeak based devices use it. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Don't dump MS5607 eeprom in 'B' commandKeith Packard2019-06-18
| | | | | | MicroPeak v2 now has config stuff where these values get shown Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/micropeak-v2.0: expose log and config commands over USBKeith Packard2019-06-18
| | | | | | This lets AltosUI handle the eeprom data Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Support ao_ms5607_dump when no ms5607 taskKeith Packard2019-06-17
| | | | | | | | | MicroPeak v2.0 has tasking support, but doesn't have a separate ms5607 task. That means the device isn't getting initialized when not running the flight code, so in cmd mode we need to make sure it's initialized, and we also need to actually fetch a value to display. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add preliminary TeleStatic v3.0 codeKeith Packard2019-04-21
| | | | | | | This adds the pin definitions and all of the code except for the ads131a04 driver. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Change MAX6691 driver to run its own threadKeith Packard2019-04-21
| | | | | | | This just captures temp data continuously; it takes 100ms to get the temp data from the sensor, so the maximum rate is around 10 samples/sec. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: get ao_max6691 driver workingKeith Packard2019-04-21
| | | | | | | | | | | | | | | | | | The driver uses a timer connected to a DMA engine to measure pulse widths from the chip. We get 11 pulses for 4 channels; the first pulse is caused by the timer starting up, the next two are the marker pulse and then 8 more indicating the end of the high and low periods for each channel. The driver API returns the 8 pulse widths; the caller is expected to know what to do with those values as using them requires knowing the value of the configuration resistor and the characteristics of the thermistors. The test code assumes a 1k configuration resistor, using that it computes the resistance of the four thermistors. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Work on MAX6691 driverKeith Packard2019-04-21
|
* altos/drivers/ao_led.c: Declare LED port as void * to allow any SoC to use ↵Keith Packard2019-03-12
| | | | | | | | this code The generic LED code needs a generic type for the GPIO port. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: ads124s0x successfully reading dataBdale Garbee2019-02-24
|
* altos: snapshot - working on ads124x0x driverBdale Garbee2019-02-24
|
* altos: ADS124S0X driver compiles nowBdale Garbee2019-02-24
|
* altos: fix ads124s0x data structureBdale Garbee2019-02-24
|
* altos: first cut at ADS124S0X driver interrupt handlingBdale Garbee2019-02-24
|
* altos: Mark local functions 'static'Keith Packard2019-02-18
| | | | | | Working towards supporting -Wmissing-prototypes Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: ADS124S0X driver compiles with initialization code maybe completedBdale Garbee2019-02-17
|
* 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>