fw/altos
3 weeks agoaltos/test: Adjust CRC error rate after FEC fix master
Keith Packard [Thu, 28 Mar 2024 16:45:38 +0000 (09:45 -0700)]
altos/test: Adjust CRC error rate after FEC fix

The number of CRC failures during FEC testing is lower now that
the packet length bug has been fixed in the FEC encode bits.

Signed-off-by: Keith Packard <keithp@keithp.com>
3 weeks agoaltos: ao_fec_prepare using wrong value for input len
Keith Packard [Wed, 27 Mar 2024 04:38:48 +0000 (21:38 -0700)]
altos: ao_fec_prepare using wrong value for input len

The FEC code always sends a multiple of four bytes, padding by two
bytes for even inputs and one byte for odd. But the preparation step
was using the wrong value for the length, so the output was getting
mangled.

Signed-off-by: Keith Packard <keithp@keithp.com>
6 weeks agoaltos/easytimer-v2: Generate combined .ihx file for seeed testing
Keith Packard [Mon, 4 Mar 2024 00:37:09 +0000 (16:37 -0800)]
altos/easytimer-v2: Generate combined .ihx file for seeed testing

The test plan for seeed requires a combined loader and firmware image
for a single flashing step.

Signed-off-by: Keith Packard <keithp@keithp.com>
6 weeks agoaltos/stm32f1: Grab both TX/RX DMA mutexes while doing I2C
Keith Packard [Sat, 2 Mar 2024 23:23:57 +0000 (16:23 -0700)]
altos/stm32f1: Grab both TX/RX DMA mutexes while doing I2C

The I2C engine appears to trigger an extra RX DMA transaction which
scrambles anything sharing the same DMA units.

Signed-off-by: Keith Packard <keithp@keithp.com>
7 weeks agoaltos/easymega-v3.0: Update i2c pin usage
Keith Packard [Sat, 24 Feb 2024 20:46:17 +0000 (12:46 -0800)]
altos/easymega-v3.0: Update i2c pin usage

Found an errata which means we had to swap which i2c to use with the
mag sensor. Swap the mag sensor and fire_c/fire_d.

Signed-off-by: Keith Packard <keithp@keithp.com>
7 weeks agoaltos: Build EasyMega v3.0 by defaul
Keith Packard [Sat, 24 Feb 2024 20:45:54 +0000 (12:45 -0800)]
altos: Build EasyMega v3.0 by defaul

Signed-off-by: Keith Packard <keithp@keithp.com>
7 weeks agoaltos/stm32f103: Fix continuous ADC code
Keith Packard [Sat, 24 Feb 2024 20:45:09 +0000 (12:45 -0800)]
altos/stm32f103: Fix continuous ADC code

This needs the same hacks as the manual ADC code.

Signed-off-by: Keith Packard <keithp@keithp.com>
7 weeks agoaltoslib: Add EasyMega v3.0 support
Keith Packard [Sat, 24 Feb 2024 20:44:00 +0000 (12:44 -0800)]
altoslib: Add EasyMega v3.0 support

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agosrc/easymini-2.0: Add combined .dfu file for Seeed testing
Keith Packard [Tue, 13 Feb 2024 06:58:45 +0000 (22:58 -0800)]
src/easymini-2.0: Add combined .dfu file for Seeed testing

Provide a combined .dfu for testing EasyMini at Seeed. This
checks the baro sensor (via POST) and SoC.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agostm32f1: Clean up some ADC definitions
Keith Packard [Sat, 3 Feb 2024 00:31:03 +0000 (16:31 -0800)]
stm32f1: Clean up some ADC definitions

The CR2 bit is called TSVREFE in the docs, use that consistently

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltosui: Make accel cal dialog say 'beeper' instead of 'antenna'
Keith Packard [Thu, 1 Feb 2024 06:05:13 +0000 (22:05 -0800)]
altosui: Make accel cal dialog say 'beeper' instead of 'antenna'

