summaryrefslogtreecommitdiff
path: root/src/stm
Commit message (Collapse)AuthorAge
* altos: Move common build definitions to src/Makefile.defsKeith Packard2019-02-18
| | | | | | | | This cleans up the build process for all architectures, providing a common place to specify vpath, cflags and build rules for various common files. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add -Wshadow to CFLAGSKeith Packard2019-02-18
| | | | | | And fix up the related messages. Signed-off-by: Keith Packard <keithp@keithp.com>
* stm: Expose LCD font API in ao_lcd_font.hKeith Packard2019-02-18
| | | | | | | That required renaming the existing LCD font defintions from ao_lcd_font.h to ao_lcd_font_bits.h. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add a pile more compiler warningsKeith Packard2019-02-18
| | | | | | | | | | | Adds: -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Declare task stack as union of uint8_t and uint32_tKeith Packard2019-02-18
| | | | | | | Support -Wcast-align and -Wpointer-arith while still allowing architectures to pick whether they want an 8-bit or 32-bit stack. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Remove unused ao_adc_get from ao_adc_stm.cKeith Packard2019-02-18
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add 'void' to function declarations with no params.Keith Packard2019-02-18
| | | | | | Support -Wstrict-prototypes 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: Mark local functions 'static'Keith Packard2019-02-18
| | | | | | Working towards supporting -Wmissing-prototypes Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Note that ao_i2c_recv_dma_isr isn't actually usedKeith Packard2019-02-18
| | | | | | | | | This function resets the i2c transceiver after DMA completes, but it hasn't ever been hooked up. Some testing would be a good idea. For now, just add a comment and mark the function as referenced to avoid a compiler warning. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Support SPI modes other than 0Keith Packard2018-10-19
| | | | | | ADXL375 requires SPI mode 3. 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: Create ao_data_fill shared functionKeith Packard2018-10-19
| | | | | | | This fills a data ring entry with all of the current sensor values other than the ADC. It is used in all of the adc completion functions. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Clean up AO_ROMCONFIG bitsKeith Packard2018-10-13
| | | | | | | Remove address parameter (doesn't work with gcc), create shared ao_romconfig in kernel. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add generic LED driver.Keith Packard2018-10-13
| | | | | | | | | | | This driver uses the generic GPIO functions and allows per-LED port and pin configuration. It supports up to 32 LEDs. Rename SoC-specific LED drivers. Remove enabled parameter to ao_led_init Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Eliminate 'pin' field from GPIO functionsKeith Packard2018-10-13
| | | | | | | This was used with the 8051 bit-addressing mode to provide single-instruction access to GPIO pins. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Use stdbool true/false instead of TRUE/FALSEKeith Packard2018-10-13
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Make cmd number parsing functions return valueKeith Packard2018-10-13
| | | | | | Don't use a global variable to hold the result. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Remove 8051 address space specifiersKeith Packard2018-10-13
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Switch to newlib-nano for libc on armKeith Packard2018-10-13
| | | | | | Stop using pdclib Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Make flash loader work with either 8MHz or 16MHz xtalKeith Packard2018-10-13
| | | | | | Provide PLL definitions for both values. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Allow timer interrupt without needing tick countKeith Packard2018-08-15
| | | | | | | This saves a bit of space in the fox1ihu loader which uses the timer interrupt to poke the watchdog. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Let products override AO_LED_TYPE for stm processorsKeith Packard2018-06-17
| | | | | | No need requiring it to be uint16_t 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>
* altos/stm: Remove unused ADC names from ao_adc_single_stm.cKeith Packard2018-06-17
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Enable HSI timer when HAS_ADC_SINGLE is setKeith Packard2018-05-28
| | | | | | The ADC unit always uses the HSI timer. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Add polling ADC sampler APIKeith Packard2018-05-28
| | | | | | | This just fetches ADC values on demand instead of loading them periodically into a ring buffer from the timer interrupt. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Add per-LED port/pin mode in LED codeKeith Packard2018-05-16
| | | | | | | | | If you've got a complicated LED pin arrangement, you can ask for each one to be configured separately, instead of using groups in a couple of GPIO registers. The code isn't as efficient this way, but at least it's easy to read. Signed-off-by: Keith Packard <keithp@keithp.com>
* Remove ao_radio_cal from stm products without radiosKeith Packard2018-04-26
| | | | | | Products without a radio don't need this value. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/flash-loader: On STM, don't include ao_usb_disableKeith Packard2018-04-26
| | | | | | This saves a bit of space, keeping the flash loader under 4k on fox Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Simplify ao_usb_write a bitKeith Packard2018-04-26
| | | | | | | Remove unnecessary 'offset' param (was always passed zero). This also makes some code conditional on that value no longer necessary. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Align 'data' to 8 bytes, just like textramKeith Packard2017-12-12
| | | | | | | | | | | | | | The textram section must be aligned to 8 bytes to keep the linker happy. However, if that section contains no data, the declaration will set the __data_start__ value to that alignment, but the data section itself would start on a 4-byte alignment, potentially 4 bytes lower than the value indicated by __data_start__. This completely scrambles initialized memory as the startup code will copy the data segment to __data_start__, 4 bytes off of the actual data segment start. Fix this by forcing the data segment to also be aligned to 8 bytes. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Actually store current MPU9250 data in data ringKeith Packard2017-12-11
| | | | | | | The ring is updated when the ADC finishes; all of the other sensor data needs to be copied in at that point. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Allow building with newlib + avr stdio on ARMKeith Packard2017-12-11
| | | | | | | Redefines some stdio bits so that we can build with either pdclib or newlib + avr stdio. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/cortexelf-v1: Adapt to lisp->scheme name changeKeith Packard2017-12-05
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Add AO_EXTI_MODE_PULL_NONEKeith Packard2017-11-11
| | | | | | This is clearer than using '0'. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: whitespace cleanup in ao_adc_stm.cKeith Packard2017-11-11
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Initialize UART RTS/CTS before turning it onKeith Packard2017-06-27
| | | | | | If you try this after the UART is running, it won't work. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Make CDC ACM 'line coding' publicKeith Packard2017-05-04
| | | | | | This allows other systems to see what baud rate the host has requested. 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: add button matrix driverKeith Packard2017-04-02
| | | | | | Scans the matrix once per clock tick queuing events for changed keys. Signed-off-by: Keith Packard <keithp@keithp.com>
* stm: Use common flash wait loop instead of inliningKeith Packard2017-04-02
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* cortexelf-v1: Use new memory map to access all flash and ram. Add fat.Keith Packard2017-04-02
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Add draw and lisp to make search paths.Keith Packard2017-02-20
| | | | 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/stm: Make i2c code handle PCLK1 of 24MHzKeith Packard2017-02-20
| | | | | | Just adds the necessary defines to the code. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Allow DMA channels to be hijacked by other codeKeith Packard2017-02-20
| | | | | | | This lets code which needs finer control over DMA to use the channel without interference, and leaves the DMA engine running so that it can. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Allow use basepri instead of primask for masking interruptsKeith Packard2017-02-20
| | | | | | | | | | | | This allows for high priority interrupts (priority 0) to run, even when other interrupts are blocked. Code executing in such interrupt handlers must not attempt to control task execution as that will race with the scheduler. Select this by defining AO_NONMASK_INTERRUPT in ao_pins.h. non-maskable interrupt priority is AO_STM_NVIC_NONMASK_PRIORITY Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Interrupt priority is in the upper bits of the priority maskKeith Packard2017-02-20
| | | | | | | | | | Because the STM32L only offers 16 priority levels, the bottom four bits of each priority mask are not used. All of the interrupt priority settings in the system were using values < 16, making them all effectively the same. Fix that by moving them into the upper 4 bits and using symbolic constants everywhere. Signed-off-by: Keith Packard <keithp@keithp.com>