stm32f4: Add initial support for STM32F446 chip

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2019-07-23 23:51:31 -04:00
parent 5a02572001
commit d501ca6b0b
9 changed files with 384 additions and 0 deletions

21
src/stm32f4/internal.h Normal file
View File

@@ -0,0 +1,21 @@
#ifndef __STM32F4_INTERNAL_H
#define __STM32F4_INTERNAL_H
// Local definitions for STM32F4 code
#include "stm32f4xx.h"
#define GPIO(PORT, NUM) (((PORT)-'A') * 16 + (NUM))
#define GPIO2PORT(PIN) ((PIN) / 16)
#define GPIO2BIT(PIN) (1<<((PIN) % 16))
#define GPIO_INPUT 0
#define GPIO_OUTPUT 1
#define GPIO_FUNCTION 2
#define GPIO_ANALOG 3
void enable_pclock(uint32_t periph_base);
uint32_t get_pclock_frequency(uint32_t periph_base);
void clock_setup(void);
void gpio_peripheral(uint32_t gpio, uint32_t mode, uint32_t func, int pullup);
#endif // internal.h