This driver supports Master and Slave modes.
Hardware resource relating to driver instance is shown in the table below:
Driver Instance | Hardware Resource |
---|---|
Driver_I2C1 | I2C1 |
Driver_I2C2 | I2C2 |
Driver_I2C3 | I2C3 |
Driver_I2C4 | I2C4 |
Definitions used for compile-time configuration of this driver are shown in the table below:
Definition | Default value | Value | Description |
---|---|---|---|
I2C1_ANF_ENABLE | 0 | 0 | I2C1 analog noise filter: disabled |
1 | I2C1 analog noise filter: enabled | ||
I2C2_ANF_ENABLE | 0 | 0 | I2C2 analog noise filter: disabled |
1 | I2C2 analog noise filter: enabled | ||
I2C3_ANF_ENABLE | 0 | 0 | I2C3 analog noise filter: disabled |
1 | I2C3 analog noise filter: enabled | ||
I2C4_ANF_ENABLE | 0 | 0 | I2C4 analog noise filter: disabled |
1 | I2C4 analog noise filter: enabled | ||
I2C1_DNF_COEFFICIENT | 0 | 0 | I2C1 digital noise filter coefficient: disabled |
1..15 | I2C1 digital noise filter coefficient number | ||
I2C2_DNF_COEFFICIENT | 0 | 0 | I2C2 digital noise filter coefficient: disabled |
1..15 | I2C2 digital noise filter coefficient number | ||
I2C3_DNF_COEFFICIENT | 0 | 0 | I2C3 digital noise filter coefficient: disabled |
1..15 | I2C3 digital noise filter coefficient number | ||
I2C4_DNF_COEFFICIENT | 0 | 0 | I2C4 digital noise filter coefficient: disabled |
1..15 | I2C4 digital noise filter coefficient number |
The I2C driver requires:
These settings are relevant for this board, for different board please refer to the board schematic for proper configuration.
Link to NUCLEO-H563ZI board schematic.
Required peripherals for the NUCLEO-H563ZI board are listed in the table below:
Peripheral | Mode | Description |
---|---|---|
I2C4 | I2C | I2C4 Controller |
PB8 | Alternate Function Push Pull | I2C4 SCL Pin |
PB9 | Alternate Function Push Pull | I2C4 SDA Pin |
Pin | Functionality |
---|---|
PB8 | I2C4_SCL |
PB9 | I2C4_SDA |
Under Categories: Connectivity select I2C4:
Mode:
Configuration:
Pin Name | Signal on Pin | Pin Context.. | GPIO output.. | GPIO mode | GPIO Pull-up/Pull.. | Maximum out.. | Fast Mode | User Label |
---|---|---|---|---|---|---|---|---|
PB8 | I2C4_SCL | n/a | n/a | Alternate Function Push Pull | No pull-up and no.. | Low | n/a | . |
PB9 | I2C4_SDA | n/a | n/a | Alternate Function Push Pull | No pull-up and no.. | Low | n/a | . |
Under Categories: System Core select GPDMA1:
Mode:
Configuration:
Under Categories: System Core select NVIC:
Configuration:
NVIC Interrupt Table | Enabled | Preemption Priority | Sub Priority |
---|---|---|---|
GPDMA1 Channel 0 global interrupt | checked | 0 | 0 |
GPDMA1 Channel 1 global interrupt | checked | 0 | 0 |
I2C4 event interrupt | checked | 0 | 0 |
I2C4 error interrupt | checked | 0 | 0 |
Enabled interrupt table | Select for.. | Generate Enable in.. | Generate IRQ h.. | Call HAL handler |
---|---|---|---|---|
GPDMA1 Channel 0 global interrupt | unchecked | checked | checked | checked |
GPDMA1 Channel 1 global interrupt | unchecked | checked | checked | checked |
I2C4 event interrupt | unchecked | checked | checked | checked |
I2C4 error interrupt | unchecked | checked | checked | checked |
Under Advanced Settings:
Generated Function Calls:
Generate Code | Function Name | Peripheral Inst.. | Do not generate .. | Visibility (Static) |
---|---|---|---|---|
checked | MX_I2C4_Init | I2C4 | checked | checked |
Generate source code by clicking on the GENERATE CODE button on the toolbar.
Results of the CMSIS-Driver Validation for this driver can be found in the I2C_TestReport.txt file.