boards: arm: stm32g071b_disco: Add I2C device tree node

Add I2C node to board level device tree and ina230 I2C device

Signed-off-by: Sam Hurst <sbh1187@gmail.com>
This commit is contained in:
Sam Hurst 2022-01-17 12:45:59 -08:00 committed by Carles Cufí
commit 99d24db0fe
3 changed files with 31 additions and 0 deletions

View file

@ -70,6 +70,8 @@ The Zephyr stm32g071b_disco board configuration supports the following hardware
| UART | on-chip | serial port-polling; |
| | | serial port-interrupt |
+-----------+------------+-------------------------------------+
| I2C | on-chip | i2c |
+-----------+------------+-------------------------------------+
| GPIO | on-chip | gpio |
+-----------+------------+-------------------------------------+
| WATCHDOG | on-chip | independent watchdog |

View file

@ -7,6 +7,7 @@
/dts-v1/;
#include <st/g0/stm32g071Xb.dtsi>
#include <st/g0/stm32g071r(6-8-b)tx-pinctrl.dtsi>
#include <dt-bindings/sensor/ina230.h>
/ {
model = "STM32G071B DEMO board";
@ -104,6 +105,33 @@
status = "okay";
};
&i2c1 {
status = "okay";
pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>;
pinctrl-names = "default";
status = "okay";
clock-frequency = <I2C_BITRATE_FAST>;
/*
* Use U10, INA230 to measure VBUS. I2C Address: 0x40
*/
vbus_meas: ina230@40 {
status = "okay";
compatible = "ti,ina230";
label = "VBUS";
reg = <0x40>;
config = <INA230_CONFIG(
INA230_OPER_MODE_BUS_VOLTAGE_CONT,
INA230_CONV_TIME_1100,
INA230_CONV_TIME_1100,
INA230_AVG_MODE_1)>;
/* Set current LSB to 1mA */
current-lsb = <1>;
/* Set shunt resistror value to 15 milliohms */
rshunt = <15>;
};
};
&iwdg {
status = "okay";
};

View file

@ -11,4 +11,5 @@ flash: 128
supported:
- uart
- gpio
- i2c
- watchdog