stm32f4: Only enable peripherals once

Add is_enabled_pclock() and only initialize spi and adc once during
configuration.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2019-07-28 17:55:57 -04:00
parent ef0784afe6
commit bc9c8cd7a0
4 changed files with 35 additions and 13 deletions

View File

@@ -14,6 +14,7 @@
#define GPIO_ANALOG 3
void enable_pclock(uint32_t periph_base);
int is_enabled_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, int pullup);