summaryrefslogtreecommitdiff
path: root/bsp/fm33lc026/libraries/HAL_Drivers/drv_gpio.h
blob: 86b4e82f4f1d05d6242f368f45490787bf1b2e47 (plain)
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
/*
 * Copyright (c) 2006-2022, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author            Notes
 * 2022-07-20     wudiyidashi       first version
 */

#ifndef __DRV_GPIO_H__
#define __DRV_GPIO_H__

#include <drv_common.h>
#include <board.h>

#ifdef __cplusplus
extern "C" {
#endif

#define __FM33_PORT(port)  GPIO##port##_BASE


#define GET_PIN(PORTx,PIN) (rt_base_t)((16 * ( ((rt_base_t)__FM33_PORT(PORTx) - (rt_base_t)GPIOA_BASE)/(0x0400UL) )) + PIN)


struct pin_irq_map
{
    rt_uint16_t pin;
    rt_uint16_t irqno;
};

int rt_hw_pin_init(void);

#ifdef __cplusplus
}
#endif

#endif /* __DRV_GPIO_H__ */