Skip to content

Commit c685b6e

Browse files
author
petroborys
committed
Add support I2C ARMmbed#3 (#ifdef I2C2) for target EFM32G11
1 parent b635c02 commit c685b6e

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
@@ -63,6 +63,11 @@ static uint8_t i2c_get_index(i2c_t *obj)
6363
case I2C_1:
6464
index = 1;
6565
break;
66+
#endif
67+
#ifdef I2C2
68+
case I2C_2:
69+
index = 2;
70+
break;
6671
#endif
6772
default:
6873
printf("I2C module not available.. Out of bound access.");
@@ -84,6 +89,11 @@ static CMU_Clock_TypeDef i2c_get_clock(i2c_t *obj)
8489
case I2C_1:
8590
clock = cmuClock_I2C1;
8691
break;
92+
#endif
93+
#ifdef I2C2
94+
case I2C_2:
95+
clock = cmuClock_I2C2;
96+
break;
8797
#endif
8898
default:
8999
printf("I2C module not available.. Out of bound access. (clock)");
@@ -175,6 +185,11 @@ void i2c_enable_interrupt(i2c_t *obj, uint32_t address, uint8_t enable)
175185
case 1:
176186
irq_number = I2C1_IRQn;
177187
break;
188+
#endif
189+
#ifdef I2C2
190+
case 2:
191+
irq_number = I2C2_IRQn;
192+
break;
178193
#endif
179194
}
180195

0 commit comments

Comments
 (0)