summaryrefslogtreecommitdiff
path: root/src/drivers
Commit message (Collapse)AuthorAge
* 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>
* altos: Complete cc1200 driverKeith Packard2014-10-24
| | | | | | | | | | Deal with differences between cc1120 and cc1200, including built-in packet support and various register changes. This now works to send and receive telemetry, as well as send APRS and RDF. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Copy cc1120 driver to cc1200 driver and hack a bitKeith Packard2014-10-05
| | | | | | | | | | The cc1200 is similar to the cc1120, although many registers have changed. This driver can send a bare carrier and an RDF tone, but does not yet receive or transmit telemetry data. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Make sure we drop the SPI mutex when aborting cc1120 recvKeith Packard2014-09-26
| | | | | | | | | | The cc1120 receive code is 'twisty', in that it acquires the SPI mutex in the middle of an interrupt handler so that it can quickly start the radio when the signal comes in. This means we have to be careful to drop that mutex in all paths which leave the receive code, including when the packet receive is aborted mid-way through the process. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Scale packet master receive delay by baud rateKeith Packard2014-09-06
| | | | | | | Increase the time we wait for return packets based on the remote protocol baud rate. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Reduce deviation at 2400/9600 baudKeith Packard2014-09-06
| | | | | | | | | | There's no reason to use 20.5kHz deviation at 2400 and 9600 baud, and if we get a better receiver, we'll want to use narrower deviation to have less bandwidth sucking noise into the radio. The new values are (nominally) 5.125kHz deviation for 9600 baud and 1.5kHz deviation for 2400 baud. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/telefire: Add firing length to manual pad commandKeith Packard2014-09-03
| | | | | | | | This adds an optional length of time (in 1/10s of a second) to the ao_pad_manual function to enable testing of igniters without needing to use TeleLCO. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/telefire,telelco: Add HAS_RADIO_RATE to launch system softwareKeith Packard2014-07-12
| | | | | | | This lets us set the rate to a lower value to improve range. 9600 baud works great; 2400 baud makes the initial search take a long time. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Scale DOP values by 10 in GPS driversKeith Packard2014-07-10
| | | | | | sky traq was scaling by 5, ublox was scaling by 100. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Extend GPS altitudes to at least 24 bits everywhereKeith Packard2014-07-10
| | | | | | | | Telemetry gets a special 'mode' flag indicating that 24-bit data is present; log files get new data and log readers are expected to detect that via the firmware version number. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Rework packet receive for cc1120Keith Packard2014-07-05
| | | | | | | | | | Instead of blocking on PQT, just set up the receiver to start going and when the first bit interrupt comes in, grab the SPI bus if possible and configure it for reception. This improves sensitivity in the radio by a significant amount while making the code conceptually a bit nicer. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add telemetry rate support to CC1120 driverKeith Packard2014-07-05
| | | | | | This supports the new 2400 and 9600 baud rates Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Packet reception tuning for cc1120 driverKeith Packard2014-07-05
| | | | | | | This adjusts the cc1120 receive parameters to increase sensitivity at the expense of reporting many more invalid packets to the UI. Signed-off-by: Keith Packard <keithp@keithp.com>