api-hal-gpio.c 488 B

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