api-hal-gpio.c 447 B

123456789101112131415161718
  1. #include "api-hal-gpio.h"
  2. // init GPIO
  3. void hal_gpio_init(GpioPin* gpio, GpioMode mode, GpioPull pull, GpioSpeed speed) {
  4. // TODO: Alternate Functions
  5. GPIO_InitTypeDef GPIO_InitStruct = {0};
  6. GPIO_InitStruct.Pin = gpio->pin;
  7. GPIO_InitStruct.Mode = mode;
  8. GPIO_InitStruct.Pull = pull;
  9. GPIO_InitStruct.Speed = speed;
  10. HAL_GPIO_Init(gpio->port, &GPIO_InitStruct);
  11. }
  12. bool hal_gpio_read_sd_detect(void) {
  13. return true;
  14. }