Skip to content

Commit 4b38694

Browse files
cameledMaureenHelm
authored andcommitted
boards: arm: gd32f450i_eval: add i2c0 interface
Add i2c0 interface to gd32f450i_eval board. Signed-off-by: HaiLong Yang <[email protected]>
1 parent 5a7aeb9 commit 4b38694

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

boards/arm/gd32f450i_eval/doc/index.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ The board configuration supports the following hardware features:
8080
* - DAC
8181
- :kconfig:`CONFIG_DAC`
8282
- :dtcompatible:`gd,gd32-dac`
83+
* - I2C
84+
- :kconfig:`CONFIG_I2C`
85+
- :dtcompatible:`gd,gd32-i2c`
86+
* - EEPROM
87+
- :kconfig:`CONFIG_EEPROM`
88+
- :dtcompatible:`atmel,at24`
8389

8490
Serial Port
8591
===========

boards/arm/gd32f450i_eval/gd32f450i_eval-pinctrl.dtsi

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,11 @@
2323
pinmux = <TIMER1_CH2_PB10>;
2424
};
2525
};
26+
27+
i2c0_default: i2c0_default {
28+
group1 {
29+
pinmux = <I2C0_SCL_PB6>, <I2C0_SDA_PB7>;
30+
drive-open-drain;
31+
};
32+
};
2633
};

boards/arm/gd32f450i_eval/gd32f450i_eval.dts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
led1 = &led2;
6666
sw0 = &user_key;
6767
pwm-led0 = &pwm_led;
68+
eeprom-0 = &eeprom0;
6869
};
6970
};
7071

@@ -110,3 +111,20 @@
110111
pinctrl-names = "default";
111112
};
112113
};
114+
115+
&i2c0 {
116+
status = "okay";
117+
pinctrl-0 = <&i2c0_default>;
118+
pinctrl-names = "default";
119+
120+
eeprom0: eeprom@50 {
121+
compatible = "atmel,at24";
122+
reg = <0x50>;
123+
status = "okay";
124+
label = "EEPROM_AT24C02";
125+
size = <256>;
126+
pagesize = <8>;
127+
address-width = <8>;
128+
timeout = <5>;
129+
};
130+
};

0 commit comments

Comments
 (0)