2022-09-05 15:15:24 -07:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2022 The ZMK Contributors
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*/
|
|
|
|
|
2022-10-07 21:46:08 -07:00
|
|
|
#include <zephyr/kernel.h>
|
|
|
|
#include <zephyr/device.h>
|
|
|
|
#include <zephyr/init.h>
|
|
|
|
#include <zephyr/drivers/gpio.h>
|
|
|
|
#include <zephyr/sys/sys_io.h>
|
|
|
|
#include <zephyr/devicetree.h>
|
2022-09-05 15:15:24 -07:00
|
|
|
|
2023-06-23 00:19:57 -07:00
|
|
|
static int pinmux_puchi_ble_init(void) {
|
2022-09-05 15:15:24 -07:00
|
|
|
#if CONFIG_BOARD_PUCHI_BLE_v1
|
2023-01-17 17:40:44 -08:00
|
|
|
const struct device *p0 = DEVICE_DT_GET(DT_NODELABEL(gpio0));
|
2022-09-05 15:15:24 -07:00
|
|
|
#if CONFIG_BOARD_PUCHI_BLE_CHARGER
|
|
|
|
gpio_pin_configure(p0, 5, GPIO_OUTPUT);
|
|
|
|
gpio_pin_set(p0, 5, 0);
|
|
|
|
#else
|
|
|
|
gpio_pin_configure(p0, 5, GPIO_INPUT);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
SYS_INIT(pinmux_puchi_ble_init, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY);
|