Quite the plumbing required, but it'll do.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/easytimer-v2: Fix product name
Keith Packard [Tue, 30 Jan 2024 02:40:30 +0000 (18:40 -0800)]
altos/easytimer-v2: Fix product name

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/easytimer-v2: Set default log size to 192kB
Keith Packard [Tue, 30 Jan 2024 02:40:06 +0000 (18:40 -0800)]
altos/easytimer-v2: Set default log size to 192kB

This leaves space for 4 flights.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltoslib: Add EasyTimer-v2 support
Keith Packard [Tue, 30 Jan 2024 02:39:27 +0000 (18:39 -0800)]
altoslib: Add EasyTimer-v2 support

Log parsing and idle monitor.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/easytimer-v2: Fix up ao_pins.h
Keith Packard [Tue, 30 Jan 2024 01:58:02 +0000 (17:58 -0800)]
altos/easytimer-v2: Fix up ao_pins.h

Fix M25 CS pin (PA10).
Fix BMI088 axes
Fix MMC5983 axes.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/telelco-v3: Minor UI tweaks
Keith Packard [Mon, 29 Jan 2024 05:14:06 +0000 (21:14 -0800)]
altos/telelco-v3: Minor UI tweaks

"Box"→"Bank" to match docs.
Auto-center text instead of pre-computing. Way easier.
Scroll found banks during startup.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/st7565: Set default contrast to 13
Keith Packard [Sun, 28 Jan 2024 08:17:27 +0000 (00:17 -0800)]
altos/st7565: Set default contrast to 13

This seems slightly better than 16. Might need to actually keep this
in config space.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/telelco: Add RSSI display to older devices
Keith Packard [Sun, 28 Jan 2024 07:59:43 +0000 (23:59 -0800)]
altos/telelco: Add RSSI display to older devices

Show RSSI value on TeleLCO v2.0

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/telelco: Add per-box RSSI display screen
Keith Packard [Sun, 28 Jan 2024 07:48:51 +0000 (23:48 -0800)]
altos/telelco: Add per-box RSSI display screen

Shows the last received RSSI value.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/stm32f1: Set beeper pin to 0 while off
Keith Packard [Sun, 28 Jan 2024 07:47:45 +0000 (23:47 -0800)]
altos/stm32f1: Set beeper pin to 0 while off

Make sure we don't let the timer leave it sitting high; the
magnetic beepers probably don't do the right thing in that case.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/telelco-v3.0: Show backlight/contrast value as percent
Keith Packard [Sun, 28 Jan 2024 07:13:17 +0000 (23:13 -0800)]
altos/telelco-v3.0: Show backlight/contrast value as percent

Provide a bit more feedback about the setting.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/st7565: Diff image during update
Keith Packard [Sun, 28 Jan 2024 07:12:05 +0000 (23:12 -0800)]
altos/st7565: Diff image during update

This minimizes the amount of data sent to the device. Mostly this is
useful to skip updates that don't change the display at all.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/telelco: Update backlight/contrast display upon change
Keith Packard [Sun, 28 Jan 2024 07:11:15 +0000 (23:11 -0800)]
altos/telelco: Update backlight/contrast display upon change

Don't wait for the 1-second poll interval.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/draw: Add ao_text_width
Keith Packard [Sun, 28 Jan 2024 07:10:28 +0000 (23:10 -0800)]
altos/draw: Add ao_text_width

Computes the total advance of the given string, not the width of the
resulting ink.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/telelco-v3: Add logo to 'info' page
Keith Packard [Sun, 28 Jan 2024 06:03:00 +0000 (22:03 -0800)]
altos/telelco-v3: Add logo to 'info' page

Make the info page a bit more fun

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agotelelco-v3.0: Add info page
Keith Packard [Sun, 28 Jan 2024 00:35:33 +0000 (16:35 -0800)]
telelco-v3.0: Add info page

