summaryrefslogtreecommitdiff
path: root/src/stm/ao_spi_stm.c
Commit message (Collapse)AuthorAge
* altos/stm: Set MISO DMA priority to HIGH to avoid OVRKeith Packard2016-09-03
| | | | | | | | | When the MISO DMA priority is too low, and the processor gets busy, it's possible for SPI input to overrun the processor, which causes the MISO DMA to get out of sync and never finish. Set the MISO DMA priority to HIGH to avoid this. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Create funcs to set SPI DMA parametersKeith Packard2016-09-03
| | | | | | | | Instead of having nearly duplicate versions of the SPI DMA configuration calls, create helper funcs that do most of the work so that the SPI API funcs are shorter and clearer. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Make ao_spi_duplex out pointer constKeith Packard2016-09-03
| | | | | | Provides a bit better typechecking opportunities for this function. 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/stm: Add better byte-level SPI apiKeith Packard2016-06-29
| | | | | | | | This provides inline functions for sending and receiving individual bytes, and setup/finish functions to wrap them in. This make the byte sending respect the SPI hardware interface requirements. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Clean up spi_enable/disable_index functionsKeith Packard2016-06-29
| | | | | | These had an extra level of switch nesting for no good reason. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: move spi execution to common ao_spi_runKeith Packard2016-06-29
| | | | | | | | This regularizes SPI hardware use and ensures that the device is turned off after it has been used and that the status register is back to 'normal' the next time through. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add STM SPI debuggingKeith Packard2016-06-29
| | | | | | | This dumps out the SPI hardware state and history of SPI operations when compiled with -DDEBUG=1. Without that, this patch does nothing. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Change ao_spi_send_sync definition to take const sourceKeith Packard2016-06-29
| | | | | | Provides for a bit better error checking. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Mark STM ao_spi_send as taking const pointerKeith Packard2014-10-24
| | | | | | We don't write to this, so let it be const for type checking 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/stm: Ensure SPI always sends 0xff during receiveKeith Packard2013-03-26
| | | | | | SD cards require 0xff when fetching data Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Set STM GPIO output speed for SPI pins correctlyKeith Packard2013-01-13
| | | | | | | | The GPIO pin settings affect the output impedence, and hence the maximum speed for SPI. Cranking these to suitable values allows SPI to run at full speed. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Set SPI clock high for disabled SPI bussesKeith Packard2012-10-06
| | | | | | | This should avoid an accidental low->high transition when switching between multiple SPI busses. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Clean up SPI pin configuration codeKeith Packard2012-10-06
| | | | | | | Make sure none of the pin configurations are being used at startup time. Split out the pin configuration into separate functions. 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: 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: 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: 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: 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: Starting to write cc1120 driverKeith Packard2012-04-17
| | | | | | | This does "something" in radio test mode, appearing to generate a 730MHz signal. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Increase STM SPI speed to PCLK/4Keith Packard2012-04-09
| | | | | | The pressure sensor seems happy at this speed. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Slow STM SPI down a bit so the MS5607 returns valuesKeith Packard2012-04-09
| | | | | | | It's still not working right, but at least it returns something other than all zeros... Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: STM SPI is not using interrupts itselfKeith Packard2012-04-07
| | | | | | All SPI transfers are done via DMA, so the DMA interrupts suffice. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Disable STM SPI transceiver when idleKeith Packard2012-04-06
| | | | | | Should save a bit of power. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add DMA, SPI and MS5607 driversKeith Packard2012-04-06
Signed-off-by: Keith Packard <keithp@keithp.com>