forked from proactivity-lab-study/esw-digital-sensor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgpio_handler.h
33 lines (27 loc) · 899 Bytes
/
gpio_handler.h
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
/**
* @file gpio_handler.h
*
* @author Johannes Ehala, ProLab.
* @license MIT
*
* Copyright ProLab, TTÜ. 2021
*/
#ifndef GPIO_HANDLER_H_
#define GPIO_HANDLER_H_
#include "cmsis_os2.h"
#include "i2c_handler.h" // Include I2C SDA and SCL port and pins
#define GPIO_EXTI_NUM 0x00000001UL // GPIO external interrupt number (index)
#define GPIO_IF_EXTI_NUM 0x00000002UL // Interrupt flag bit for external interrupt GPIO_EXTI_NUM
#define ESWGPIO_EXTI_INDEX 1
#define MMA8653FC_SDA_PORT gpioPortA
#define MMA8653FC_SCL_PORT gpioPortA
#define MMA8653FC_SDA_PIN 3
#define MMA8653FC_SCL_PIN 2
#define MMA8653FC_INT1_PORT gpioPortA
#define MMA8653FC_INT1_PIN 1
// Public functions
void gpio_i2c_pin_init(void);
void gpio_external_interrupt_init(void);
void gpio_external_interrupt_enable(osThreadId_t tID, uint32_t tFlag);
void gpio_external_interrupt_disable(void);
#endif // GPIO_HANDLER_H_