Browse Source

Merge pull request #113 from megamind4089/dev/nrfmicro_charger

Add KConfig for board battery charger
xmkb
Pete Johanson 4 years ago committed by GitHub
parent
commit
6806cd2a55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      app/boards/arm/nrfmicro/Kconfig
  2. 7
      app/boards/arm/nrfmicro/Kconfig.defconfig
  3. 6
      app/boards/arm/nrfmicro/pinmux.c

5
app/boards/arm/nrfmicro/Kconfig

@ -3,3 +3,8 @@ config BOARD_ENABLE_DCDC
select SOC_DCDC_NRF52X select SOC_DCDC_NRF52X
default y default y
depends on (BOARD_NRFMICRO_11 || BOARD_NRFMICRO_11_FLIPPED || BOARD_NRFMICRO_13) depends on (BOARD_NRFMICRO_11 || BOARD_NRFMICRO_11_FLIPPED || BOARD_NRFMICRO_13)
config BOARD_NRFMICRO_CHARGER
bool "Enable battery charger"
default y
depends on (BOARD_NRFMICRO_13)

7
app/boards/arm/nrfmicro/Kconfig.defconfig

@ -30,4 +30,11 @@ config ZMK_USB
config PINMUX config PINMUX
default y default y
if BOARD_NRFMICRO_13
config BOARD_NRFMICRO_CHARGER
default y
endif # BOARD_NRFMICRO_13
endif # BOARD_NRFMICRO_11 || BOARD_NRFMICRO_11_FLIPPED || BOARD_NRFMICRO_13 endif # BOARD_NRFMICRO_11 || BOARD_NRFMICRO_11_FLIPPED || BOARD_NRFMICRO_13

6
app/boards/arm/nrfmicro/pinmux.c

@ -23,9 +23,13 @@ static int pinmux_nrfmicro_init(struct device *port)
gpio_pin_configure(p1, 9, GPIO_OUTPUT); gpio_pin_configure(p1, 9, GPIO_OUTPUT);
gpio_pin_set(p1, 9, 0); gpio_pin_set(p1, 9, 0);
// enable charger (nRFMicro 1.3 only) #if CONFIG_BOARD_NRFMICRO_CHARGER
gpio_pin_configure(p0, 5, GPIO_OUTPUT); gpio_pin_configure(p0, 5, GPIO_OUTPUT);
gpio_pin_set(p0, 5, 0); gpio_pin_set(p0, 5, 0);
#else
gpio_pin_configure(p0, 5, GPIO_INPUT);
#endif
#else #else
// enable EXT_VCC (use 0 for nRFMicro 1.3, use 1 for nRFMicro 1.1) // enable EXT_VCC (use 0 for nRFMicro 1.3, use 1 for nRFMicro 1.1)
gpio_pin_configure(p1, 9, GPIO_OUTPUT); gpio_pin_configure(p1, 9, GPIO_OUTPUT);

Loading…
Cancel
Save