altos: get ao_max6691 driver working
authorKeith Packard <keithp@keithp.com>
Sun, 21 Apr 2019 23:49:19 +0000 (16:49 -0700)
committerKeith Packard <keithp@keithp.com>
Sun, 21 Apr 2019 23:54:54 +0000 (16:54 -0700)
commit5d3436ed8551537287dc6cf418f93b0989e1aee8
treecb940eabcc3f4a1cb35ab1e35cd6e7b32272e974
parent49ce3e9a2eb4e1918773b80c355d720a3dadc7e0
altos: get ao_max6691 driver working

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>
src/drivers/ao_max6691.c
src/drivers/ao_max6691.h
src/stm/stm32l.h