summaryrefslogtreecommitdiff
path: root/src/drivers
Commit message (Collapse)AuthorAge
* altos/draw: Add a reasonable API for drawing, add lines.lispKeith Packard2016-11-20
| | | | | | | Also, move the demo drawing into the stm-vga app and out of the vga driver. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Use basepri instead of primask for controlling interruptsKeith Packard2016-11-20
| | | | | | | | | This allows for high priority interrupts (priority 0) to run, even when other interrupts are blocked. Code executing in such interrupt handlers must not attempt to control task execution as that will race with the scheduler. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm-vga: Fix DMA reset to load scanline each timeKeith Packard2016-11-20
| | | | | | | | | | If we load the scanline register while DMA is running, it doesn't actually get reloaded until after the first transfer from the next line, leaving a weird jog in the middle of the screen. Also flip to SPI1, as Bdale is using that on the 1802 board. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm-vga: Implement VGA out from the STM processorKeith Packard2016-11-20
| | | | | | | | | Generates vsync/hsync using timers and pixel data using the SPI port. 320x240 video using 640x480 mode and a 24MHz "pixel" clock. Includes the beginings of rendering code for the frame buffer, including bitblt, solid fill and text with a 5x7 font. 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>
* 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>