22 {0, 8, 16, 24, 32, 40, 48, 56},
23 {0, 9, 22, 34, 46, 59, 59, 59},
24 {0, 12, 24, 24, 24, 24, 24, 24},
25 {0, 8, 20, 26, 34, 44, 55, 55}
31 if (pad > community_base[community][7])
32 die(
"Pad number is out of range!");
35 base = &community_base[community][0];
36 for (i = 0; i < 7; i++) {
37 if ((pad >=
base[0]) && (pad <
base[1]))
43 return (i << 8) + pad - *
base;
64 return pad_config_reg;
104 pad_config1_reg = pad_config0_reg + 1;
143 pad_value =
read32(pad_config0_reg);
static void write32(void *addr, uint32_t val)
static uint32_t read32(const void *addr)
void __noreturn die(const char *fmt,...)
uint16_t gpio_family_number(uint8_t community, uint8_t pad)
uint32_t * gpio_pad_config_reg(uint8_t community, uint8_t pad)
int gpio_get(gpio_t gpio_num)
int get_gpio(int community_base, int pad0_offset)
void gpio_input_pullup(gpio_t gpio_num)
static int gpio_get_community_num(gpio_t gpio_num, int *pad)
static void gpio_config_pad(gpio_t gpio_num, const struct soc_gpio_map *cfg)
void gpio_input_pulldown(gpio_t gpio_num)
void gpio_input(gpio_t gpio_num)
#define GPIO_INPUT_PD_20K
#define GPIO_INPUT_PU_20K
#define GPIO_FAMILIES_MAX_PER_COMM
#define FAMILY_PAD_REGS_OFF
#define COMMUNITY_BASE(community)
#define GPIO_COMMUNITY_COUNT
#define GPIO_INPUT_NO_PULL
#define FAMILY_PAD_REGS_SIZE
#define GP_SOUTHWEST_COUNT