summaryrefslogtreecommitdiff
path: root/src/stm/ao_arch_funcs.h
Commit message (Collapse)AuthorAge
* 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: New GAS version requires flags in APSR assignmentKeith Packard2013-10-08
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lpc, altos/stm: ARM requires ISB after switching stack pointersKeith Packard2013-10-07
| | | | | | | This sticks a barrier in the CPU to prevent using the wrong stack register past the change. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Make sampling profiler work againKeith Packard2013-08-28
| | | | | | | | Disable the separate stack as that means we can't figure out the PC from the timer interrupt. Move ao_idle_loc after the interrupt release so that we see idle tasks correctly. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Grab SPI mutex until MPU6000 I2C mode is disabledKeith Packard2013-05-15
| | | | | | | | If other drivers use the SPI bus, the MPU6000 gets confused as its sitting on the bus looking for I2C messages. Just grab the mutex before the OS is running and hold onto it until the MPU6000 has been initialized. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Don't define task macros when not taskingKeith Packard2013-05-07
| | | | | | The necessary data structures aren't defined in this case. Signed-off-by: Keith Packard <keithp@keithp.com>
* Add STM self-flashing loaderKeith Packard2013-05-07
| | | | | | | This allows the real application to get loaded at 0x2000 and jumps to that at startup time if the boot pin is set appropriately Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Use separate exception stack on STM32LKeith Packard2013-05-07
| | | | | | | | This reserves 512 bytes of memory for a stack, then makes sure that exceptions continue to use that stack while processes use the per-task stack. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Crank fast SPI on STM to 8MHzKeith Packard2013-01-13
| | | | | | | With the GPIO pins set to 10MHz now, we can run SPI at the maximum possible speed (8MHz). 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: 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 stm arch macros a bit.Keith Packard2012-10-25
| | | | | | | Turn a bunch of the macros into inline functions. Clean up the reboot method to use the stm_scb structure. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Declare all SPI bus speedsKeith Packard2012-10-15
| | | | | | Just list them all so users can pick what they like 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 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>
* 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>
* 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: 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: 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: 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: Add support for multiple SPI busses and sharing device driversKeith Packard2012-04-14
| | | | | | | | | | | | | | | | The STM32L151 has several SPI busses, and we want to use more than one, so add a 'bus' parameter to the SPI interfaces. To avoid wasting time on AVR and CC1111 processors which only use one SPI bus, elide those parameters from the actual functions by wrapping them with macros. Configuring chip select is now all macroized so that each chip can have its own version, allowing the STM to share the various SPI device drivers with the cc1111 and avr processors. Note that only the M25 driver has been ported; porting the others is 'trivial', but not necessary at this point. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: add STM I2C driver.Keith Packard2012-04-09
| | | | | | Not well tested yet... Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Allow STM DMA channels to be reserved for one useKeith Packard2012-04-09
| | | | | | | | | This allows a single user of a DMA channel to reserve it for use without needing to lock the mutex; this is required for DMA from the ADC to work on megametrum as it wants to start DMA from an interrupt handler, which cannot block on a mutex. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add support for STM ADCKeith Packard2012-04-07
| | | | | | DMA-based driver for the STM analog to digital converter. 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>
* altos: Move SPI functions to architecture-specific locationKeith Packard2012-04-02
Some architecture specific stuff needs to use core altos code, so create new ao_arch_funcs.h files per architecture that get pulled in at the end of ao.h Signed-off-by: Keith Packard <keithp@keithp.com>