Show model, version, serial, call and freq

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/telelco-v3.0: Control LCD backlight with PWM
Keith Packard [Sun, 28 Jan 2024 00:03:35 +0000 (16:03 -0800)]
altos/telelco-v3.0: Control LCD backlight with PWM

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos: Add support for backlight control in ao_lco_bits
Keith Packard [Sun, 28 Jan 2024 00:03:20 +0000 (16:03 -0800)]
altos: Add support for backlight control in ao_lco_bits

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/stm32f1: For some reason the DBG registers aren't always available
Keith Packard [Sun, 28 Jan 2024 00:01:20 +0000 (16:01 -0800)]
altos/stm32f1: For some reason the DBG registers aren't always available

Attempts to discover the device model during flash loading appear to fail
for unknown reasons. Switch to basing the memory page size on the total
memory size, which should be just as reliable.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/telelco-v3.0: Configure SPI GPIO pins to 50MHz
Keith Packard [Sat, 27 Jan 2024 23:31:04 +0000 (15:31 -0800)]
altos/telelco-v3.0: Configure SPI GPIO pins to 50MHz

Need enough bandwidth to run at 20MHz

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos: Bump ST7565 speed to 20MHz
Keith Packard [Sat, 27 Jan 2024 23:30:27 +0000 (15:30 -0800)]
altos: Bump ST7565 speed to 20MHz

Go as fast as we can manage

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/telelco-v3.0: Add contrast setting
Keith Packard [Sat, 27 Jan 2024 01:35:43 +0000 (17:35 -0800)]
altos/telelco-v3.0: Add contrast setting

Provide a UI for setting the LCD contrast.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos: Build TeleLCO v3.0 bits by default
Keith Packard [Sat, 27 Jan 2024 01:35:21 +0000 (17:35 -0800)]
altos: Build TeleLCO v3.0 bits by default

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agotelelco-v3.0: Minor setup fixes
Keith Packard [Sat, 27 Jan 2024 00:06:44 +0000 (16:06 -0800)]
telelco-v3.0: Minor setup fixes

Change beeper to lower tone. Switch LCD SPI to mode 3. Fix the
quadrature device ID.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos: Fix pretend pad range for TeleLCO
Keith Packard [Sat, 27 Jan 2024 00:05:45 +0000 (16:05 -0800)]
altos: Fix pretend pad range for TeleLCO

Off-by-one when setting up the pretend pads.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos: Add wiring docs to st-7565 header
Keith Packard [Fri, 26 Jan 2024 22:03:40 +0000 (14:03 -0800)]
altos: Add wiring docs to st-7565 header

Write down what worked today.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos: Add SPI bus parameter to ao_spi_speed
Keith Packard [Fri, 26 Jan 2024 19:07:55 +0000 (11:07 -0800)]
altos: Add SPI bus parameter to ao_spi_speed

The stm32f1 series has two SPI busses and they operate from different
base clocks, so the computation of the clock divider to get a
particular frequency depends upon which SPI bus is being used.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agostm32f1: make spi speed per-bus
Keith Packard [Fri, 26 Jan 2024 18:59:19 +0000 (10:59 -0800)]
stm32f1: make spi speed per-bus

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoswitch to mode 3 for LCD
Keith Packard [Fri, 26 Jan 2024 18:57:56 +0000 (10:57 -0800)]
switch to mode 3 for LCD

2 months agosrc/stm32f1: Disable extra JTAG pins in ao_clock_init
Keith Packard [Wed, 24 Jan 2024 23:36:34 +0000 (15:36 -0800)]
src/stm32f1: Disable extra JTAG pins in ao_clock_init

Need to enable AFIO before trying to adjust bits there.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/telelco-v3.0: Use timer 2 for fast timer
Keith Packard [Sun, 14 Jan 2024 04:57:38 +0000 (20:57 -0800)]
altos/telelco-v3.0: Use timer 2 for fast timer

We need timer 1 for PWM on the backlight

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/stm32f1: Support timers 2,3,4 for fast timer
Keith Packard [Sun, 14 Jan 2024 04:57:00 +0000 (20:57 -0800)]
altos/stm32f1: Support timers 2,3,4 for fast timer

