summaryrefslogtreecommitdiff
path: root/src/drivers
Commit message (Collapse)AuthorAge
...
* 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>
* altos: Drive row low instead of high in matrix driverKeith Packard2017-04-09
| | | | | | Driving it high won't work all that well as we're looking for zero bits. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Place AS1107 in 'normal' mode at end of init sequenceKeith Packard2017-04-09
| | | | | | | This makes sure the device is out of reset mode while initializing, and then placed in normal mode to turn on the display. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Allow programs to enable SDCARD debugging if desiredKeith Packard2017-04-04
| | | | | | Provides for per-application control over SDCARD debugging Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Disable FAT commands unless requestedKeith Packard2017-04-04
| | | | | | This are debugging commands; don't provide them unless requested Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Define CC115L spi speed in each productKeith Packard2017-04-04
| | | | | | | Different SoCs have different SPI speeds available; have each product specify the speed to use instead of trying to use 4Mhz everywhere. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Allow buttons to be high when pressed rather than lowKeith Packard2017-04-02
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: add button matrix driverKeith Packard2017-04-02
| | | | | | Scans the matrix once per clock tick queuing events for changed keys. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add AS1107 LED display driverKeith Packard2017-04-02
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add console driver using VGA and PS/2Keith Packard2017-02-20
| | | | | | Provides an interactive text console. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add PS/2 keyboard driverKeith Packard2017-02-20
| | | | | | Interrupt driven, includes standard US keymap. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add VGA driver for STM32L processorsKeith Packard2017-02-20
| | | | | | | Generates vsync/hsync using timers and pixel data using the SPI port. 320x240 video using 640x480 mode and a 24MHz "pixel" clock. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Require SPI speed to be declared for cc1200Keith Packard2017-02-20
| | | | | | | The cc1200 can't run SPI faster than 10MHz, so make sure every device picks a SPI clock slower than that. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/arm: Align data so that gcc 5.4 doesn't do byte-accesses. Add -Wcast-alignKeith Packard2016-12-17
| | | | | | | | | | | | | | | | | | | | | | Gcc 5.4.1 tracks alignment of data through assignments, so that a uint32_t pointer which comes from byte-aligned uint8_t data: extern uint8_t foo[]; uint32_t *q = (void *) foo; Fetches and stores through this pointer are done bytewise. This is slow (meh), but if q references a device register, things to bad very quickly. This patch works around this bug in the compiler by adding __attribute__((aligned(4))) tags to some variables, or changing them from uint8_t to uint32_t. Places doing this will now be caught as I've added -Wcast-align to the compiler flags. That required adding (void *) casts, after the relevant code was checked to make sure the compiler could tell that the addresses were aligned. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/cc1120: remove unused status from ao_radio_fifo_write_stopKeith Packard2016-08-29
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Use standard FIPS testing for chaoskeyKeith Packard2016-08-02
| | | | | | | Check to make sure we aren't repeating a block coming from the unwhitened source, which is the standard online FIPS test for RNGs. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Make telelcotwo control two boxes instead of two padsKeith Packard2016-08-02
| | | | | | | | telefiretwo is now a single pad box, so telelcotwo needs to switch between boxes instead of pads on the same box. Do this by re-purposing the pad arming switches into a box selector and arming switch. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add 'ao_button_get' to button driverKeith Packard2016-08-02
| | | | | | | This returns the current state of the button; useful to check what the value is at startup. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Expose cc1200 radio test functions for telemini bringupKeith Packard2016-07-27
| | | | | | | | This exposes the cc1200 radio test function so we can load special test firmware in telemini to do the radio cal as it has no USB to perform that interactively. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Don't access cc1120 SPI bus during recv after abort has startedKeith Packard2016-07-27
| | | | | | | | | | When the receive timeout happens, the radio may still interrupt while the SPI bus is getting shut down. If this happens, the interrupt handler shouldn't touch the SPI bus at all as it may well be turned off, which would cause the receive function to wedge waiting for a spi byte transfer to happen. 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: Use FIFO_THR pin for cc1120 transmit bufferingKeith Packard2016-06-29
| | | | | | | Instead of reading NUM_TXBYTES, set the FIFO_THR pin to indicate when 64 bytes are available in the buffer. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: cc1200: use FIFO threshold pin output for APRS bufferingKeith Packard2016-06-29
| | | | | | | | | | Instead of polling the device for fifo space, just use the available pin configuration to figure out if there is enough space for a single APRS buffer. Then set the APRS buffer size to match the fifo threshold setting in the chip so that we know we can write the whole APRS buffer once the pin says there's space. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/drivers: Use more reliable byte interface for CC1120 receptionKeith Packard2016-06-29
| | | | | | | This replaces direct register access with function calls to allow that code to respect the hardware requirements. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/cc1115l: Reduce trace buffer sizeKeith Packard2016-06-10
| | | | | | A 32-element trace buffer is all the larger we can fit in teledongle. Signed-off-by: Keith Packard <keithp@keithp.com>
* altosuilib: Fill preload map on site or lat/lon changeKeith Packard2016-05-27
| | | | | | | | This loads the map view with the selected area when the site entry is changed or the user hits return in the lat/lon fields. This lets you see the target launch site without having to load the whole preload set. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Clear packet queue when starting packet masterKeith Packard2016-04-25
| | | | | | | | This avoids overfilling the packet buffer when disconnected. Applications using packet mode shouldn't expect that output be saved across master sessions. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/telelcotwo: Add idle timeoutKeith Packard2016-04-19
| | | | | | | | Puts TeleLCOTwo in a low power state (drawing about 80µA) after a timeout (default two minutes) to keep from killing the battery if the device is left turned on. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Use simpler debounce logic for buttonsKeith Packard2016-04-19
| | | | | | | | | | | Instead of waiting for a while after the transition to decide if it has stuck, signal the event right away and then ignore other transitions for the debounce interval. This seems to work just as reliably, but has the benefit of eliminating button latency at press time. Signed-off-by: Keith Packard <keithp@keithp.com>