Skip to content

Commit de38aa9

Browse files
petroborysArto Kinnunen
authored andcommitted
Add support I2C #3 (#ifdef I2C2) for target EFM32G11
1 parent 54b9dad commit de38aa9

File tree

1 file changed

+15
-0
lines changed
  • targets/TARGET_Silicon_Labs/TARGET_EFM32

1 file changed

+15
-0
lines changed

targets/TARGET_Silicon_Labs/TARGET_EFM32/i2c_api.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ static uint8_t i2c_get_index(i2c_t *obj)
6262
case I2C_1:
6363
index = 1;
6464
break;
65+
#endif
66+
#ifdef I2C2
67+
case I2C_2:
68+
index = 2;
69+
break;
6570
#endif
6671
default:
6772
printf("I2C module not available.. Out of bound access.");
@@ -83,6 +88,11 @@ static CMU_Clock_TypeDef i2c_get_clock(i2c_t *obj)
8388
case I2C_1:
8489
clock = cmuClock_I2C1;
8590
break;
91+
#endif
92+
#ifdef I2C2
93+
case I2C_2:
94+
clock = cmuClock_I2C2;
95+
break;
8696
#endif
8797
default:
8898
printf("I2C module not available.. Out of bound access. (clock)");
@@ -174,6 +184,11 @@ void i2c_enable_interrupt(i2c_t *obj, uint32_t address, uint8_t enable)
174184
case 1:
175185
irq_number = I2C1_IRQn;
176186
break;
187+
#endif
188+
#ifdef I2C2
189+
case 2:
190+
irq_number = I2C2_IRQn;
191+
break;
177192
#endif
178193
}
179194

0 commit comments

Comments
 (0)