altos: Slow STM SPI down a bit so the MS5607 returns values
authorKeith Packard <keithp@keithp.com>
Mon, 9 Apr 2012 07:06:35 +0000 (00:06 -0700)
committerKeith Packard <keithp@keithp.com>
Mon, 9 Apr 2012 07:06:35 +0000 (00:06 -0700)
It's still not working right, but at least it returns something other
than all zeros...

Signed-off-by: Keith Packard <keithp@keithp.com>
src/stm/ao_spi_stm.c

index ecf7934f1f43b6a7df8e6d9035a2be4ef802659a..d3e1ca4b48e9823b26344d7cdb7302201ca64481 100644 (file)
@@ -167,9 +167,9 @@ ao_spi_get(uint8_t spi_index)
                        (0 << STM_SPI_CR1_RXONLY) |
                        (1 << STM_SPI_CR1_SSM) |                        /* Software SS handling */
                        (1 << STM_SPI_CR1_SSI) |                        /*  ... */
-                       (0 << STM_SPI_CR1_LSBFIRST) |                   /* Little endian */
+                       (0 << STM_SPI_CR1_LSBFIRST) |                   /* Big endian */
                        (1 << STM_SPI_CR1_SPE) |                        /* Enable SPI unit */
-                       (STM_SPI_CR1_BR_PCLK_4 << STM_SPI_CR1_BR) |     /* baud rate to pclk/4 */
+                       (STM_SPI_CR1_BR_PCLK_16 << STM_SPI_CR1_BR) |    /* baud rate to pclk/4 */
                        (1 << STM_SPI_CR1_MSTR) |
                        (0 << STM_SPI_CR1_CPOL) |                       /* Format 0 */
                        (0 << STM_SPI_CR1_CPHA));