summaryrefslogtreecommitdiff
path: root/src/cc1111
Commit message (Collapse)AuthorAge
* 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>
* altos: Shrink cc1111/ao_dbg.c a bitKeith Packard2012-11-30
| | | | | | Share code for osequence of ao_dbg_long_delay(); ao_dbg_send_bits() Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Share getnibble functionKeith Packard2012-11-30
| | | | | | | Two implementations of the same function, one in cc1111/ao_dbg.c and the other in core/ao_send_packet.c. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Make TeleBalloon v1.1 build againKeith Packard2012-11-29
| | | | | | This is untested, but at least it builds now Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Leave interrupts disabled while checking for task to runKeith Packard2012-10-26
| | | | | | | Otherwise, we run the risk of an interrupt waking a task after we've decided to idle the CPU. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Clean up cc1111 architecture macros a bit, removing cli/seiKeith Packard2012-10-25
| | | | | | Just reformatting changes, aside from the removal of cli/sei Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add ao_arch_block/release_interrupts to avr and cc1111Keith Packard2012-10-25
| | | | | | Stop using cli/sei for AVR, add replacement to __critical for cc1111 Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/telefire: Add siren/strobe supportKeith Packard2012-10-10
| | | | | | | This also involved hacking up the code to allow for non-zero offsets for the pad firing and continuity pins. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Need to use 16-bit counts for ao_xmem functionsKeith Packard2012-09-14
| | | | | | | | | Trying to use 8-bit counts is a nice optimization which fails when the count is larger than 255, as is the case with clearing the flash block in the AT45 driver. This bug resulted in the inability to erase flights on TeleMetrum v1.0 boards. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Wait for IN dma complete on slave SPI sendKeith Packard2012-08-29
| | | | | | | SPI send double buffered, so the DMA completes one byte too early. Use the recv DMA to know when the SPI transfer is complete. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Mostly working SPI radio linkKeith Packard2012-08-28
| | | | | | | | This includes long delays to avoid overrunning the cc1111 input, otherwise it works pretty well. The delays mean that we can't capture the reply to a cmac command though, so more work is needed. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: When sharing radio DMA for AES, use it for in instead of outKeith Packard2012-08-28
| | | | | | | | | We look at the out_done value, but not the in_done value; if we use the radio DMA for out, we would have to use ao_radio_dma_done to check for completion. This way, we can ignore that value and use the existing ao_aes_dma_out_done value. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Fix ao_delay function and move from per-chip code to ao_task.cKeith Packard2012-08-28
| | | | | | | ao_delay hasn't been chip-specific for a long time, and it had a bug in not calling ao_clear_alarm. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Clean up radio APIsKeith Packard2012-08-27
| | | | | | | Move api to ao_radio_cmac.h include file. Expose ao_radio_test as standard API. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: More SPI slave changes for cc1111 driverKeith Packard2012-08-27
| | | | | | Don't enable DMA in the other direction when doing slave transfers. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add SPI slave get/put macros to cc1111Keith Packard2012-08-27
| | | | | | Theese don't try to drive the chip select line Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Allow sharing of radio DMA with aes engineKeith Packard2012-08-26
| | | | | | otherwise, telefire doesn't have enough DMA channels. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Make cc1111 SPI pins configurableKeith Packard2012-08-24
| | | | | | | Allow either USART in any configuration. Still only supports one SPI bus though. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Disable telefire 'pad' listener when testing radioKeith Packard2012-08-24
| | | | | | | Ensures that the radio testing won't block waiting for a firing mode packet to arrive. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/cc1111: Document SPI bus pin optionsKeith Packard2012-08-18
| | | | | | Just a comment in the source code about which pins each option selects. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Oops. Serial 1 stdin was busted by typoKeith Packard2012-08-07
| | | | | | | | | | A typo in the symbol used to enable stdin wakeups from serial1 caused the input to pend until some other wakeup occurred. This also makes the serial1 hw flow control pin selects in config 2 work right, although those aren't used by any current product Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Build ao_kalman.h from cc1111 subdirs as neededKeith Packard2012-08-05
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* src/cc1111: Enable SPI slave modeKeith Packard2012-08-05
| | | | | | This is untested... Signed-off-by: Keith Packard <keithp@keithp.com>
* src/cc1111: Allow serial0 without serial1Keith Packard2012-08-05
| | | | | | The ao_serial_speed structure is needed by serial0 too. Signed-off-by: Keith Packard <keithp@keithp.com>
* src/cc1111: Add ao_gpio_set macroKeith Packard2012-08-05
| | | | | | Allows general GPIO-using code to run on cc1111 Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add telefire-v0.1Keith Packard2012-07-29
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/cc1111: Fix serial 0 option 2 pins definitionsKeith Packard2012-07-29
| | | | | | tx/rx are 4/5, rts/cts are 2/3 Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Place STM config values at fixed addresses for re-useKeith Packard2012-07-17
| | | | | | | | Just like cc1111, stick the serial number and radio calibration values at known fixed addresses so that when re-flashing the board, we can go find the existing values. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Make ao_tick_count visibleKeith Packard2012-07-16
| | | | | | | Necessary to fetch it when interrupts are already disabled as we can't call ao_time then. Signed-off-by: Keith Packard <keithp@keithp.com>