Lines Matching refs:pin
29 static void mt_set_gpio_dir_chip(uint32_t pin, int dir) in mt_set_gpio_dir_chip() argument
33 assert(pin < MAX_GPIO_PIN); in mt_set_gpio_dir_chip()
36 pos = pin / MAX_GPIO_REG_BITS; in mt_set_gpio_dir_chip()
37 bit = pin % MAX_GPIO_REG_BITS; in mt_set_gpio_dir_chip()
46 static int mt_get_gpio_dir_chip(uint32_t pin) in mt_get_gpio_dir_chip() argument
51 assert(pin < MAX_GPIO_PIN); in mt_get_gpio_dir_chip()
53 pos = pin / MAX_GPIO_REG_BITS; in mt_get_gpio_dir_chip()
54 bit = pin % MAX_GPIO_REG_BITS; in mt_get_gpio_dir_chip()
60 static void mt_set_gpio_out_chip(uint32_t pin, int output) in mt_set_gpio_out_chip() argument
64 assert(pin < MAX_GPIO_PIN); in mt_set_gpio_out_chip()
67 pos = pin / MAX_GPIO_REG_BITS; in mt_set_gpio_out_chip()
68 bit = pin % MAX_GPIO_REG_BITS; in mt_set_gpio_out_chip()
77 static int mt_get_gpio_in_chip(uint32_t pin) in mt_get_gpio_in_chip() argument
82 assert(pin < MAX_GPIO_PIN); in mt_get_gpio_in_chip()
84 pos = pin / MAX_GPIO_REG_BITS; in mt_get_gpio_in_chip()
85 bit = pin % MAX_GPIO_REG_BITS; in mt_get_gpio_in_chip()
91 static void mt_gpio_set_spec_pull_pupd(uint32_t pin, int enable, in mt_gpio_set_spec_pull_pupd() argument
98 gpio_info = mt_pin_infos[pin]; in mt_gpio_set_spec_pull_pupd()
101 reg1 = mt_gpio_find_reg_addr(pin) + gpio_info.offset; in mt_gpio_set_spec_pull_pupd()
116 static void mt_gpio_set_pull_pu_pd(uint32_t pin, int enable, in mt_gpio_set_pull_pu_pd() argument
123 gpio_info = mt_pin_infos[pin]; in mt_gpio_set_pull_pu_pd()
126 reg1 = mt_gpio_find_reg_addr(pin) + gpio_info.offset; in mt_gpio_set_pull_pu_pd()
143 static void mt_gpio_set_pull_chip(uint32_t pin, int enable, in mt_gpio_set_pull_chip() argument
148 gpio_info = mt_pin_infos[pin]; in mt_gpio_set_pull_chip()
150 mt_gpio_set_spec_pull_pupd(pin, enable, select); in mt_gpio_set_pull_chip()
152 mt_gpio_set_pull_pu_pd(pin, enable, select); in mt_gpio_set_pull_chip()
156 static int mt_gpio_get_spec_pull_pupd(uint32_t pin) in mt_gpio_get_spec_pull_pupd() argument
165 gpio_info = mt_pin_infos[pin]; in mt_gpio_get_spec_pull_pupd()
168 reg1 = mt_gpio_find_reg_addr(pin) + gpio_info.offset; in mt_gpio_get_spec_pull_pupd()
184 static int mt_gpio_get_pull_pu_pd(uint32_t pin) in mt_gpio_get_pull_pu_pd() argument
193 gpio_info = mt_pin_infos[pin]; in mt_gpio_get_pull_pu_pd()
196 reg1 = mt_gpio_find_reg_addr(pin) + gpio_info.offset; in mt_gpio_get_pull_pu_pd()
209 static int mt_gpio_get_pull_chip(uint32_t pin) in mt_gpio_get_pull_chip() argument
213 gpio_info = mt_pin_infos[pin]; in mt_gpio_get_pull_chip()
215 return mt_gpio_get_spec_pull_pupd(pin); in mt_gpio_get_pull_chip()
217 return mt_gpio_get_pull_pu_pd(pin); in mt_gpio_get_pull_chip()
221 static void mt_set_gpio_pull_select_chip(uint32_t pin, int sel) in mt_set_gpio_pull_select_chip() argument
223 assert(pin < MAX_GPIO_PIN); in mt_set_gpio_pull_select_chip()
226 mt_gpio_set_pull_chip(pin, MT_GPIO_PULL_DISABLE, MT_GPIO_PULL_DOWN); in mt_set_gpio_pull_select_chip()
228 mt_gpio_set_pull_chip(pin, MT_GPIO_PULL_ENABLE, MT_GPIO_PULL_UP); in mt_set_gpio_pull_select_chip()
230 mt_gpio_set_pull_chip(pin, MT_GPIO_PULL_ENABLE, MT_GPIO_PULL_DOWN); in mt_set_gpio_pull_select_chip()
235 static int mt_get_gpio_pull_select_chip(uint32_t pin) in mt_get_gpio_pull_select_chip() argument
237 assert(pin < MAX_GPIO_PIN); in mt_get_gpio_pull_select_chip()
239 return mt_gpio_get_pull_chip(pin); in mt_get_gpio_pull_select_chip()
249 uint32_t pin; in mt_get_gpio_dir() local
251 pin = (uint32_t)gpio; in mt_get_gpio_dir()
252 return mt_get_gpio_dir_chip(pin); in mt_get_gpio_dir()
257 uint32_t pin; in mt_set_gpio_pull() local
259 pin = (uint32_t)gpio; in mt_set_gpio_pull()
260 mt_set_gpio_pull_select_chip(pin, pull); in mt_set_gpio_pull()
265 uint32_t pin; in mt_get_gpio_pull() local
267 pin = (uint32_t)gpio; in mt_get_gpio_pull()
268 return mt_get_gpio_pull_select_chip(pin); in mt_get_gpio_pull()
273 uint32_t pin; in mt_set_gpio_out() local
275 pin = (uint32_t)gpio; in mt_set_gpio_out()
276 mt_set_gpio_out_chip(pin, value); in mt_set_gpio_out()
281 uint32_t pin; in mt_get_gpio_in() local
283 pin = (uint32_t)gpio; in mt_get_gpio_in()
284 return mt_get_gpio_in_chip(pin); in mt_get_gpio_in()