add more charfer current choice

This commit is contained in:
mrninhvn 2021-10-25 14:02:33 +07:00
parent 1d928128bd
commit ad35f2f2e9
2 changed files with 15 additions and 2 deletions

View file

@ -8,9 +8,15 @@ choice BOARD_MIKOTO_CHARGER_CURRENT
prompt "Charge current to supply to attached batteries"
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"

View file

@ -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);