2020-10-26 07:16:54 +00:00
|
|
|
#include "api-hal-gpio.h"
|
|
|
|
|
|
|
|
// init GPIO
|
2020-11-19 12:25:32 +00:00
|
|
|
void hal_gpio_init(
|
|
|
|
const GpioPin* gpio,
|
|
|
|
const GpioMode mode,
|
|
|
|
const GpioPull pull,
|
|
|
|
const GpioSpeed speed) {
|
2020-10-26 07:16:54 +00:00
|
|
|
// TODO: Alternate Functions
|
|
|
|
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
|
|
|
|
|
|
|
GPIO_InitStruct.Pin = gpio->pin;
|
|
|
|
GPIO_InitStruct.Mode = mode;
|
|
|
|
GPIO_InitStruct.Pull = pull;
|
|
|
|
GPIO_InitStruct.Speed = speed;
|
|
|
|
|
|
|
|
HAL_GPIO_Init(gpio->port, &GPIO_InitStruct);
|
|
|
|
}
|
2020-11-11 06:17:53 +00:00
|
|
|
|
|
|
|
bool hal_gpio_read_sd_detect(void) {
|
|
|
|
return true;
|
|
|
|
}
|