I2C外设
The STM32MP157A embeds six I 2 C interfaces.
特性:
STM32MP157A支持6个I2C控制器。
I 2 C-bus specification and user manual rev. 5 compatibility:
I2C-bus规范和用户手册rev. 5的兼容性:
Slave和master mode,多主功能
Standard-mode(Sm),通信比特率高达100 kbit/s
Fast-mode(Fm),通信比特率高达400 kbit/s
Fast-mode Pluse(Fm +),具有高达1 Mbit/s的比特率和20 mA输出驱动器I/O
7bit和10bit寻址模式,多个7bit从地址
I2C4和I2C6可以(在ETZPC中)定义为只能通过安全软件访问。
Domain | Peripheral | Runtime allocation | Comment | |||
Instance | Cortex-A7 secure (OP-TEE) | Cortex-A7 non-secure (Linux) | Cortex-M4 (STM32Cube) | |||
Low speed interface | I2C | I2C1 | ☐ | ☐ | Assignment (single choice) | |
I2C2 | ☐ | ☐ | Assignment (single choice) | |||
I2C3 | ☐ | ☐ | Assignment (single choice) | |||
I2C4 | ☐ | ☐ | Assignment (single choice). | |||
I2C5 | ☐ | ☐ | Assignment (single choice) | |||
I2C6 | ☐ | ☐ | Assignment (single choice) |
i2c-scl-rising-time-ns和i2c-scl-falling-time-ns需要根据硬件来配置,使用示波器捕捉SCL的信号,量出rising和falling的时间。
&i2c2 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&i2c2_pins_a>;
pinctrl-1 = <&i2c2_pins_sleep_a>;
i2c-scl-rising-time-ns = <185>;
i2c-scl-falling-time-ns = <20>;
status = "okay";
/delete-property/dmas;
/delete-property/dma-names;
};
i2c-scl-rising-time-ns 是在SCL 上升沿时捕捉, i2c-scl-falling-time-ns 是在SCL的下降沿时捕捉。使用示波器测量时,测量幅度在20%到80%直接的时间,以表示上升时间和下降时间(单位为纳秒)。
CA7使用MCP4725
MCP4725是一款支持DAC功能的芯片。
特性:
12-Bit Resolution
工作电压: 2.7V to 5.5V
通信接口为I2C:
支持各种通信速率:Standard (100 kbps), Fast (400 kbps), and High-Speed (3.4 Mbps) Modes
支持更宽的工作温度: -40°C to +125°C
&i2c6 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&i2c6_pins_a>;
pinctrl-1 = <&i2c6_pins_sleep_a>;
i2c-scl-rising-time-ns = <100>;
i2c-scl-falling-time-ns = <7>;
status = "okay";
/delete-property/dmas;
/delete-property/dma-names;
mcp4725@60 {
compatible = "microchip,mcp4725";
reg = <0x60>;
vdd-supply = <&v3v3>;
};
};
CM4使用I2C
&i2c1 {
status = "disabled";
};
&m4_i2c1 {
pinctrl-names = "rproc_default";
pinctrl-0 = <&i2c1_pins_a>;
status = "okay";
};
最后编辑:SteveChen 更新时间:2024-09-18 14:57