~ruther/stm32h747i-disco-usb-image-viewer

ref: 9c2e500adbbb5a63f7db7cab78dcbdbd9567813d stm32h747i-disco-usb-image-viewer/firmware/include/exti.h -rw-r--r-- 845 bytes
9c2e500a — Rutherther docs: add missing docs 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <stdint.h>
#include <stm32h7xx.h>

#ifndef EXTI_H
#define EXTI_H

typedef struct {
  EXTI_TypeDef* exti;
  SYSCFG_TypeDef* syscfg;
  uint8_t line;
} exti_t;

typedef enum {
  EXTI_GPIOA = 0,
  EXTI_GPIOB = 1,
  EXTI_GPIOC = 2,
  EXTI_GPIOD = 2,
  /// ... TODO
} EXTI_external_gpio_t;

void exti_init(exti_t* exti, uint8_t line, EXTI_TypeDef* exti_periph, SYSCFG_TypeDef* syscfg);
void exti_external_interrupt(exti_t* exti, uint8_t gpio);

// Only 21 positions are now supported. This is too hard for other ones.

void exti_rising_interrupt(exti_t* exti);
void exti_falling_interrupt(exti_t* exti);
void exti_disable_interrupt(exti_t* exti);
void exti_enable_interrupt(exti_t *exti);

void exti_nvic_setup(exti_t* exti, uint8_t line);

uint32_t exti_is_interrupt(exti_t* exti);
void exti_clear_interrupt(exti_t* exti);

#endif // EXTI_H
Do not follow this link