diff options
author | jaseg <git-bigdata-wsl-arch@jaseg.de> | 2020-10-12 20:15:41 +0200 |
---|---|---|
committer | jaseg <git-bigdata-wsl-arch@jaseg.de> | 2020-10-12 20:15:41 +0200 |
commit | e16ec19e3a445c1156c990ed71628fb183332be9 (patch) | |
tree | af95b48f15f35665342f5aba76625df3849927d2 /include/fe_config_backend.h | |
download | fenris-master.tar.gz fenris-master.tar.bz2 fenris-master.zip |
Diffstat (limited to 'include/fe_config_backend.h')
-rw-r--r-- | include/fe_config_backend.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/include/fe_config_backend.h b/include/fe_config_backend.h new file mode 100644 index 0000000..e0d6690 --- /dev/null +++ b/include/fe_config_backend.h @@ -0,0 +1,40 @@ +#ifndef __FE_CONFIG_BACKEND_H__ +#define __FE_CONFIG_BACKEND_H__ + +#include <fe_global.h> + +#define FE_CONFIG_GPIOA RCC_AHBENR_GPIOAEN, GPIOA +#define FE_CONFIG_GPIOB RCC_AHBENR_GPIOBEN, GPIOB +#define FE_CONFIG_GPIOC RCC_AHBENR_GPIOCEN, GPIOC +#define FE_CONFIG_GPIOD RCC_AHBENR_GPIODEN, GPIOD +#define FE_CONFIG_GPIOF RCC_AHBENR_GPIOFEN, GPIOF + +enum fe_config_usart { + FE_CONFIG_USART1_PB7, + FE_CONFIG_USART_COUNT +}; + +struct fe_config_gpiodef { + uint32_t rcc_ahbenr_flags; + GPIO_TypeDef *gpio; + int pin_number; +}; + +struct fe_config_def { + struct fe_config_gpiodef bootloader_enable_pin; + int bootloader_enable_level; + + struct fe_config_gpiodef signature_disable_pin; + int signature_disable_level; + + enum fe_config_usart usart; + int baudrate; + + const char *welcome_string; +}; + +extern const struct fe_config_def fe_config; + +void gpio_config(GPIO_TypeDef *gpio, int pin, int mode, int speed, int pullups, int alt); + +#endif /* __FE_CONFIG_BACKEND_H__ */ |