boards: esp32: axp192, mpu6886, rtc on m5stickc_plus
- fix i2c pin control - configure axp192 MPU and the regulators - configure the mpu6886 IMU - configure the bm856 RTC Signed-off-by: Julien Vermillard <julien@vermillard.com>
This commit is contained in:
parent
571d7b4ca7
commit
b52f041172
5 changed files with 83 additions and 14 deletions
|
@ -16,6 +16,21 @@ choice BT_HCI_BUS_TYPE
|
||||||
default BT_ESP32 if BT
|
default BT_ESP32 if BT
|
||||||
endchoice
|
endchoice
|
||||||
|
|
||||||
|
config GPIO_HOGS_INIT_PRIORITY
|
||||||
|
default 70
|
||||||
|
|
||||||
|
config MFD_INIT_PRIORITY
|
||||||
|
default 70
|
||||||
|
|
||||||
|
config REGULATOR_AXP192_INIT_PRIORITY
|
||||||
|
default 71
|
||||||
|
|
||||||
|
config GPIO_AXP192_INIT_PRIORITY
|
||||||
|
default 72
|
||||||
|
|
||||||
|
config REGULATOR_FIXED_INIT_PRIORITY
|
||||||
|
default 75
|
||||||
|
|
||||||
endif # BOARD_M5STICKC_PLUS_ESP32_PROCPU
|
endif # BOARD_M5STICKC_PLUS_ESP32_PROCPU
|
||||||
|
|
||||||
if BOARD_M5STICKC_PLUS_ESP32_APPCPU
|
if BOARD_M5STICKC_PLUS_ESP32_APPCPU
|
||||||
|
|
|
@ -54,18 +54,14 @@
|
||||||
pinmux = <SPIM3_CSEL_GPIO5>;
|
pinmux = <SPIM3_CSEL_GPIO5>;
|
||||||
};
|
};
|
||||||
|
|
||||||
i2c0_sda_gpio21: i2c0_sda_gpio21 {
|
|
||||||
pinmux = <I2C0_SDA_GPIO21>;
|
|
||||||
bias-pull-up;
|
|
||||||
drive-open-drain;
|
|
||||||
output-high;
|
|
||||||
};
|
|
||||||
|
|
||||||
i2c0_scl_gpio22: i2c0_scl_gpio22 {
|
i2c0_default: i2c0_default {
|
||||||
pinmux = <I2C0_SCL_GPIO22>;
|
group1 {
|
||||||
bias-pull-up;
|
pinmux = <I2C0_SDA_GPIO21>,
|
||||||
drive-open-drain;
|
<I2C0_SCL_GPIO22>;
|
||||||
output-high;
|
bias-pull-up;
|
||||||
|
drive-open-drain;
|
||||||
|
output-high;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include <espressif/esp32/esp32_pico_d4.dtsi>
|
#include <espressif/esp32/esp32_pico_d4.dtsi>
|
||||||
#include "m5stickc_plus-pinctrl.dtsi"
|
#include "m5stickc_plus-pinctrl.dtsi"
|
||||||
#include <zephyr/dt-bindings/input/input-event-codes.h>
|
#include <zephyr/dt-bindings/input/input-event-codes.h>
|
||||||
|
#include <zephyr/dt-bindings/regulator/axp192.h>
|
||||||
|
|
||||||
/ {
|
/ {
|
||||||
model = "M5StickC Plus PROCPU";
|
model = "M5StickC Plus PROCPU";
|
||||||
|
@ -20,6 +21,8 @@
|
||||||
uart-0 = &uart0;
|
uart-0 = &uart0;
|
||||||
i2c-0 = &i2c0;
|
i2c-0 = &i2c0;
|
||||||
watchdog0 = &wdt0;
|
watchdog0 = &wdt0;
|
||||||
|
accel0 = &mpu6886;
|
||||||
|
rtc = &bm8563;
|
||||||
};
|
};
|
||||||
|
|
||||||
chosen {
|
chosen {
|
||||||
|
@ -28,6 +31,7 @@
|
||||||
zephyr,shell-uart = &uart0;
|
zephyr,shell-uart = &uart0;
|
||||||
zephyr,flash = &flash0;
|
zephyr,flash = &flash0;
|
||||||
zephyr,code-partition = &slot0_partition;
|
zephyr,code-partition = &slot0_partition;
|
||||||
|
zephyr,rtc = &bm8563;
|
||||||
};
|
};
|
||||||
|
|
||||||
leds {
|
leds {
|
||||||
|
@ -81,11 +85,62 @@
|
||||||
/* IMU MPU-6886, RTC BM8563, PMU AXP192 */
|
/* IMU MPU-6886, RTC BM8563, PMU AXP192 */
|
||||||
&i2c0 {
|
&i2c0 {
|
||||||
status = "okay";
|
status = "okay";
|
||||||
clock-frequency = <I2C_BITRATE_STANDARD>;
|
clock-frequency = <I2C_BITRATE_FAST>;
|
||||||
sda-gpios = <&gpio0 21 GPIO_OPEN_DRAIN>;
|
sda-gpios = <&gpio0 21 GPIO_OPEN_DRAIN>;
|
||||||
scl-gpios = <&gpio0 22 GPIO_OPEN_DRAIN>;
|
scl-gpios = <&gpio0 22 GPIO_OPEN_DRAIN>;
|
||||||
pinctrl-0 = <&i2c0_sda_gpio21 &i2c0_scl_gpio22>;
|
pinctrl-0 = <&i2c0_default>;
|
||||||
|
scl-timeout-us = <0>;
|
||||||
pinctrl-names = "default";
|
pinctrl-names = "default";
|
||||||
|
|
||||||
|
axp192_pmic: axp192@34 {
|
||||||
|
compatible = "x-powers,axp192";
|
||||||
|
reg = <0x34>;
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
axp192_regulator: axp192_regulator {
|
||||||
|
compatible = "x-powers,axp192-regulator";
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
vdd_mcu: DCDC1 {
|
||||||
|
regulator-init-microvolt = <3350000>;
|
||||||
|
regulator-min-microvolt = <3200000>;
|
||||||
|
regulator-max-microvolt = <3400000>;
|
||||||
|
regulator-initial-mode = <AXP192_DCDC_MODE_AUTO>;
|
||||||
|
regulator-boot-on;
|
||||||
|
regulator-always-on;
|
||||||
|
};
|
||||||
|
|
||||||
|
lcd_bl: LDO2 {
|
||||||
|
regulator-init-microvolt = <2800000>;
|
||||||
|
regulator-min-microvolt = <1800000>;
|
||||||
|
regulator-max-microvolt = <3000000>;
|
||||||
|
regulator-boot-on;
|
||||||
|
};
|
||||||
|
|
||||||
|
lcd_logic: LDO3 {
|
||||||
|
regulator-init-microvolt = <3000000>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
axp192_gpio: axp192_gpio {
|
||||||
|
compatible = "x-powers,axp192-gpio";
|
||||||
|
gpio-controller;
|
||||||
|
#gpio-cells = <2>;
|
||||||
|
ngpios = <6>;
|
||||||
|
status = "okay";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
mpu6886: mpu6886@68 {
|
||||||
|
status = "okay";
|
||||||
|
compatible = "invensense,mpu6050";
|
||||||
|
reg = <0x68>;
|
||||||
|
};
|
||||||
|
|
||||||
|
bm8563: bm8563@51 {
|
||||||
|
compatible = "nxp,pcf8563";
|
||||||
|
reg = <0x51>;
|
||||||
|
status = "okay";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
&spi2 {
|
&spi2 {
|
||||||
|
|
|
@ -12,6 +12,7 @@ supported:
|
||||||
- uart
|
- uart
|
||||||
- pinmux
|
- pinmux
|
||||||
- nvs
|
- nvs
|
||||||
|
- regulator
|
||||||
testing:
|
testing:
|
||||||
ignore_tags:
|
ignore_tags:
|
||||||
- net
|
- net
|
||||||
|
|
|
@ -6,5 +6,7 @@ CONFIG_CONSOLE=y
|
||||||
CONFIG_SERIAL=y
|
CONFIG_SERIAL=y
|
||||||
CONFIG_UART_CONSOLE=y
|
CONFIG_UART_CONSOLE=y
|
||||||
|
|
||||||
|
CONFIG_REGULATOR=y
|
||||||
|
|
||||||
CONFIG_GPIO=y
|
CONFIG_GPIO=y
|
||||||
CONFIG_I2C=y
|
CONFIG_I2C=y
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue