diff options
author | Keith Packard <keithp@keithp.com> | 2013-05-19 20:27:05 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2013-05-19 20:39:19 -0700 |
commit | c1f01cd4406063191a51cb68fc4634eabfc60fc2 (patch) | |
tree | 91d2abd598b40c224425fada5e9eb5fff0b40be8 | |
parent | e0ad8b5b5e1b4c7a9ffba9d25f3c32ce708c3ec5 (diff) |
altos/lpc: Reset SPI device at startup time
Wasn't doing the reset sequence correctly (write 0, then write 1).
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | src/lpc/ao_spi_lpc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lpc/ao_spi_lpc.c b/src/lpc/ao_spi_lpc.c index ff107e40..c3587698 100644 --- a/src/lpc/ao_spi_lpc.c +++ b/src/lpc/ao_spi_lpc.c @@ -199,7 +199,8 @@ ao_spi_init(void) /* Turn on the clock */ lpc_scb.ssp1clkdiv = 1; - /* De-assert reset */ + /* Reset the device */ + lpc_scb.presetctrl &= ~(1 << LPC_SCB_PRESETCTRL_SSP1_RST_N); lpc_scb.presetctrl |= (1 << LPC_SCB_PRESETCTRL_SSP1_RST_N); ao_spi_channel_init(1); #endif /* HAS_SPI_1 */ |