Make the code deal with differences between timer 18 and 234

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/telelco-v3.0: Battery voltage is on PA2
Keith Packard [Thu, 11 Jan 2024 23:17:32 +0000 (16:17 -0700)]
altos/telelco-v3.0: Battery voltage is on PA2

Which is ADC input #2

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/telelco-v3.0: Don't connect PA6 to SPI
Keith Packard [Thu, 11 Jan 2024 23:16:58 +0000 (16:16 -0700)]
altos/telelco-v3.0: Don't connect PA6 to SPI

MISO is not used, and we need the pin for other stuff.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/stm32f1: Allow PA6 to be left alone in the SPI code
Keith Packard [Thu, 11 Jan 2024 22:12:34 +0000 (15:12 -0700)]
altos/stm32f1: Allow PA6 to be left alone in the SPI code

This is MISO, which the LCD driver doesn't use. Leave it alone so we
can use it for other stuff.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/stm32f1: Poke the ADC harder to get it to sample
Keith Packard [Thu, 11 Jan 2024 22:11:06 +0000 (15:11 -0700)]
altos/stm32f1: Poke the ADC harder to get it to sample

The ADC requires a bunch of poking to get it started.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/stm32f1: Turn on ADC during initialization sequence
Keith Packard [Thu, 11 Jan 2024 07:49:00 +0000 (23:49 -0800)]
altos/stm32f1: Turn on ADC during initialization sequence

The ADC needs to be left 'on' so that it will actually
run the conversion sequence when started.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/telelco-v3.0: Add USB pull up
Keith Packard [Thu, 11 Jan 2024 00:27:33 +0000 (17:27 -0700)]
altos/telelco-v3.0: Add USB pull up

And move the ARM LED to PA9

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/stm32f1: Add STM_RCC_CFGR_PLLXTPRE_MASK value
Keith Packard [Thu, 11 Jan 2024 00:26:12 +0000 (17:26 -0700)]
altos/stm32f1: Add STM_RCC_CFGR_PLLXTPRE_MASK value

Necessary when setting the PLLXTPRE value

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/stm32f1: Set PLLXTPRE value
Keith Packard [Thu, 11 Jan 2024 00:24:32 +0000 (17:24 -0700)]
altos/stm32f1: Set PLLXTPRE value

This is the pre-PLL divider value which is needed when we want to
use a 16MHz crystal and a 72MHz sysclk

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/stm32f1: Support beeper on tim3
Keith Packard [Thu, 11 Jan 2024 00:22:57 +0000 (17:22 -0700)]
altos/stm32f1: Support beeper on tim3

Add a bit more flexibility to the beeper code

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/telelco*: Make LCO voltage display work on 2.0 and 3.0
Keith Packard [Mon, 8 Jan 2024 04:13:04 +0000 (20:13 -0800)]
altos/telelco*: Make LCO voltage display work on 2.0 and 3.0

Fix up the common code to handle LCO voltage display via box 0

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/telelco-v3.0: Fix up search UI
Keith Packard [Mon, 8 Jan 2024 03:57:03 +0000 (19:57 -0800)]
altos/telelco-v3.0: Fix up search UI

Present a progress bar. Show the detected box numbers.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/telelco-v3.0: Add ao_adc_single usage to get battery voltage
Keith Packard [Mon, 8 Jan 2024 03:14:03 +0000 (19:14 -0800)]
altos/telelco-v3.0: Add ao_adc_single usage to get battery voltage

Poll the ADC to acquire battery voltage data.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/stm32f1: Add ao_adc_single support
Keith Packard [Mon, 8 Jan 2024 03:13:22 +0000 (19:13 -0800)]
altos/stm32f1: Add ao_adc_single support

This supports polling the ADC for values instead of having
them get dumped into a ring at a regular rate.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos: Move ao_adc_single.h API header to kernel/
Keith Packard [Mon, 8 Jan 2024 02:58:41 +0000 (18:58 -0800)]
altos: Move ao_adc_single.h API header to kernel/

THis was in stm, but will be needed by other architectures.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/telelco-v3.0: Add some real drawing stuff
Keith Packard [Mon, 8 Jan 2024 01:05:34 +0000 (17:05 -0800)]
altos/telelco-v3.0: Add some real drawing stuff

