Skip to content

Commit 8e90847

Browse files
committed
board: gd32e103v_eval: add at24 eeprom.
add support for at24 eeprom. Signed-off-by: YuLong Yao <[email protected]>
1 parent d58ce71 commit 8e90847

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

boards/arm/gd32e103v_eval/gd32e103v_eval-pinctrl.dtsi

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,11 @@
1717
pinmux = <TIMER0_CH0_PA8_OUT_NORMP>;
1818
};
1919
};
20+
21+
i2c0_default: i2c0_default {
22+
group1 {
23+
pinmux = <I2C0_SCL_PB6_NORMP>, <I2C0_SDA_PB7_NORMP>;
24+
drive-open-drain;
25+
};
26+
};
2027
};

boards/arm/gd32e103v_eval/gd32e103v_eval.dts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
led1 = &led3;
7070
sw0 = &user_key;
7171
pwm-led0 = &pwm_led;
72+
eeprom-0 = &eeprom0;
7273
};
7374
};
7475

@@ -108,3 +109,20 @@
108109
pinctrl-names = "default";
109110
};
110111
};
112+
113+
&i2c0 {
114+
status = "okay";
115+
pinctrl-0 = <&i2c0_default>;
116+
pinctrl-names = "default";
117+
118+
eeprom0: eeprom@50 {
119+
compatible = "atmel,at24";
120+
reg = <0x50>;
121+
status = "okay";
122+
label = "EEPROM_AT24C02";
123+
size = <256>;
124+
pagesize = <8>;
125+
address-width = <8>;
126+
timeout = <5>;
127+
};
128+
};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CONFIG_I2C=y
2+
CONFIG_EEPROM_AT24=y
3+
CONFIG_EEPROM_INIT_PRIORITY=75

0 commit comments

Comments
 (0)