Merge pull request #10757 from petroborys/master

Add support I2C 3 for target EFM32G11
pull/10776/head
Martin Kojtal 2019-06-09 18:19:42 +01:00 committed by GitHub
commit dbe274ccf0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 0 deletions

View File

@ -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.");
@ -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)");
@ -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
}