20#include <drivers/gpio.h>
21#include <devicetree.h>
23#define GEN_ENUM(ENUM) ENUM,
24#define GEN_STR(STR) #STR,
26#if defined(CONFIG_GPIO_ASPEED)
27#define FOREACH_GPIO(APPLY) \
35#define TOTAL_GPIO_NUM 168
36#define GPIO_GROUP_NUM 6
37#define GPIO_GROUP_SIZE 32
38#define REG_GPIO_BASE 0x7e780000
39#elif (CONFIG_GPIO_NPCM4XX)
40#define FOREACH_GPIO(APPLY) \
58#define TOTAL_GPIO_NUM 124
59#define GPIO_GROUP_NUM 16
60#define GPIO_GROUP_SIZE 8
61#define REG_GPIO_BASE 0x40081000
63#error "Unsupported GPIO driver"
74#define GPIO_STACK_SIZE 3072
79#if defined(CONFIG_GPIO_ASPEED)
80#define REG_ADC_BASE 0x7e6e9000
81#define REG_SCU 0x7E6E2000
82#define REG_DIRECTION_OFFSET 4
83#define REG_INTERRUPT_ENABLE_OFFSET 8
84#define REG_INTERRUPT_TYPE0_OFFSET 0x0C
85#define REG_INTERRUPT_TYPE1_OFFSET 0x10
86#define REG_INTERRUPT_TYPE2_OFFSET 0x14
87#elif (CONFIG_GPIO_NPCM4XX)
88#define REG_DEVALTX 0x400C3000
89#define REG_DIRECTION_OFFSET 2
97#define GPIO_CFG_SIZE 168
#define GPIO_LOW
Definition: hal_gpio.h:72
void scu_init(SCU_CFG cfg[], size_t size)
Definition: hal_gpio.c:316
uint8_t gpio_get_reg_value(uint8_t gpio_num, uint8_t reg_offset)
Definition: hal_gpio.c:211
GPIO_CFG gpio_cfg[]
Definition: hal_gpio.c:50
GPIO_STATUS
Definition: hal_gpio.h:127
@ LOW_ACTIVE
Definition: hal_gpio.h:128
@ HIGH_ACTIVE
Definition: hal_gpio.h:130
@ LOW_INACTIVE
Definition: hal_gpio.h:129
@ HIGH_INACTIVE
Definition: hal_gpio.h:131
uint8_t gpio_ind_to_num_table[]
Definition: hal_gpio.c:44
uint32_t GPIO_MULTI_FUNC_PIN_CTL_REG_ACCESS[]
Definition: hal_gpio.c:84
int gpio_set(uint8_t, uint8_t)
Definition: hal_gpio.c:274
int gpio_get_direction(uint8_t gpio_num)
Definition: hal_gpio.c:241
POWER_STATUS
Definition: hal_gpio.h:117
@ POWER_OFF
Definition: hal_gpio.h:119
@ POWER_ON
Definition: hal_gpio.h:118
#define GPIO_HIGH
Definition: hal_gpio.h:73
int gpio_get(uint8_t)
Definition: hal_gpio.c:261
char * gpio_name[]
Definition: hal_gpio.c:49
int gpio_conf(uint8_t gpio_num, int dir)
Definition: hal_gpio.c:232
struct _SET_GPIO_VALUE_CFG_ SET_GPIO_VALUE_CFG
struct _GPIO_CFG_ GPIO_CFG
uint8_t gpio_ind_to_num_table_cnt
Definition: hal_gpio.c:45
int gpio_init(const struct device *args)
Definition: hal_gpio.c:332
CONTROL_STATUS
Definition: hal_gpio.h:122
@ CONTROL_ON
Definition: hal_gpio.h:123
@ CONTROL_OFF
Definition: hal_gpio.h:124
#define GEN_ENUM(ENUM)
Definition: hal_gpio.h:23
uint32_t GPIO_GROUP_REG_ACCESS[]
Definition: hal_gpio.c:55
GPIO_GROUP
Definition: hal_gpio.h:66
@ FOREACH_GPIO
Definition: hal_gpio.h:66
bool pal_load_gpio_config(void)
Definition: hal_gpio.c:327
const int GPIO_MULTI_FUNC_CFG_SIZE
Definition: hal_gpio.c:140
int gpio_interrupt_conf(uint8_t, gpio_flags_t)
Definition: hal_gpio.c:202
uint16_t size
Definition: pldm_oem.h:0
Definition: hal_gpio.h:98
uint8_t is_init
Definition: hal_gpio.h:101
uint8_t status
Definition: hal_gpio.h:104
int int_type
Definition: hal_gpio.h:106
uint8_t chip
Definition: hal_gpio.h:99
uint8_t number
Definition: hal_gpio.h:100
uint16_t direction
Definition: hal_gpio.h:103
uint8_t property
Definition: hal_gpio.h:105
void(* int_cb)()
Definition: hal_gpio.h:107
uint8_t is_latch
Definition: hal_gpio.h:102
Definition: hal_gpio.h:139
int value
Definition: hal_gpio.h:141
int reg
Definition: hal_gpio.h:140
Definition: hal_gpio.h:110
uint8_t gpio_num
Definition: hal_gpio.h:111
uint8_t gpio_value
Definition: hal_gpio.h:112