summaryrefslogtreecommitdiff
path: root/src/cc1111
Commit message (Collapse)AuthorAge
* altos: Make CDC ACM 'line coding' publicKeith Packard2017-05-04
| | | | | | This allows other systems to see what baud rate the host has requested. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Move old AO_LAUNCH defines to cc1111/ao_launch.hKeith Packard2017-04-22
| | | | | | These were getting accidentally used by ao_pad.c Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/cc1111: Remove unneeded initialization in ao_timer.cKeith Packard2017-02-20
| | | | | | | | The timers are all stopped when the chip boots, so no need to stop them. This saves some text space, allowing the current code to (just barely) fit. 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>
* Switch from GPLv2 to GPLv2+Keith Packard2016-07-12
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/cc1111: Remove 'show tasks' commandKeith Packard2016-06-30
| | | | | | This saves space on cc1111 parts. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/cc1111: Use SW to drive UART RTS pinKeith Packard2016-05-09
| | | | | | Can't get the hw to work. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add ao_gpi_set/clr_bits functionsKeith Packard2016-04-13
| | | | | | These set or clear a group of bits in a single GPIO register all together. 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: Declare port register type only in arch headerKeith Packard2014-11-06
| | | | | | | Instead of defaulting to 8 bits, explicitly require declaration of the type of the port register for each architecture. 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>
* cc1111: Wait for internal flash write to completeKeith Packard2014-08-17
| | | | | | This ensures that we don't try to start another write too soon. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Use 32-bits for flight state data (alt/speed/accel)Keith Packard2014-07-10
| | | | | | | Stores 32-bits for all of the flight parameters. Uses 64-bit intermediates for kalman computation. 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/cc1111: Add 2400 and 9600 baud telemetry rate supportKeith Packard2014-07-05
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/cc1111: Adjust receive parameters to improve sensitivityKeith Packard2014-07-05
| | | | | | | | | | This removes the packet quality test and carrier sense tests when deciding whether to start decoding a packet. This lets more bad packets through, but the CRC check catches those and now we're regularly receiving packets down to -110 or even -112 dBm. Before this change, we'd rarely see packets as low as -105dBm Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Call ao_telemetry_reset_interval when telemetry rate changesKeith Packard2014-07-05
| | | | | | | This lets the radio code adjust the telemetry packet sending pattern when the data rate changes. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Report total available log space in version commandKeith Packard2014-06-10
| | | | | | | | This provides a more accurate means of determining available log space than guessing whether some portion of the flash chip holds configuration data. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/cc1111: Add support for CPU-driven USB pullupKeith Packard2014-05-15
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/cc1111: Errata fix isn't needed for discontinued productsKeith Packard2014-05-13
| | | | | | And, doesn't fit in memory for some of them, so don't compile it. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/cc1111: Wait for xtal to be stableKeith Packard2014-05-13
| | | | | | | Errata http://www.ti.com/lit/er/swrz022c/swrz022c.pdf says that the xtal is stable bit is bogus and that you need to just delay for a while. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add configurable beep toneKeith Packard2014-05-02
| | | | | | | | | | This lets you directly set the mid-range beep tone; the high and low tones remain set off of that in the same ratio as before. Note that none of the cc1111 products get this feature as they don't have enough flash space anymore... Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Report battery voltage instead of S at startupKeith Packard2014-04-05
| | | | | | | This works on everything with a beeper except TeleMetrum v1.0 which just doesn't have enough flash space for the code. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Rename 'core' to 'kernel'Keith Packard2014-04-05
| | | | | | | core remains a bad name to use -- dirvish skips files (and directories, it seems) with that name. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Expose ao_usb_running globallyKeith Packard2014-02-18
| | | | | | This lets other bits of the code know when USB has been connected. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Oops. Was only filling out part of the TeleMetrum ADC recordKeith Packard2013-12-08
| | | | | | | | Because it's missing a return, we'd end up filling out one element of the ADC record per interrupt, and rotating through which one was set, hitting all of the even offsets within the struct. Yikes! Signed-off-by: Keith Packard <keithp@keithp.com>
* src/cc1111: Turn off RC osc after xtal is runningKeith Packard2013-12-07
| | | | | | | There's no reason to keep running the RC oscillator after we switch to the crystal, so turn it off. Signed-off-by: Keith Packard <keithp@keithp.com>
* Add --with parameters to configure for compiler selectionnew-stateKeith Packard2013-10-08
| | | | | | | | This allows the user to specify which compiler to use for each target CPU. Also checks to make sure the arm compiler supports -m0 and -m3 cpu type flags. The build now actually uses the specified compilers too. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Don't use ao_data on cc1111 projectsteleminiKeith Packard2013-08-26
| | | | | | | | cc1111 ao_adc.c supplies the needed globals at this point, and linking both into the program leads to two different versions of each at different addresses (yay SDCC linker!) Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Check for MS5607 MISO low before sleepingKeith Packard2013-08-26
| | | | | | | If the MISO line goes low before we manage to configure the interrupts, we'll miss it entirely unless we check the pin explicitly. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/cc1111: Wake up non-ADC sensor code each timer tickKeith Packard2013-08-26
| | | | | | Make sure the MS5607 code gets told to sample every tick Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/cc1111: Leave pin interrupts completely disabled at init timeKeith Packard2013-08-26
| | | | | | | Don't even turn in the PICTL bits as that seems to cause the chip to be unhappy. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Get telemini to copy current MS5607 state to ring.Keith Packard2013-08-26
| | | | | | | The ADC code is responsible for actually inserting the non-ADC data into the ring, so do the copy there. Signed-off-by: Keith Packard <keithp@keithp.com>
* cc1111: Hacky pin interrupt support. Only useful for TeleMini v2Keith Packard2013-08-26
| | | | | | This code is designed to support the MS5607 MISO interrupt bits. Signed-off-by: Keith Packard <keithp@keithp.com>
* cc1111: Rework ADC configuration a bit, fix Tm V2 ADC usageKeith Packard2013-08-26
| | | | | | | The Tm v2 ADC code was not actually fetching and storing the ADC conversion values. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/teletiny-v2.0: Support multiple SPI busses on CC1111Keith Packard2013-08-25
| | | | | | Needed for TeleMini v2.0 Signed-off-by: Keith Packard <keithp@keithp.com>
* Initial TeleMini bitsKeith Packard2013-08-25
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/cc1111: Fetch RSSI for TeleFire from correct byteKeith Packard2013-06-19
| | | | | | Reading the status byte doesn't provide very useful RSSI info Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add telefire v0.2 supportKeith Packard2013-06-09
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/cc1111: Hack on USB driver to make Windows happyKeith Packard2013-05-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Windows modem driver is quite chatty at startup time, getting and setting the comm parameters each time the device is opened. Sometimes, when setting the parameters, the cc1111 would STALL EP0. Most of the time, Windows would happily pass this as an error back to AltosUI which would then re-try the open (and succeed, most of the time). Sometimes, Windows would stall for 30 seconds before passing the error back. This made the whole UI freeze, and I suspect most people assumed our app had died. A bit of analysis with the beagle USB sniffer and I discovered the STALL settings, but there wasn't any correlation between the data on the wire and when the STALL would be generated. So, I found a couple of other cc1111 USB stacks on the net and just looked to see how our driver differed. There wasn't anything clearly related, but there were a list of small differences: 1) Other drivers didn't bother waiting for the hardware to ack the USBADDR setting; doing it this way means we can set the address *before* acking the setup packet. It'll get set eventually, at which point the device will start responding to packets again. Easy to fix, and saves a bit of code space too. 2) The other drivers set the STALL bit for setup packets which aren't understood. This shouldn't have any effect on 'good' systems as those shouldn't ever be generating bogus setup packets anyways. The driver already handled the STALL state in the interrupt handler, the only requirement was to figure out when to explicitly set the STALL bit. That required moving the state updating code from the start of the ep0 setup handling to the end, after the setup packet had been examined and data queued in or out as appropriate. 3) Our driver explicitly queued an IN packet for any setup request that wasn't waiting for an OUT pack. This appears to tie in with the USBADDR change above as before I made that change, this change caused the driver to fail to respond to most setup packets. This was simple once the above change was made, just move the generation of the IN packet inside the code that switched to the IN state. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Open up the DVGA gain to use all of the available settingsKeith Packard2013-05-07
| | | | | | | We usually work in RF quiet areas; let the AGC hardware try all of the available gain settings. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Compute "real" RSSI value in radio code as neededKeith Packard2013-05-07
| | | | | | | | | Instead of dragging around the weird CC1111 RSSI values, just compute a dBm value in a signed 8-bit integer, ao_radio_rssi. Use that everywhere we need RSSI internally. We leave the weird CC1111 value in the packet reply as that's what the host expects. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Provide timeout value to ao_radio_recvKeith Packard2013-05-07
| | | | | | | | | Instead of using ao_alarm around calls to ao_radio_recv, provide an explicit timeout value as needed by radio functions with more complicated system interaction than the cc1111. The timeout is 8 bits of clock ticks. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Monitor battery voltage on telebtKeith Packard2013-04-09
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Do not release interrupts from any pollchar functionKeith Packard2013-03-31
| | | | | | | | | | | getchar relies on interrupts being blocked across the pollchar calls and into the sleep call or it may go to sleep with data pending. This prefixes all pollchar functions with _ to indicate that they are to be called with interrupts blocked and eliminates all interrupt manipulation calls from within the pollchar functions. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: fix functions calling pollchar to use 'int' to hold the valueKeith Packard2012-12-07
| | | | | | | | AO_READ_AGAIN doesn't fit in a char anymore now that stdio is 8-bit clean, everyone using pollchar must use an 'int' variable to capture the whole value from pollchar. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add support for 115200 baud serial ratesKeith Packard2012-11-30
| | | | | | Necessary for flashing skytraq chips Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Make stdio 8-bit clean by making pollchar return intKeith Packard2012-11-30
| | | | | | | | | | We were stealing one value (0xff) in the return value from pollchar to indicate 'not ready yet'. Instead of doing that, use the integer value -1 and have pollchar return an int instead of a char. That necessitated cleaning a few other bits to make sure that 0xff wouldn't get promoted to -1 on accident. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Share cc1111 reset/debug-start codeKeith Packard2012-11-30
| | | | | | | These sequences are very similar, differing only in whether the dbg clock line is toggled while holding reset low for a while. Signed-off-by: Keith Packard <keithp@keithp.com>