Commit 7c239aed authored by Sergei Miroshnichenko's avatar Sergei Miroshnichenko

RM#1313 gpio: stm32: Add IN and IN_PULLUP roles

parent ca816b8f
......@@ -147,6 +147,8 @@ static const u32 af_val[STM32F2_GPIO_ROLE_LAST] = {
(u32)-1,
STM32F2_GPIO_AF_QSPI9, /* STM32F2_GPIO_ROLE_QSPI_AF9 */
STM32F2_GPIO_AF_QSPI10, /* STM32F2_GPIO_ROLE_QSPI_AF10 */
STM32F2_GPIO_MODE_IN,
STM32F2_GPIO_MODE_IN,
};
/*
......@@ -211,6 +213,18 @@ s32 stm32f2_gpio_config(const struct stm32f2_gpio_dsc *dsc,
pupd = STM32F2_GPIO_PUPD_NO;
mode = STM32F2_GPIO_MODE_AF;
break;
case STM32F2_GPIO_ROLE_GPIN:
otype = STM32F2_GPIO_OTYPE_PP;
ospeed = STM32F2_GPIO_SPEED_2M;
pupd = STM32F2_GPIO_PUPD_NO;
mode = STM32F2_GPIO_MODE_IN;
break;
case STM32F2_GPIO_ROLE_GPIN_PULLUP:
otype = STM32F2_GPIO_OTYPE_PP;
ospeed = STM32F2_GPIO_SPEED_2M;
pupd = STM32F2_GPIO_PUPD_UP;
mode = STM32F2_GPIO_MODE_IN;
break;
default:
if (gd->have_console)
printf("%s: incorrect role %d.\n", __func__, role);
......
......@@ -79,6 +79,8 @@ enum stm32f2_gpio_role {
STM32F2_GPIO_ROLE_GPOUT, /* GPOUT */
STM32F2_GPIO_ROLE_QSPI_AF9,
STM32F2_GPIO_ROLE_QSPI_AF10,
STM32F2_GPIO_ROLE_GPIN,
STM32F2_GPIO_ROLE_GPIN_PULLUP,
STM32F2_GPIO_ROLE_LAST /* for internal usage, must be last */
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment