summaryrefslogtreecommitdiff
path: root/src/stm
Commit message (Collapse)AuthorAge
...
* altos: Provide interface for STM LCD driver.Keith Packard2012-08-27
| | | | | | | | This provides a simple function interface for driving the LCD segments in the STM chip. It also uses the update complete interrupt to block LCD users during flush. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Trigger sample complete when all data are readyKeith Packard2012-08-26
| | | | | | | This has each sensor mark a bit in the current data record which is then sent for processing when all of the data are present. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Shrink STM stack sizeKeith Packard2012-08-26
| | | | | | 512 bytes should be enough for anybody. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Allow STM SPI bus on multiple pin setsKeith Packard2012-08-18
| | | | | | | | This allows multiple STM pin groups to be used for each SPI bus. Useful for the MS5607 sensor which signals conversion complete on the MISO line. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add button driver and event queueKeith Packard2012-08-06
| | | | | | | With this, a single task can wait for any button or quadrature input device. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add ao_gpio_get and ao_exti_set_modeKeith Packard2012-08-06
| | | | | | Needed to support general GPIO interrupts Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add driver for STM internal flashKeith Packard2012-07-29
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add software AES implementationKeith Packard2012-07-29
| | | | | | This is untested 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>
* src: Add explicit 'pin' argument to ao_enable_outputKeith Packard2012-07-14
| | | | | | | This lets the cc1111 use the atomic bit operation instead of a mask, which is immune to interrupt issues as well as being a shorter code sequence. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Expose ao_gpio_set which sets a specific GPIO pinKeith Packard2012-07-14
| | | | | | Will need versions for other architectures Signed-off-by: Keith Packard <keithp@keithp.com>
* stm: running out of memory in MM -- reduce stack to 668 bytesKeith Packard2012-07-14
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Force STM stack to start at the top of RAMKeith Packard2012-07-14
| | | | | | | Using a fixed size means crashing if there's not enough space for that, or wasting memory if there's too much. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Increase default STM stack to 648 bytesKeith Packard2012-06-27
| | | | | | | 512 seems cozy given the printf implementation we're using and the extensive interrupts. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Clean up STM I2C clock computationsKeith Packard2012-06-27
| | | | | | Fix both clock time and rise time. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: get MPU6000 I2C link working reliablyKeith Packard2012-06-27
| | | | | | | | | | This slows the i2c bus to 100kHz (yuck), sets the rise time to spec (it was way off) and adds more delays during bus setup. I've run this for hours now without trouble. Will try to adjust things back to fast mode and see if I can make that work as 100kHz isn't fast enough to reliably get data at 100 samples/sec. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: reorder stm USB state stores to avoid racesKeith Packard2012-06-27
| | | | | | | | | | | | | Must set ao_usb_in_pending before telling USB about new data or an interrupt could arrive at the wrong time to clear it. Same for ao_usb_in_flushed. Without these changes, I've seen the USB bus lock up on occasion, waiting for an IN packet to consume data, but with no IN data pending in the hardware. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: include targe SPI speed in get requestKeith Packard2012-06-27
| | | | | | | STM needs it to be provided when enabling the SPI device, so just fix AVR and cc1111 to do the same. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Wait for i2c START condition before setting interrupt bitsKeith Packard2012-06-27
| | | | | | | | This seems better than the random loop that it replaces, but I still have no idea why this is required; it doesn't coorespond to the docs at all... Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: stm i2c debug code was calling flush() even when disabledKeith Packard2012-06-27
| | | | | | | | | The fancy stm i2c debugging code had calls to flush() that were invoked outside of the conditionals leading to all kinds of fun -- flush() may re-enable interrupts, yield or do all kinds of wacky stuff, none of which is appropriate from the middle of a device driver Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: mpu6000 requires a delay during startKeith Packard2012-06-27
| | | | | | | I have no idea why this is required, but the mpu6000 will not come up and run if this isn't present. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Create a 32-bit 1MHz timer for use in profiling executionKeith Packard2012-06-26
| | | | | | | This provides a simple method for getting high-resolution timer data to use in performance tuning code. It's not used by default anywhere. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Optimize FEC encode and decodeKeith Packard2012-06-26
| | | | | | | | | | | | | Integrate interleaving, CRC and padding within the decode/encode functions. Provide for ISR priorities so that the 1120 RX interrupt takes precedence over the other interrupts or we risk losing bits. Optimize the viterbi decoder a bit (goes from 10ms per packet to 7ms per packet). Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Clean up usage of port parametersKeith Packard2012-06-26
| | | | | | | | Make stm port parameters always be pointers; this avoids the confusion where some macros took '&port' and others took a bare 'port', and also unifies code to run on other processors in a consistent fashion. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Get cc1120 packet reception workingKeith Packard2012-06-25
| | | | | | Interrupt-per-bit, but it seems to work Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Crank down STM SPI speed for MMKeith Packard2012-06-21
| | | | | | | | The cc1120 is noisy enough to break SPI data transfers at 4MHz, so crank things down to 1MHz. It's "stable" now, but clearly needs a filter and shorter traces. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add full MM telemetryKeith Packard2012-06-21
| | | | | | | | Create two new telemetry packets to hold all of the MM data. This patch also splits the telemetry structures out of ao.h Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Configure STM LCD driver for giant LCD digitsKeith Packard2012-06-21
| | | | | | These devices require static mode. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: hack STM serial number to 58Keith Packard2012-06-17
| | | | | | otherwise altosui won't record telemetry Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Be more careful about register save/restore in ao_yieldKeith Packard2012-06-17
| | | | | | | Make sure the general registers are all saved before messing with any of them. Then, explicitly use r0 to save/restore apsr and primask. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Reduce STM SPI data rate to 4MHzKeith Packard2012-06-15
| | | | | | cc1120 doesn't want more than 6.1MHz, otherwise it gets very angry. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Intgrate hmc5883 sensor into adc ringKeith Packard2012-06-02
| | | | | | | Creates a task to poll the mag sensor and place the data into the sensor data ring. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Reset i2c controller at boot timeKeith Packard2012-06-02
| | | | | | In case it's wedged. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Fix broken EXTI edge mode selections. Clear pending exti on enableKeith Packard2012-06-02
| | | | | | | | | Make sure the edge mode registers are set according to the requested mode. Clear any pending interrupt when enabling to avoid spurious isr call Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Route correct GPIO line to interrupt controllerKeith Packard2012-06-02
| | | | | | | Which GPIO a particular pin interrupt comes from is selected by the SYSCFG EXTICR registers; set these when an exti interrupt is configured. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add support for MegaAccel daughter card.Keith Packard2012-06-01
| | | | | | | | | Switches all acceleration computation to using the MegaAccel accelerometer to ensure support for high-g flights. MPU6000 values continue to be logged as normal Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Timers clock base depends on perhipheral bus prescalers tooKeith Packard2012-06-01
| | | | | | | | For some weird reason, a non-unity perhipheral bus clock scaler affects the base of the various timers; this left the 100Hz tick running at 200Hz. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Clear stm i2c transfer timeout alarmKeith Packard2012-05-28
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Make telemetrum-v1.1 compile with new ao_data structureKeith Packard2012-05-27
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Don't start ADC ring until the other sensors have a valid valueKeith Packard2012-05-27
| | | | | | Yes, this is still an ugly kludge, but it's easy. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Data packet tick count does not live in adc structureKeith Packard2012-05-27
| | | | | | It was moved to the global structure. Having two is confusing. Signed-off-by: Keith Packard <keithp@keithp.com>
* Get megametrum ready to at least log flight dataKeith Packard2012-05-25
| | | | | | Doesn't track flight state changes correctly. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: stm: pass DMA buffer index to DMA completion callbackKeith Packard2012-05-07
| | | | | | This lets the user know which DMA has finished. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: stm: delay during USB config with pull-up offKeith Packard2012-05-07
| | | | | | | This makes sure that a reboot will reliably cause the device to disconnect from the USB bus. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: stm: share i2c_stop code between send and recvKeith Packard2012-05-07
| | | | | | | This waits for the stop signal to appear on the bus, necessary before starting another transaction. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: stm i2c DMA for large recv appears to workKeith Packard2012-05-06
| | | | | | | | Transaction appears to be clean on the i2c bus now; correct number of bytes received, and the nack and stop at the right time. This tests > 2 length reads; should try that too. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: STM i2c work.Keith Packard2012-05-06
| | | | | | | Start now driven by interrupts Send now done with DMA and interrupts Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add STM I2C recv and stop funcsKeith Packard2012-04-25
| | | | | | Recv doesn't appear to work with more than one byte Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Oopsed the STM DMA channels for I2C1Keith Packard2012-04-25
| | | | | | TX is 6, RX is 7 Signed-off-by: Keith Packard <keithp@keithp.com>