board: gd32e103v_eval: add at24 eeprom.

add support for at24 eeprom.

Signed-off-by: YuLong Yao <feilongphone@gmail.com>
This commit is contained in:
YuLong Yao 2022-02-27 13:23:29 +08:00 committed by Carles Cufí
parent c76fbb61d1
commit adfc82206b
3 changed files with 28 additions and 0 deletions

View file

@ -17,4 +17,11 @@
pinmux = <TIMER0_CH0_PA8_OUT_NORMP>;
};
};
i2c0_default: i2c0_default {
group1 {
pinmux = <I2C0_SCL_PB6_NORMP>, <I2C0_SDA_PB7_NORMP>;
drive-open-drain;
};
};
};

View file

@ -69,6 +69,7 @@
led1 = &led3;
sw0 = &user_key;
pwm-led0 = &pwm_led;
eeprom-0 = &eeprom0;
};
};
@ -108,3 +109,20 @@
pinctrl-names = "default";
};
};
&i2c0 {
status = "okay";
pinctrl-0 = <&i2c0_default>;
pinctrl-names = "default";
eeprom0: eeprom@50 {
compatible = "atmel,at24";
reg = <0x50>;
status = "okay";
label = "EEPROM_AT24C02";
size = <256>;
pagesize = <8>;
address-width = <8>;
timeout = <5>;
};
};

View file

@ -0,0 +1,3 @@
CONFIG_I2C=y
CONFIG_EEPROM_AT24=y
CONFIG_EEPROM_INIT_PRIORITY=75