summaryrefslogtreecommitdiff
path: root/src/drivers/ao_ms5607.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-04-09 23:27:43 -0700
committerKeith Packard <keithp@keithp.com>2012-04-14 13:21:09 -0700
commit0dd9e1dd62656a931f9559af6da9131f704f83f9 (patch)
treef0c659cda9e107b8a835c0f815d4153e4da09c8e /src/drivers/ao_ms5607.c
parent35e3c47da895bdd868b9b66b98bca64bd82db862 (diff)
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>
Diffstat (limited to 'src/drivers/ao_ms5607.c')
-rw-r--r--src/drivers/ao_ms5607.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/drivers/ao_ms5607.c b/src/drivers/ao_ms5607.c
index 87748272..3c0a310d 100644
--- a/src/drivers/ao_ms5607.c
+++ b/src/drivers/ao_ms5607.c
@@ -155,8 +155,5 @@ void
ao_ms5607_init(void)
{
ao_cmd_register(&ao_ms5607_cmds[0]);
-
- stm_rcc.ahbenr |= (1 << STM_RCC_AHBENR_GPIOCEN);
- stm_gpio_set(&AO_MS5607_CS_GPIO, AO_MS5607_CS, 1);
- stm_moder_set(&AO_MS5607_CS_GPIO, AO_MS5607_CS, STM_MODER_OUTPUT);
+ ao_spi_init_cs(AO_MS5607_CS_GPIO, (1 << AO_MS5607_CS));
}