diff options
| author | Keith Packard <keithp@keithp.com> | 2012-10-15 00:06:10 -0700 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2012-10-15 00:06:10 -0700 | 
| commit | 80227c08444d5c82fd43320644cdeec6f34fee1b (patch) | |
| tree | a657f9ecbc408108f5d42d83b084c579924b9dc2 /src/stm/ao_arch_funcs.h | |
| parent | 44c13005f34fdf7d4831e86e1f3e8729e9b67a68 (diff) | |
altos/stm: Declare all SPI bus speeds
Just list them all so users can pick what they like
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/stm/ao_arch_funcs.h')
| -rw-r--r-- | src/stm/ao_arch_funcs.h | 17 | 
1 files changed, 15 insertions, 2 deletions
| diff --git a/src/stm/ao_arch_funcs.h b/src/stm/ao_arch_funcs.h index d4fbea37..e66d20d7 100644 --- a/src/stm/ao_arch_funcs.h +++ b/src/stm/ao_arch_funcs.h @@ -21,9 +21,22 @@  /* ao_spi_stm.c   */ -#define AO_SPI_SPEED_FAST	STM_SPI_CR1_BR_PCLK_4 +/* PCLK is set to 16MHz (HCLK 32MHz, APB prescaler 2) */ + +#define AO_SPI_SPEED_8MHz	STM_SPI_CR1_BR_PCLK_2	/* This doesn't appear to work */ +#define AO_SPI_SPEED_4MHz	STM_SPI_CR1_BR_PCLK_4 +#define AO_SPI_SPEED_2MHz	STM_SPI_CR1_BR_PCLK_8  #define AO_SPI_SPEED_1MHz	STM_SPI_CR1_BR_PCLK_16 -#define AO_SPI_SPEED_200kHz	STM_SPI_CR1_BR_PCLK_256 +#define AO_SPI_SPEED_500kHz	STM_SPI_CR1_BR_PCLK_32 +#define AO_SPI_SPEED_250kHz	STM_SPI_CR1_BR_PCLK_64 +#define AO_SPI_SPEED_125kHz	STM_SPI_CR1_BR_PCLK_128 +#define AO_SPI_SPEED_62500Hz	STM_SPI_CR1_BR_PCLK_256 + +#define AO_SPI_SPEED_FAST	AO_SPI_SPEED_4MHz + +/* Companion bus wants something no faster than 200kHz */ + +#define AO_SPI_SPEED_200kHz	AO_SPI_SPEED_125kHz  #define AO_SPI_CONFIG_1		0x00  #define AO_SPI_1_CONFIG_PA5_PA6_PA7	AO_SPI_CONFIG_1 | 
