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

ref: 02e7e4dfbf77f0e6aac3abd7ab75632233c347e0 stm32h747i-disco-usb-image-viewer/include/exti.h -rw-r--r-- 1.2 KiB
02e7e4df — Rutherther docs: add documentation comments to most functions 5 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
37
38
39
40
41
42
43
44
#include <stdint.h>
#include <stm32h747xx.h>

#ifndef EXTI_H
#define EXTI_H

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

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

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

/**
 * @brief Set the exti line to send an interrupt on rising edge.
 * @details Valid for external EXTI interrupts. The interrupt will be triggered on rising interrupt
 * @param[in,out] exti The exti line descriptor
 */
void exti_rising_interrupt(exti_t* exti, uint8_t line);

/**
 * @brief Set the exti line to send an interrupt on falling edge.
 * @details Valid for external EXTI interrupts. The interrupt will be triggered on falling interrupt
 * @param[in,out] exti The exti line descriptor
 */
void exti_falling_interrupt(exti_t* exti, uint8_t line);

/**
 * @brief Mask the interrupt for given exti line.
 * @details Description
 * @param[in,out] exti The exti line descriptor
 */
void exti_disable_interrupt(exti_t* exti, uint8_t line);

/**
 * @brief Enable the nvic interrupt
 * @param[in,out] exti The exti line descriptor
 */
void exti_nvic_setup(exti_t* exti, uint8_t line);

#endif // EXTI_H
Do not follow this link