This required enabling devices with 128kB flash.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/telelco-v3.0: Use eeprom emulation for config storage
Keith Packard [Mon, 8 Jan 2024 00:48:43 +0000 (16:48 -0800)]
altos/telelco-v3.0: Use eeprom emulation for config storage

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/stm32f1: Add eeprom emulation using flash
Keith Packard [Mon, 8 Jan 2024 00:47:47 +0000 (16:47 -0800)]
altos/stm32f1: Add eeprom emulation using flash

Use the last 2kB of flash to emulate eeprom storage for TeleLCO. This should
also be useful for EasyMega.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos: Add initial TeleLCO-v3 bits
Keith Packard [Mon, 8 Jan 2024 00:21:40 +0000 (16:21 -0800)]
altos: Add initial TeleLCO-v3 bits

This might light up some of the hardware...

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos: Build in 'draw' directory first
Keith Packard [Mon, 8 Jan 2024 00:20:42 +0000 (16:20 -0800)]
altos: Build in 'draw' directory first

This makes various font bits for targets using graphics

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/stm32f1: Add ao_fast_timer.c
Keith Packard [Mon, 8 Jan 2024 00:20:18 +0000 (16:20 -0800)]
altos/stm32f1: Add ao_fast_timer.c

Needed for TeleLCO

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/telelco-v3: Move USB pullup from PA9 to PA10
Keith Packard [Sun, 7 Jan 2024 07:24:13 +0000 (23:24 -0800)]
altos/telelco-v3: Move USB pullup from PA9 to PA10

Production boards will have the pull-up on PA10, and Bdale will hack
up the protos to match so we don't have to have separate firmware.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agofix product name
Bdale Garbee [Sun, 7 Jan 2024 22:55:53 +0000 (15:55 -0700)]
fix product name

2 months agoaltos/telelco-v3: Create initial flash loader setup
Keith Packard [Sun, 7 Jan 2024 07:16:23 +0000 (23:16 -0800)]
altos/telelco-v3: Create initial flash loader setup

Copied from easymega-v3 with USB pull-up moved to PA9. Note this
assumes the proto boards will have a resistor fitted there, which is
not in the artwork.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/easymega-v3.0: Switch to STM32F103
Keith Packard [Thu, 30 Mar 2023 07:46:36 +0000 (00:46 -0700)]
altos/easymega-v3.0: Switch to STM32F103

For some reason, there was easymega v3.0 firmware sitting here, but
it was mostly a copy of easymega v2.0 bits. Fix that to support the
current design based on the STM32F103 SoC.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agodrivers: Add real i2c support to mmc5983
Keith Packard [Thu, 30 Mar 2023 07:45:17 +0000 (00:45 -0700)]
drivers: Add real i2c support to mmc5983

It only had bit-banging i2c support; go ahead
and add "real" i2c support for EasyMega v3

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/stm32f1: Add more IP block drivers
Keith Packard [Thu, 30 Mar 2023 07:05:21 +0000 (00:05 -0700)]
altos/stm32f1: Add more IP block drivers

adc, beep, exti, i2c

Also hooked up data sampling bits in ao_timer.c

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos: Fix up stm32f103-nucleo 'lco' demo mode
Keith Packard [Thu, 16 Mar 2023 17:24:36 +0000 (10:24 -0700)]
altos: Fix up stm32f103-nucleo 'lco' demo mode

Adjust some layout now that I've got a real screen to play with.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos: Clean up st7565 LCD driver
Keith Packard [Thu, 16 Mar 2023 17:23:05 +0000 (10:23 -0700)]
altos: Clean up st7565 LCD driver

Get rid of AO_ prefix on chip-specific register values.
Declare ao_st7565_instructions to take const uint8_t * so
it can accept an array in flash.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/stm32f103-nucleo: Draw more of the LCO demo screen
Keith Packard [Thu, 9 Mar 2023 01:14:56 +0000 (17:14 -0800)]
altos/stm32f103-nucleo: Draw more of the LCO demo screen

