boards: arm: gd32f450i_eval: add i2c0 interface

Add i2c0 interface to gd32f450i_eval board.

Signed-off-by: HaiLong Yang <cameledyang@pm.me>
This commit is contained in:
HaiLong Yang 2021-12-30 15:46:07 +08:00 committed by Maureen Helm
commit 4b386940b8
3 changed files with 31 additions and 0 deletions

View file

@ -80,6 +80,12 @@ The board configuration supports the following hardware features:
* - DAC * - DAC
- :kconfig:`CONFIG_DAC` - :kconfig:`CONFIG_DAC`
- :dtcompatible:`gd,gd32-dac` - :dtcompatible:`gd,gd32-dac`
* - I2C
- :kconfig:`CONFIG_I2C`
- :dtcompatible:`gd,gd32-i2c`
* - EEPROM
- :kconfig:`CONFIG_EEPROM`
- :dtcompatible:`atmel,at24`
Serial Port Serial Port
=========== ===========

View file

@ -23,4 +23,11 @@
pinmux = <TIMER1_CH2_PB10>; pinmux = <TIMER1_CH2_PB10>;
}; };
}; };
i2c0_default: i2c0_default {
group1 {
pinmux = <I2C0_SCL_PB6>, <I2C0_SDA_PB7>;
drive-open-drain;
};
};
}; };

View file

@ -65,6 +65,7 @@
led1 = &led2; led1 = &led2;
sw0 = &user_key; sw0 = &user_key;
pwm-led0 = &pwm_led; pwm-led0 = &pwm_led;
eeprom-0 = &eeprom0;
}; };
}; };
@ -110,3 +111,20 @@
pinctrl-names = "default"; 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>;
};
};