summaryrefslogtreecommitdiff
path: root/src/stm/stm32l.h
Commit message (Collapse)AuthorAge
* altos: get ao_max6691 driver workingKeith Packard2019-04-21
| | | | | | | | | | | | | | | | | | The driver uses a timer connected to a DMA engine to measure pulse widths from the chip. We get 11 pulses for 4 channels; the first pulse is caused by the timer starting up, the next two are the marker pulse and then 8 more indicating the end of the high and low periods for each channel. The driver API returns the 8 pulse widths; the caller is expected to know what to do with those values as using them requires knowing the value of the configuration resistor and the characteristics of the thermistors. The test code assumes a 1k configuration resistor, using that it computes the resistance of the four thermistors. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Work on MAX6691 driverKeith Packard2019-04-21
|
* altos: Fix ISR declarations to make them non-weakKeith Packard2019-02-21
| | | | | | | | | | In my zeal to eliminate warnings, I added declarations of all ISR functions to a shared header file. However, I managed to include the 'weak' declaration, which meant that the intended ISR functions were as weak as the 'default' ISR functions. This left all interrupts non-functional, which doesn't make for a happy program. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Declare all public functions in header filesKeith Packard2019-02-18
| | | | | | | Including interrupt vectors to catch mis-spellings. Working toward supporting -Wmissing-prototypes Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Make beeper driver support all possible tim234 configsKeith Packard2018-10-19
| | | | | | And update all users to be explicit about the desired config. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Define ADC channels for TEMP and V_REFKeith Packard2018-06-17
| | | | | | These are fixed at 16 and 17. Signed-off-by: Keith Packard <keithp@keithp.com>
* stm: Add more mask-based GPIO controlsKeith Packard2017-04-04
| | | | | | | Lets cortexelf do more things with groups of pins, rather than one pin at a time. Signed-off-by: Keith Packard <keithp@keithp.com>
* stm: Add a few more GPIO functions to make dealing with the 1802 easierKeith Packard2017-04-03
| | | | | | ao_gpio_set_mask and ao_gpio_get_all Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Add nvic priority register fields. Add more TIM234 defines.Keith Packard2017-02-20
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/arm: Align data so that gcc 5.4 doesn't do byte-accesses. Add -Wcast-alignKeith Packard2016-12-17
| | | | | | | | | | | | | | | | | | | | | | Gcc 5.4.1 tracks alignment of data through assignments, so that a uint32_t pointer which comes from byte-aligned uint8_t data: extern uint8_t foo[]; uint32_t *q = (void *) foo; Fetches and stores through this pointer are done bytewise. This is slow (meh), but if q references a device register, things to bad very quickly. This patch works around this bug in the compiler by adding __attribute__((aligned(4))) tags to some variables, or changing them from uint8_t to uint32_t. Places doing this will now be caught as I've added -Wcast-align to the compiler flags. That required adding (void *) casts, after the relevant code was checked to make sure the compiler could tell that the addresses were aligned. 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 more SPI status register bitsKeith Packard2016-06-29
| | | | | | These weren't the original version of the docs that we had. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add ao_gpi_set/clr_bits functionsKeith Packard2016-04-13
| | | | | | These set or clear a group of bits in a single GPIO register all together. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Get stm32l pwm driver workingKeith Packard2015-12-25
| | | | | | | | | | | | | Fix the CCMR1_OC1PE and CCMR2_OC3PE values. Disable clock when no PWM outputs are running. Fix the apb1enr value for the timer. Set ARR value to PWM_MAX - 1 -- ARR is off by one. Sets the GPIO pins to 40MHz bandwidth for sharper edges. Tested on EasyMega, but that code is not included as it breaks the companion protocol. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Fix typo in stm32l.hKeith Packard2015-01-26
| | | | | | This crept in while working on the stmf0 bits. oops. Signed-off-by: Keith Packard <keithp@keithp.com>
* ao-tools: Add --wait option to ao-usbloadKeith Packard2015-01-25
| | | | | | | This waits forever for USB writes to complete, instead of timing out after five seconds. Useful when debugging the device. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Use #define'd constants for GPIO register addressesKeith Packard2014-05-12
| | | | | | | This lets the compiler short-circuit the tests in ao_enable_gpio and ao_disable_gpio to save a bit of code space and time. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Figure out available flash space based on chip id registersKeith Packard2014-05-12
| | | | | | | Look at the flash size and the device id registers to figure out how much flash is available. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Clean up -Wextra warningsKeith Packard2013-12-20
| | | | | | | Unused variables, mismatching signed/unsigned and a few other misc warnings. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Initial TeleMetrum v2.0 bitsKeith Packard2013-08-27
| | | | | | | Adds new telemetry and logging formats along with code for TeleMetrum v2.0 design. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add fast-timer API. Use for quadrature and button driversKeith Packard2013-06-09
| | | | | | | This splits the fast-timer portion out of the debounce helper code and shares that with the quadrature driver which now uses it directly. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add program flash functionKeith Packard2013-05-07
| | | | | | | | And get it loaded to RAM so it can execute correctly. Nothing calls it yet... Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Use SYSTICK on STM32LKeith Packard2013-05-07
| | | | | | | It's probably more power efficient than using one of the timers, and it's certainly easier to configure. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Add more bits to NVIC register definitionsKeith Packard2013-02-24
| | | | | | This cleans up a few values, adds more comments and a few more NVIC fields. 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: Add stack-guard code. Uses STM MPU to trap stack overflow.Keith Packard2012-10-25
| | | | | | | | This marks the lowest portion of the stack as inaccessible to the CPU, causing the processor to fault when it reaches it. The fault then generates a panic message so that the user can know what happened. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: profiling on STM32LKeith Packard2012-10-25
| | | | | | Add sample-based profiling, using a 1kHz timer Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Enable STM SYSCFG when routing EXTIKeith Packard2012-08-28
| | | | | | | The EXTI routing information is in the syscfg unit, so that needs to be powered up or writes to its registers will be lost. 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: 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: 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: 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: 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: Add register definitions for STM syscfg and usbKeith Packard2012-04-14
| | | | 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: 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: 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: Add DMA, SPI and MS5607 driversKeith Packard2012-04-06
| | | | 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>
* Add defines for LCD controller and RTC clockingKeith 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>
* 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>
* Add STM platform and stm-bringup demo programKeith Packard2012-03-28
The stm-bringup doesn't run altos, it just initializes the device and writes stuff over a serial port. Works on the STM32L Discovery board at least, should do stuff on other boards too. Signed-off-by: Keith Packard <keithp@keithp.com>