summaryrefslogtreecommitdiff
path: root/src/stm
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: add ao_time_ns APIKeith Packard2019-02-25
| | | | | | | This provides nano-second resolution times by reading the systick value (which runs at 250ns ticks on stm). Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Fix several mis-specified time typesKeith Packard2019-02-25
| | | | | | Make sure AO_TICK_TYPE is used "everywhere", instead of uint16_t or other. Signed-off-by: Keith Packard <keithp@keithp.com>
* 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: 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>