Add the box/pad screen.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/stm32f103-nucleo: Drive a screen too
Keith Packard [Wed, 8 Mar 2023 23:54:39 +0000 (15:54 -0800)]
altos/stm32f103-nucleo: Drive a screen too

Use the ST7565 driver to control an LCD screen.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/stm32f1: Add DMA and SPI drivers
Keith Packard [Wed, 8 Mar 2023 23:53:58 +0000 (15:53 -0800)]
altos/stm32f1: Add DMA and SPI drivers

These came from the code for the stm32l15 chips

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/driver: Document setting for AO_ST7565_BIAS
Keith Packard [Wed, 8 Mar 2023 23:53:03 +0000 (15:53 -0800)]
altos/driver: Document setting for AO_ST7565_BIAS

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/draw: Have each font declare ao_glyph_temp as .comm
Keith Packard [Wed, 8 Mar 2023 23:52:11 +0000 (15:52 -0800)]
altos/draw: Have each font declare ao_glyph_temp as .comm

Create temporary glyph drawing space by having every glyph declare how
much space it needs and letting the linker allocate the largest
possible space.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/draw: Skip line adjustment for vertical/horizontal
Keith Packard [Wed, 8 Mar 2023 23:50:57 +0000 (15:50 -0800)]
altos/draw: Skip line adjustment for vertical/horizontal

When e3 is zero, don't adjust the minor position based on
the major as it doesn't move.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/draw: Build demos with -O3 to catch more bugs
Keith Packard [Wed, 8 Mar 2023 23:50:19 +0000 (15:50 -0800)]
altos/draw: Build demos with -O3 to catch more bugs

The compiler fails to do a lot of checks in -O0

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agosrc/draw: Provide some useful constants
Keith Packard [Wed, 8 Mar 2023 23:49:52 +0000 (15:49 -0800)]
src/draw: Provide some useful constants

The two colors and a stride macro

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos: Add ST7565 LCD driver
Keith Packard [Wed, 8 Mar 2023 23:14:53 +0000 (15:14 -0800)]
altos: Add ST7565 LCD driver

This is the chip used by various NewHaven LCD displays

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/stm32f103-nucleo: Add boot loader
Keith Packard [Sun, 26 Feb 2023 06:41:48 +0000 (22:41 -0800)]
altos/stm32f103-nucleo: Add boot loader

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agostm32f1: Get boot loader working
Keith Packard [Sun, 26 Feb 2023 03:24:11 +0000 (19:24 -0800)]
stm32f1: Get boot loader working

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/stm32f1: Start work on self-flash code
Keith Packard [Mon, 20 Feb 2023 00:29:56 +0000 (16:29 -0800)]
altos/stm32f1: Start work on self-flash code

Looks like this uses the same IP block as the stm32f0 series; copied
the code, haven't gotten it working yet.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/stm32f103-nucleo: Use more bits
Keith Packard [Sun, 19 Feb 2023 23:45:29 +0000 (15:45 -0800)]
altos/stm32f103-nucleo: Use more bits

Get the OS running, use the serial for console

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/stm32f1: More stm32f103 work
Keith Packard [Sun, 19 Feb 2023 23:44:32 +0000 (15:44 -0800)]
altos/stm32f1: More stm32f103 work

Serial driver works
Interrupts work

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos: Start work on stm32f1 support
Keith Packard [Sat, 18 Feb 2023 07:02:16 +0000 (23:02 -0800)]
altos: Start work on stm32f1 support

Got clocks working. CPU now running at 72MHz.
Got systick timer working. Ticks at 100Hz.
Got GPIO working. LED blinks.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoao-tools: Add flash utility for stm32f1x chips
Keith Packard [Sun, 26 Feb 2023 06:40:29 +0000 (22:40 -0800)]
ao-tools: Add flash utility for stm32f1x chips

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/lpc: Adjust ADC clock from 450kHz to 4.5MHz
Keith Packard [Tue, 30 Jan 2024 20:33:22 +0000 (12:33 -0800)]
altos/lpc: Adjust ADC clock from 450kHz to 4.5MHz

