Skip to content

Commit

Permalink
Add support I2C #3 (#ifdef I2C2) for target EFM32G11
Browse files Browse the repository at this point in the history
  • Loading branch information
petroborys authored and Arto Kinnunen committed Jul 3, 2019
1 parent 54b9dad commit de38aa9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions targets/TARGET_Silicon_Labs/TARGET_EFM32/i2c_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ static uint8_t i2c_get_index(i2c_t *obj)
case I2C_1:
index = 1;
break;
#endif
#ifdef I2C2
case I2C_2:
index = 2;
break;
#endif
default:
printf("I2C module not available.. Out of bound access.");
Expand All @@ -83,6 +88,11 @@ static CMU_Clock_TypeDef i2c_get_clock(i2c_t *obj)
case I2C_1:
clock = cmuClock_I2C1;
break;
#endif
#ifdef I2C2
case I2C_2:
clock = cmuClock_I2C2;
break;
#endif
default:
printf("I2C module not available.. Out of bound access. (clock)");
Expand Down Expand Up @@ -174,6 +184,11 @@ void i2c_enable_interrupt(i2c_t *obj, uint32_t address, uint8_t enable)
case 1:
irq_number = I2C1_IRQn;
break;
#endif
#ifdef I2C2
case 2:
irq_number = I2C2_IRQn;
break;
#endif
}

Expand Down

0 comments on commit de38aa9

Please sign in to comment.