2020-01-10 10:38:21 +08:00
|
|
|
/*
|
2021-03-14 12:58:10 +08:00
|
|
|
* Copyright (c) 2006-2021, RT-Thread Development Team
|
2020-01-10 10:38:21 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
|
|
|
* 2019-07-29 zdzn first version
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __DRV_GPIO_H__
|
|
|
|
#define __DRV_GPIO_H__
|
|
|
|
|
|
|
|
#include <rtthread.h>
|
|
|
|
#include <rtdevice.h>
|
|
|
|
|
|
|
|
#include "board.h"
|
2020-02-28 17:49:50 +08:00
|
|
|
#include "interrupt.h"
|
|
|
|
|
2020-01-10 10:38:21 +08:00
|
|
|
|
|
|
|
#define GPIO_IRQ_NUM 3
|
|
|
|
|
2020-02-28 17:49:50 +08:00
|
|
|
#define IRQ_GPIO0 49
|
|
|
|
#define IRQ_GPIO1 50
|
|
|
|
#define IRQ_GPIO2 51
|
|
|
|
#define IRQ_GPIO3 52
|
|
|
|
|
2020-01-10 10:38:21 +08:00
|
|
|
struct gpio_irq_def
|
|
|
|
{
|
|
|
|
void *irq_arg[32];
|
|
|
|
void (*irq_cb[32])(void *param);
|
|
|
|
rt_uint8_t irq_type[32];
|
|
|
|
};
|
|
|
|
|
|
|
|
enum gpio_irq_clock
|
|
|
|
{
|
|
|
|
GPIO_IRQ_LOSC_32KHZ = 0,
|
|
|
|
GPIO_IRQ_HOSC_24MHZ
|
|
|
|
};
|
|
|
|
|
|
|
|
int rt_hw_gpio_init(void);
|
|
|
|
|
|
|
|
#endif /* __DRV_GPIO_H__ */
|