Browse Source

add trigger func

master
zhaohe 1 year ago
parent
commit
10d712432a
  1. 2
      xs_gpio.c
  2. 3
      xs_gpio.h

2
xs_gpio.c

@ -305,6 +305,8 @@ void xs_gpio_write(xs_gpio_t *gpio, bool level) {
HAL_GPIO_WritePin(gpio->gpio, gpio->pinoff, pinState);
}
void xs_gpio_toggle(xs_gpio_t *gpio) { HAL_GPIO_TogglePin(gpio->gpio, gpio->pinoff); }
void EXTI0_IRQHandler() { HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_0); }
void EXTI1_IRQHandler() { HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_1); }
void EXTI2_IRQHandler() { HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_2); }

3
xs_gpio.h

@ -33,4 +33,5 @@ typedef struct {
void xs_gpio_init_as_input(xs_gpio_t *gpio, Pin_t pin, xs_gpio_mode_t mode, xs_gpio_irq_t irqtype, bool mirror);
void xs_gpio_init_as_output(xs_gpio_t *gpio, Pin_t pin, xs_gpio_mode_t mode, bool mirror, bool initLevel);
bool xs_gpio_read(xs_gpio_t *gpio);
void xs_gpio_write(xs_gpio_t *gpio, bool level);
void xs_gpio_write(xs_gpio_t *gpio, bool level);
void xs_gpio_toggle(xs_gpio_t *gpio);
Loading…
Cancel
Save