summaryrefslogtreecommitdiff
path: root/src/drivers/ao_hmc5883.c
Commit message (Collapse)AuthorAge
* altos: Mark local functions 'static'Keith Packard2019-02-18
| | | | | | Working towards supporting -Wmissing-prototypes 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: 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>
* Switch from GPLv2 to GPLv2+Keith Packard2016-07-12
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Replace ao_alarm/ao_clear_alarm with ao_sleep_forKeith Packard2015-02-13
| | | | | | | | | | | | | | | | Having arbitrary alarms firing in the middle of complicated device logic makes no sense at all. Therefore only correct use of ao_alarm and ao_clear_alarm was around a specific ao_sleep call, with correct recovery in case the alarm fires. This patch replaces all uses of ao_alarm/ao_sleep/ao_clear_alarm with ao_sleep_for, a new function which takes the alarm timeout directly. A few cases which weren't simply calling ao_sleep have been reworked to pass the timeout value down to the place where sleep *is* being called, and having that code deal with the return correctly. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Clean up some minor warnings from -WallKeith Packard2013-12-20
| | | | | | Unused variables, functions and labels, missing enums in switch. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/driver: Make HMC5883 driver build againKeith Packard2013-02-24
| | | | | | Adapt to changes in OS interfaces Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Go back to recording sensor data in globalsmm-ms5611Keith Packard2012-10-08
| | | | | | | | Instead of trying to get things into the ring from a variety of functions, go back to the simpler method of storing them in globals and having the ADC code just pluck out the most recent values. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Trigger sample complete when all data are readyKeith Packard2012-08-26
| | | | | | | This has each sensor mark a bit in the current data record which is then sent for processing when all of the data are present. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Track missed HMC5883 interruptsKeith Packard2012-06-27
| | | | | | | When it fails to signal conversion complete to the CPU, keep track of that and report it with the rest of the current data. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Clean up usage of port parametersKeith Packard2012-06-26
| | | | | | | | Make stm port parameters always be pointers; this avoids the confusion where some macros took '&port' and others took a bare 'port', and also unifies code to run on other processors in a consistent fashion. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Intgrate hmc5883 sensor into adc ringKeith Packard2012-06-02
| | | | | | | Creates a task to poll the mag sensor and place the data into the sensor data ring. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Get HMC5883 driver limping alongKeith Packard2012-06-02
| | | | | | Not pushing data into the ring yet, but the chip appears to work now. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Try to get hmc5883 workingKeith Packard2012-05-28
| | | | | | No joy yet Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: STM i2c work.Keith Packard2012-05-06
| | | | | | | Start now driven by interrupts Send now done with DMA and interrupts Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add mpu6000 and hmc5883 stubsKeith Packard2012-04-25
No real drivers here yet, just some testing stubs Signed-off-by: Keith Packard <keithp@keithp.com>