stm32f4: Encode mode/func into single parameter of gpio_peripheral

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2019-07-28 11:32:56 -04:00
parent 7d4c475e52
commit ef0784afe6
5 changed files with 13 additions and 12 deletions

View File

@@ -10,12 +10,12 @@
#define GPIO_INPUT 0
#define GPIO_OUTPUT 1
#define GPIO_FUNCTION 2
#define GPIO_FUNCTION(fn) (2 | ((fn) << 4))
#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);
void gpio_peripheral(uint32_t gpio, uint32_t mode, int pullup);
#endif // internal.h