summaryrefslogtreecommitdiff
path: root/src/drivers
Commit message (Collapse)AuthorAge
...
* altos: Add ao_lco_two.c; alternate LCO interface codeKeith Packard2016-04-19
| | | | | | | | The LCO interface is likely to end up very device specific as the interactions depends on the input devices. Here's a version for TeleLCOTwo, which has two arming switches and a firing button. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Allow for pad boxes with different sensor configurationsKeith Packard2016-04-19
| | | | | | | | This allows for a pad box without a resistor from power to each FET. That resistor is needed to detect welded relays, but in a solid-state system, that's not a possibility. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add pad support for new telefire versionsKeith Packard2016-04-19
| | | | | | | | | | | | Makes the voltage divider values configurable, and allows for pyro channels that don't have the resistors necessary to check for a stuck relay. Also supports STM32L processors with wider GPIO registers, and uses the new ao_gpio_set/clr_bits functions to fire igniters rather than cc1111-specific code. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Support telefire products in cc1200 driverKeith Packard2016-04-19
| | | | | | Need to disable the pad code while testing the radio. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/detherm: Add servo driverKeith Packard2016-04-13
| | | | | | This just provides commands to test the servo with. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/detherm: Add ms5607 to dethermKeith Packard2016-04-13
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/chaoskey: Add another USB endpoint to read raw dataKeith Packard2016-03-02
| | | | | | | | | | | This replaces having the single output switch based on a pin value and allows us to box the device and still fetch raw data. For now, this will use a special libusb2 program, ao-chaosread, to pull bits as I haven't figure out how to make linux provide two /dev entries for one USB device. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add simple stats test to TRNG codeKeith Packard2016-02-07
| | | | | | | This detects broken hardware by making sure the standard deviation in the raw values used to compute each buffer is at least 128. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Delay TRNG ADC long enough for HV supply to stabilizeKeith Packard2016-02-07
| | | | | | | Looks like it takes about 70ms for the supply to start running right, so delay after powering it up for that long. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add power management to TRNG driverKeith Packard2016-02-07
| | | | | | | Support suspend/resume of the TRNG power supply, delaying after resume to wait for it to stabilize. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/chaoskey: Delay ADC reading for 250ms at startupKeith Packard2016-01-28
| | | | | | This lets the HV supply stabilize before we start sampling values. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/chaoskey: Add support for flipping between raw and cooked bitsKeith Packard2016-01-28
| | | | | | | | Plug the 'force bootloader' thing onto the board while it's running and it will generate raw bits instead of running them through the CRC to whiten. Useful for validating the raw hardware. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add TeleMega v2.0, including PWM driverKeith Packard2015-12-25
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* telelco: Fix pad reset to one on radio signal lossKeith Packard2015-10-13
| | | | | | | The pad number was getting reset back to one when signal was lost, causing pad one to get fired in this case even when already set to arm mode. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/telelco: Adjust drag race UIKeith Packard2015-10-13
| | | | | | | | | Enter/leave drag race is done by rotating the box selector knob to a new 'dr' position and then holding down the firing button; this avoids a potential accidental firing if you somehow don't realize you've armed the box before selecting drag race mode. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/telelco: Add drag race UIKeith Packard2015-08-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | With the unit disarmed, press and hold the fire button for five seconds to enable drag race mode. The display will show 'dr' for five seconds and beep five times to indicate that drag race mode is enabled. The decimal points in the display will all be displayed as an additional visual aid. Once every five seconds, it will beep. With drag race mode enabled, you can select a box/pad pair and press the 'fire' button to add it to the drag race group. For the current box, all members of the drag race group will have their continuity LEDs blink slowly. There will be no indication of continuity in this mode; you'll want to check that before enabling drag race mode. If you want to de-select a member of the group, just press the fire button again. Each time you push the fire button, it will beep out the pad number added or removed. Arm the box and you will not be able to add or remove members from the drag race group. Firing will simultaneously fire all members of the drag race group. To disable drag race mode, press and hold the fire button for two seconds. It will beep twice and turn off the decimal points in the display. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/telelco: Infrastructure changes for drag racingKeith Packard2015-08-29
| | | | | | | This makes the lco management code support arming multiple pads and firing all of them at once. The UI code does not expose this yet. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Provide direct segment driving interface for LCD displaysKeith Packard2015-08-29
| | | | | | | This exposes a simple bit-mask for setting the seven segments instead of just allowing hex-decimal values. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/telefire: No reply for ARMED. Ignore time for FIRE.Keith Packard2015-08-29
| | | | | | | This will let us do drag races by letting the LCO arm multiple boxes and fire them all with a single command. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add HAS_COMPANION to new boards with companion connectorsKeith Packard2015-08-20
| | | | | | | | | | | Thanks much to Rob Derstadt for discovering this bug! TeleMetrum v2.0, TeleMega, EasyMega, TeleBalloon v2.0 all have companion connectors and yet HAS_COMPANION was not defined. This disabled companion telemetry packets on these products, but otherwise didn't have any effect. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/telelco: Show box voltage with pad knob instead of firing buttonKeith Packard2015-05-25
| | | | | | | | Turn left past '1' and see the firing box battery voltage instead of pushing the firing button with the box disarmed. This seems like a safer UI. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/telelco: Display telefire battery voltageKeith Packard2015-05-25
| | | | | | | When the firing button is pressed while unarmed, show the telefire battery voltage in the display. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add telelco v0.3 (v0.2 with cc1200 instead of cc1120)Keith Packard2015-05-25
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* telefire: Report telefire battery voltage over telemetry linkKeith Packard2015-05-25
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* telefire: Make 'good' RSSI value configurableKeith Packard2015-05-24
| | | | | | | | Different radios will have different 'good' RSSI values, so let each product configure it, leaving the default set to -90dBm, which is a solid signal value for the CC1111. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Support 32MHz xtal on cc1200Keith Packard2015-05-19
| | | | | | | I ended up building some cc1200-based boards with 32MHz xtals, so just make this an option when building the driver. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Have fast ADC ring buffer code use wrap-aroundKeith Packard2015-03-20
| | | | | | | | | Instead of requiring that the whole set of returned values fit precisely in the ring, allow for wrap-around so that we can fetch an odd number of ADC values. The previous version required that the fetch amount always be a factor of the ADC buffer size. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/test: Make aprs test code compile againKeith Packard2015-03-10
| | | | | | Adding the compressed/uncompressed config option broke the APRS test harness. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Wait for BT disconnect before sending commandKeith Packard2015-03-02
| | | | | | | | | | | If AltosDroid manages to connect to the BT module before we've configured it, we won't be able to talk to it as we can't force the module to ignore connection attempts. Wait for AltosDroid to give up and let us configure the device. Eventually, we'll manage, if AltosDroid's delay interval is longer than the time it takes to configure the unit. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Make APRS format (compressed/uncompressed) configurableKeith Packard2015-03-02
| | | | | | | | This provides a choice of compressed vs uncompressed when sending APRS packets to deal with receivers that still do not have support for the more useful compressed format. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/usbtrng: Split out random number generating code to separate driverKeith Packard2015-02-28
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add chaoskey flash loaderKeith Packard2015-02-28
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Remove some accidental debug printfs from ao_packet.cKeith Packard2015-02-15
| | | | | | | While fixing the cc1200 configuration, I added some debug printfs to this code. They were accidentally committed with the fix... Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/cc1200: Adjust bit-sync configurationKeith Packard2015-02-14
| | | | | | | | | | | | | The default bit timing adjustment mechanism allows for only a 0.2% deviation from the programmed bit timing. I found one TeleMini device which is beyond that tolerance as it was built with an older crystal with more error. Switch to the more expensive synchronization mechanism which allows up to 2% timing error, but requires a multi-byte preamble (which we have). This fixes packet mode nicely. 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: ao_packet_getchar needs to return 'int' so AO_READ_AGAIN worksKeith Packard2015-02-07
| | | | | | | | | With ao_packet_getchar returning 'char', AO_READ_AGAIN would get converted to 0xff instead of -1 on return, making ao_packet_echo either produce a bogus character on output, breaking command responses, or wedge and never exit when the link was dropped. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/drivers: Increase SPI speed of CC115L to 6MHzKeith Packard2015-02-07
| | | | | | The datasheet says that the maximum for back-to-back data is 6.5MHz. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/btm: Add fancier debug. Pull serial reset port low.Keith Packard2015-02-01
| | | | | | | | | | | Adds an interactive debugging mode to help diagnose BTM issues. Discovered that the serial reset pin on the BTM needs to be pulled low for the device to work correctly. Leave the bt link interrupt disabled until things are initialized. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add support for TeleBT v3.0Keith Packard2015-01-24
| | | | | | | Add support to the BTM driver for non-CC1111 interrupts Add HW flow control to STM serial driver Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Adjust CC1200 RSSI reporting valueKeith Packard2014-12-22
| | | | | | | | | On the test setup, we were about 13dB off, so tweak the settings to suit. This result wasn't tested; it's just a rough offset until we get a production run of TeleDongle boards back to do more systematic measurements. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Document cc115l power measured at RF setting 0x03 as -31.75dBmKeith Packard2014-12-22
| | | | | | | | We built a custom TeleGPS load for radio sensitivity measurements with the lowest documented power level setting (0x03), and measured the power out at that value of -31.75dBm on the test board. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/cc1200: With PQT wide open, we can't use PQT_REACHED for startKeith Packard2014-11-23
| | | | | | | | | Because we're allowing even signals only weakly correlated with the preamble through to sync detection, we can't use the PQT_REACHED symbol to tell when a packet header has been seen. Instead, just look for SYNC_FOUND. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/cc1200: Open up preamble detect to improve sensitivityKeith Packard2014-11-23
| | | | | | | Increase soft decision PQT value to max (15) to ensure that we detect even weak packets. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/cc1200: Wait for packet to be placed in FIFO during receiveKeith Packard2014-11-23
| | | | | | | | | | | | | This changes the receive code to use MCU_STATUS, waiting for MARC_STATUS1 to indicate that the packet is in the fifo before reading it out. It also fixes the receive timeout code to keep receiving if the preamble or sync have been seen when the timeout fires. This makes TeleLCO able to use short timeouts during scanning while still successfully receiving packets. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Reset interrupt flags before TX in CC1200 driverKeith Packard2014-11-06
| | | | | | | Failing to reset the flags set during interrupt leads to short-circuiting transmission and not a lot of packets going out. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Use AO_SPO_SPEED_FAST for CC1200Keith Packard2014-11-06
| | | | | | | This asks for the fastest available SPI speed, instead of fixing it to 8MHz, which may not be supported on every architecture. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Stop attempting to ramp power on CC115LKeith Packard2014-11-06
| | | | | | | | The PA register on the 115L isn't in any way monotonic, making the old code broken. Just rempve it instead of fixing it; we don't ramp anywhere else... Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Increase CC1200 SPI data rate to 8MHzKeith Packard2014-10-25
| | | | | | | This got set to 125kHz to make debugging with a logic analyzer easier and never changed back to a reasonable speed. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Perform cc1200 calibration less often. Tweak radio paramsKeith Packard2014-10-25
| | | | | | | | | | | This performs calibration after every 4 operations, or when the frequency changes. This reduces the time it takes to get to receive mode. This also makes the sync and preamble qualifiers more strict to reject bad packets. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Increase PQT value for cc1200 improving sensitivityKeith Packard2014-10-25
| | | | | | | | The PQT value indicates how 'good' the preamble is; higher values allow a lower quality of preamble to pass the test, permitting more packets to be decoded. Signed-off-by: Keith Packard <keithp@keithp.com>