summaryrefslogtreecommitdiff
path: root/src/stm
Commit message (Collapse)AuthorAge
* altos: Provide ISR-based code paths for SPIserial-at-interruptKeith Packard2012-05-18
| | | | | | | This allows SPI to be entirely interrupt driven, with callbacks for completion. It's not tested yet... 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>
* 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: Correct STM USB driverKeith Packard2012-04-14
| | | | | | | Configure endpoint registers correctly now. Restructure code to make sure we send the right IN packets. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Massive product config cleanupKeith Packard2012-04-14
| | | | | | | | Support multiple serial ports more cleanly Split out parts of ao.h into separate feature header files Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Rework how STM clocks are initialized.Keith Packard2012-04-14
| | | | | | | | | | Clean all of the RCC configuration up after turning on the clocks. Use the MSI clock during initialization to avoid messing around with the HSI clock temporarily. Allow for an external clock on the HSE line. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add STM USB driverKeith Packard2012-04-14
| | | | | | Emulates the usual CDC-ACM device Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add STM ao_arch_reboot implementationKeith Packard2012-04-14
| | | | | | Uses the AIRCR register to force a reset Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add register definitions for STM syscfg and usbKeith Packard2012-04-14
| | | | 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: 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: Make STM clock configuration per-product. Fix 32MHz CPU speedKeith Packard2012-04-09
| | | | | | | | | | This moves all of the STM clock configuration into ao_pins.h so that each product can configure it separately. While doing this, I discovered that the flash memory mode (64-bit, prefetch, latency 1) wasn't actually getting set, which is why the CPU refused to work at 32MHz. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add beeper driver to STM archKeith Packard2012-04-09
| | | | | | Drives the MegaMetrum beeper 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: 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: 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: Use 384 cycle ADC sample timeKeith Packard2012-04-07
| | | | | | This is plenty fast, and provides nice stable readings. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add STM temperature sensor calibration dataKeith Packard2012-04-07
| | | | | | | Each stm32l has two-point factory temperature calibration data. Provide access to that for displaying temperature data. 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: 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: Declare stm DMA address registers as volatile void *Keith Packard2012-04-06
| | | | | | Eliminates a cast when assigning to them. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Disable DMA unit when idleKeith Packard2012-04-06
| | | | | | Should save a bit of power 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>
* altos: Oops. Set per-USART STM baud rate register instead of usart1Keith Packard2012-04-02
| | | | | | | Was accidentally always setting usart1 instead of the per-usart register. Didn't work too well for other usarts... Signed-off-by: Keith Packard <keithp@keithp.com>
* use explicit path not $(HOME) to find ARM toolchain for nowBdale Garbee2012-03-31
|
* Use -Os for STM apps. Fix altos.ld to matchall .rodata* sectionsKeith Packard2012-03-28
| | | | | | | | Without .rodata*, it would stick the flash copy of the data on top of any further .rodata* sections. Fortunately, the linker catches that and complains... Signed-off-by: Keith Packard <keithp@keithp.com>
* Get config stuff hooked up for MegaMetrumKeith Packard2012-03-28
| | | | | | This stubs out enough stuff to let ao_config link and work Signed-off-by: Keith Packard <keithp@keithp.com>
* Use 16-bits for STM32 LED mask. Export serial I/O functionsKeith Packard2012-03-28
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* Clean up STM build by moving common defs to Makefile.defsKeith Packard2012-03-28
| | | | | | Shortens default Makefile a bit Signed-off-by: Keith Packard <keithp@keithp.com>
* Flush LCD changes each time the text is updatedKeith Packard2012-03-28
| | | | | | Rather than requiring the caller to do it. Signed-off-by: Keith Packard <keithp@keithp.com>
* Automatically set ALTERNATE pin mode when setting alternate functionKeith Packard2012-03-28
| | | | | | | When selecting an alternate function, set the pin to alternate mode as well; there's no sense requiring two separate calls everywhere. Signed-off-by: Keith Packard <keithp@keithp.com>
* Allow any STM usart to be used for stdioKeith Packard2012-03-28
| | | | | | | This also adds the alternate pin configurations for the other two usarts Signed-off-by: Keith Packard <keithp@keithp.com>
* Move LCD string output code to ao_lcd_font.cKeith Packard2012-03-28
| | | | | | | It's all very specific to the 14-segment display, so stick it there. Signed-off-by: Keith Packard <keithp@keithp.com>
* Add LCD device driver to STM32L portKeith Packard2012-03-28
| | | | | | | This enables the 6-digit 14-character display on the STM32L discovery board and provides an ascii output to it. Signed-off-by: Keith Packard <keithp@keithp.com>
* Add defines for LCD controller and RTC clockingKeith Packard2012-03-28
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* Actually enable usarts with the new usart codeKeith Packard2012-03-28
| | | | | | | And move USART1 to PB6/PB7 to avoid conflicting with the LCD pins. Signed-off-by: Keith Packard <keithp@keithp.com>
* Clean up multiple serial port support for STM32LKeith Packard2012-03-28
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* Add support for multiple serial ports on STM32LKeith Packard2012-03-28
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* Save/restore PRIMASK register on Cortex-M3Keith Packard2012-03-28
| | | | | | This preserves the interrupt-enabled bit across context switches Signed-off-by: Keith Packard <keithp@keithp.com>
* Fix STM LED driver and blink LEDs on discovery boardKeith Packard2012-03-28
| | | | | | | | This adds a task to blink the LEDs, after first fixing up the LED output code to enable the GPIO and talk to the right pins for the discovery board. Signed-off-by: Keith Packard <keithp@keithp.com>
* Basic OS running on STM32LKeith Packard2012-03-28
| | | | | | This gets stm-demo working Signed-off-by: Keith Packard <keithp@keithp.com>
* Add stm-demo programKeith Packard2012-03-28
| | | | | | This runs AltOS and talks over the serial port. Signed-off-by: Keith Packard <keithp@keithp.com>