A missing zero. Also, let products change this value if desired to
improve high-impedence performance.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoFix configure tests for multi-arch libaltos
Keith Packard [Thu, 1 Feb 2024 01:47:08 +0000 (17:47 -0800)]
Fix configure tests for multi-arch libaltos

libaltos builds now require a long list of compilers. Check for all of them
before enabling it when building in auto mode.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agokernel: conditionalize config "report in feet" on presence of baro sensor
Bdale Garbee [Mon, 22 Jan 2024 23:15:44 +0000 (16:15 -0700)]
kernel: conditionalize config "report in feet" on presence of baro sensor

3 months agoaltos/easytimer-v2: Initialize logging too
Keith Packard [Sun, 7 Jan 2024 06:09:41 +0000 (22:09 -0800)]
altos/easytimer-v2: Initialize logging too

Now that the logging bits are all written, let's turn it on.

Signed-off-by: Keith Packard <keithp@keithp.com>
3 months agoaltos: Updating pyro format tried to copy entries with no value
Keith Packard [Sun, 7 Jan 2024 06:08:54 +0000 (22:08 -0800)]
altos: Updating pyro format tried to copy entries with no value

Need to check for NO_VALUE before attempting to copy data, otherwise
things will go badly.

Signed-off-by: Keith Packard <keithp@keithp.com>
3 months agoaltos/samd21: Enable stdio for USB by default
Keith Packard [Sun, 7 Jan 2024 06:07:29 +0000 (22:07 -0800)]
altos/samd21: Enable stdio for USB by default

samd21 usb driver didn't bother to enable stdio for USB for some
reason.

Signed-off-by: Keith Packard <keithp@keithp.com>
3 months agoaltos/easytimer-v2: Update comments in flash loader ao_pins.h
Keith Packard [Sun, 7 Jan 2024 01:06:58 +0000 (17:06 -0800)]
altos/easytimer-v2: Update comments in flash loader ao_pins.h

No code changes, but the comments were wrong.

Signed-off-by: Keith Packard <keithp@keithp.com>
3 months agoaltos/easytimer-v2: Add logging bits
Keith Packard [Sun, 7 Jan 2024 01:03:30 +0000 (17:03 -0800)]
altos/easytimer-v2: Add logging bits

32-byte records with all data in a single record instead of
separate volt/sensor bits.

Signed-off-by: Keith Packard <keithp@keithp.com>
3 months agoaltos: Build easytimer-v2 bits
Keith Packard [Thu, 16 Mar 2023 17:30:24 +0000 (10:30 -0700)]
altos: Build easytimer-v2 bits

Signed-off-by: Keith Packard <keithp@keithp.com>
3 months agoaltos: Initial easytimer-v2 bits
Keith Packard [Thu, 16 Mar 2023 17:29:10 +0000 (10:29 -0700)]
altos: Initial easytimer-v2 bits

Signed-off-by: Keith Packard <keithp@keithp.com>
3 months agoaltos: Use BMI088 as z-axis accel as needed
Keith Packard [Thu, 16 Mar 2023 17:25:19 +0000 (10:25 -0700)]
altos: Use BMI088 as z-axis accel as needed

When there's no high-g accel available, use the 'along' axis
to measure acceleration.

Signed-off-by: Keith Packard <keithp@keithp.com>
4 months agofixup seven segment debug code
Keith Packard [Mon, 11 Dec 2023 21:44:54 +0000 (13:44 -0800)]
fixup seven segment debug code

Signed-off-by: Keith Packard <keithp@keithp.com>
5 months agoMerge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
Bdale Garbee [Thu, 16 Nov 2023 16:28:44 +0000 (09:28 -0700)]
Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos

5 months agoadd a paragraph about how to hook up a pressure sensor to an EasyMotor
Bdale Garbee [Thu, 16 Nov 2023 16:28:21 +0000 (09:28 -0700)]
add a paragraph about how to hook up a pressure sensor to an EasyMotor