Zephyr API Documentation 4.2.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
gpio_rts5912.h
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: Apache-2.0
3 *
4 * Copyright (c) 2024 Realtek Semiconductor Corporation, SIBG-SD7
5 * Author: Lin Yu-Cheng <lin_yu_cheng@realtek.com>
6 */
7
8#ifndef ZEPHYR_DRIVERS_GPIO_GPIO_RTS5912_H_
9#define ZEPHYR_DRIVERS_GPIO_GPIO_RTS5912_H_
10
11#include <zephyr/device.h>
12#include <zephyr/drivers/gpio.h>
13#include <reg/reg_gpio.h>
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
20
22{
23 volatile uint32_t *gcr =
24 (volatile uint32_t *)(((uint32_t *)(DT_REG_ADDR(DT_NODELABEL(gpioa)))) + pin_num);
25
26 *gcr &= ~(GPIO_GCR_MFCTRL_Msk | GPIO_GCR_DIR_Msk);
27 *gcr |= BIT(GPIO_GCR_INTCTRL_Pos) | GPIO_GCR_INTSTS_Msk | GPIO_GCR_INTEN_Msk |
28 GPIO_GCR_INDETEN_Msk;
29}
30
31int gpio_rts5912_get_pin_num(const struct gpio_dt_spec *gpio);
32
34
35#ifdef __cplusplus
36}
37#endif
38
39#endif /* ZEPHYR_DRIVERS_GPIO_GPIO_RTS5912_H_ */
Main header file for GPIO driver API.
uint32_t * gpio_rts5912_get_port_address(const struct gpio_dt_spec *gpio)
static ALWAYS_INLINE void gpio_rts5912_set_wakeup_pin(uint32_t pin_num)
Definition gpio_rts5912.h:21
int gpio_rts5912_get_pin_num(const struct gpio_dt_spec *gpio)
gpio_pin_t gpio_rts5912_get_intr_pin(volatile uint32_t *reg_base)
#define DT_NODELABEL(label)
Get a node identifier for a node label.
Definition devicetree.h:196
#define DT_REG_ADDR(node_id)
Get a node's (only) register block address.
Definition devicetree.h:2461
uint8_t gpio_pin_t
Provides a type to hold a GPIO pin index.
Definition gpio.h:262
#define BIT(n)
Unsigned integer with bit position n set (signed in assembly language).
Definition util_macro.h:44
#define ALWAYS_INLINE
Definition common.h:160
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
Container for GPIO pin information specified in devicetree.
Definition gpio.h:296