diff options
author | Keith Packard <keithp@keithp.com> | 2018-09-11 18:49:22 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2018-10-13 08:23:25 -0700 |
commit | 0b5ac831d2e63a091833c702b07b0331fba32e72 (patch) | |
tree | 96b8bc48c94590b072e081213c9d83a1dab1b8e9 /src/stm32f4/ao_arch.h | |
parent | 23075d174d2bff8ff3f3deef3c3d90b83da6bd2e (diff) |
altos/stm32f4: Add usart driver for usart6
This is what the disco board hooks up.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/stm32f4/ao_arch.h')
-rw-r--r-- | src/stm32f4/ao_arch.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/stm32f4/ao_arch.h b/src/stm32f4/ao_arch.h index d4c78f60..083a4e5b 100644 --- a/src/stm32f4/ao_arch.h +++ b/src/stm32f4/ao_arch.h @@ -100,4 +100,32 @@ #define AO_SYSTICK (AO_HCLK) #define AO_PANIC_DELAY_SCALE (AO_SYSCLK / 12000000) +/* The stm32f413 implements only 4 bits of the priority fields? */ + +#if AO_NONMASK_INTERRUPT +#define AO_STM_NVIC_NONMASK_PRIORITY 0x00 + +/* Set the basepri register to this value to mask all + * non-maskable priorities + */ +#define AO_STM_NVIC_BASEPRI_MASK 0x10 +#endif + +#define AO_STM_NVIC_HIGH_PRIORITY 0x40 +#define AO_STM_NVIC_MED_PRIORITY 0x80 +#define AO_STM_NVIC_LOW_PRIORITY 0xC0 +#define AO_STM_NVIC_CLOCK_PRIORITY 0xf0 + +#define AO_GPIO_MODE_PULL_NONE 0 +#define AO_GPIO_MODE_PULL_UP 4 +#define AO_GPIO_MODE_PULL_DOWN 8 + +/* usart stuff */ + +#define AO_SERIAL_SPEED_4800 4800 +#define AO_SERIAL_SPEED_9600 9600 +#define AO_SERIAL_SPEED_19200 19200 +#define AO_SERIAL_SPEED_57600 57600 +#define AO_SERIAL_SPEED_115200 115200 + #endif /* _AO_ARCH_H_ */ |