From ad35f2f2e9972f9224f027ac6707372629828c97 Mon Sep 17 00:00:00 2001 From: mrninhvn Date: Mon, 25 Oct 2021 14:02:33 +0700 Subject: [PATCH] add more charfer current choice --- app/boards/arm/mikoto/Kconfig | 8 +++++++- app/boards/arm/mikoto/pinmux.c | 9 ++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/app/boards/arm/mikoto/Kconfig b/app/boards/arm/mikoto/Kconfig index 129866cd..beb82028 100644 --- a/app/boards/arm/mikoto/Kconfig +++ b/app/boards/arm/mikoto/Kconfig @@ -6,11 +6,17 @@ config BOARD_ENABLE_DCDC choice BOARD_MIKOTO_CHARGER_CURRENT prompt "Charge current to supply to attached batteries" - depends on (BOARD_MIKOTO_520) + depends on (BOARD_MIKOTO_520) + +config BOARD_MIKOTO_CHARGER_CURRENT_40MA + bool "40mA charge current" config BOARD_MIKOTO_CHARGER_CURRENT_100MA bool "100mA charge current" +config BOARD_MIKOTO_CHARGER_CURRENT_150MA + bool "150mA charge current" + config BOARD_MIKOTO_CHARGER_CURRENT_250MA bool "250mA charge current" diff --git a/app/boards/arm/mikoto/pinmux.c b/app/boards/arm/mikoto/pinmux.c index cfdd9e79..59a38fbf 100644 --- a/app/boards/arm/mikoto/pinmux.c +++ b/app/boards/arm/mikoto/pinmux.c @@ -17,10 +17,17 @@ static int pinmux_mikoto_init(const struct device *port) { #if CONFIG_BOARD_MIKOTO_520 const struct device *p0 = device_get_binding("GPIO_0"); const struct device *p1 = device_get_binding("GPIO_1"); -#if CONFIG_BOARD_MIKOTO_CHARGER_CURRENT_100MA +#if CONFIG_BOARD_MIKOTO_CHARGER_CURRENT_40MA + gpio_pin_configure(p0, 26, GPIO_INPUT | GPIO_PULL_DOWN); + gpio_pin_configure(p1, 15, GPIO_INPUT); +#elif CONFIG_BOARD_MIKOTO_CHARGER_CURRENT_100MA gpio_pin_configure(p0, 26, GPIO_OUTPUT); gpio_pin_set(p0, 26, 0); gpio_pin_configure(p1, 15, GPIO_INPUT); +#elif CONFIG_BOARD_MIKOTO_CHARGER_CURRENT_150MA + gpio_pin_configure(p0, 26, GPIO_OUTPUT); + gpio_pin_set(p0, 26, 0); + gpio_pin_configure(p1, 15, GPIO_INPUT | GPIO_PULL_DOWN); #elif CONFIG_BOARD_MIKOTO_CHARGER_CURRENT_250MA gpio_pin_configure(p0, 26, GPIO_INPUT); gpio_pin_configure(p1, 15, GPIO_OUTPUT);