2022-07-05 16:45:32 +08:00
|
|
|
/*
|
2023-01-20 10:49:23 +08:00
|
|
|
* Copyright (c) 2006-2023, RT-Thread Development Team
|
2022-07-05 16:45:32 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
|
|
|
* 2022-07-1 Rbb666 first version
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __DRV_GPIO_H__
|
|
|
|
#define __DRV_GPIO_H__
|
|
|
|
|
|
|
|
#include <rthw.h>
|
|
|
|
#include <rtdevice.h>
|
|
|
|
#include "drv_common.h"
|
2023-04-11 15:40:48 +08:00
|
|
|
#include "cyhal_irq_impl.h"
|
2022-07-05 16:45:32 +08:00
|
|
|
|
|
|
|
#define GPIO_INTERRUPT_PRIORITY (7u)
|
|
|
|
|
|
|
|
#define GET_PIN(PORTx,PIN) ((((uint8_t)(PORTx)) << 3U) + ((uint8_t)(PIN)))
|
|
|
|
|
|
|
|
struct pin_irq_map
|
|
|
|
{
|
2022-07-20 12:39:42 +08:00
|
|
|
rt_uint16_t port;
|
2022-07-05 16:45:32 +08:00
|
|
|
IRQn_Type irqno;
|
|
|
|
};
|
|
|
|
|
|
|
|
int rt_hw_pin_init(void);
|
|
|
|
|
|
|
|
#endif /* __DRV_GPIO_H__ */
|