altos: Add support for multiple SPI busses and sharing device drivers
authorKeith Packard <keithp@keithp.com>
Tue, 10 Apr 2012 06:27:43 +0000 (23:27 -0700)
committerKeith Packard <keithp@keithp.com>
Sat, 14 Apr 2012 20:21:09 +0000 (13:21 -0700)
commit0dd9e1dd62656a931f9559af6da9131f704f83f9
treef0c659cda9e107b8a835c0f815d4153e4da09c8e
parent35e3c47da895bdd868b9b66b98bca64bd82db862
altos: Add support for multiple SPI busses and sharing device drivers

The STM32L151 has several SPI busses, and we want to use more than
one, so add a 'bus' parameter to the SPI interfaces. To avoid wasting
time on AVR and CC1111 processors which only use one SPI bus, elide
those parameters from the actual functions by wrapping them with
macros.

Configuring chip select is now all macroized so that each chip can
have its own version, allowing the STM to share the various SPI device
drivers with the cc1111 and avr processors. Note that only the M25
driver has been ported; porting the others is 'trivial', but not
necessary at this point.

Signed-off-by: Keith Packard <keithp@keithp.com>
16 files changed:
src/avr/ao_arch_funcs.h
src/avr/ao_pins.h
src/avr/ao_spi_usart.c
src/cc1111/ao_arch_funcs.h
src/cc1111/ao_pins.h
src/cc1111/ao_spi.c
src/drivers/ao_25lc1024.c
src/drivers/ao_at45db161d.c
src/drivers/ao_companion.c
src/drivers/ao_m25.c
src/drivers/ao_ms5607.c
src/megametrum-v0.1/Makefile
src/megametrum-v0.1/ao_megametrum.c
src/megametrum-v0.1/ao_pins.h
src/stm/ao_arch_funcs.h
src/teleterra-v0.2/ao_pins.h