diff --git a/boards/saml21-xpro/Makefile.features b/boards/saml21-xpro/Makefile.features index 87ef694149..8f680caccf 100644 --- a/boards/saml21-xpro/Makefile.features +++ b/boards/saml21-xpro/Makefile.features @@ -3,6 +3,7 @@ FEATURES_PROVIDED += periph_adc FEATURES_PROVIDED += periph_cpuid FEATURES_PROVIDED += periph_flashpage FEATURES_PROVIDED += periph_gpio +FEATURES_PROVIDED += periph_i2c FEATURES_PROVIDED += periph_rtc FEATURES_PROVIDED += periph_rtt FEATURES_PROVIDED += periph_spi diff --git a/boards/saml21-xpro/include/periph_conf.h b/boards/saml21-xpro/include/periph_conf.h index 33f41658d9..2a06a98398 100644 --- a/boards/saml21-xpro/include/periph_conf.h +++ b/boards/saml21-xpro/include/periph_conf.h @@ -96,7 +96,23 @@ static const spi_conf_t spi_config[] = { * @name I2C configuration * @{ */ -#define I2C_NUMOF (0) +#define I2C_NUMOF (1U) +#define I2C_0_EN 1 +#define I2C_1_EN 0 +#define I2C_2_EN 0 +#define I2C_3_EN 0 +#define I2C_IRQ_PRIO 1 + +#define I2C_0_DEV SERCOM2->I2CM +#define I2C_0_IRQ SERCOM2_IRQn +#define I2C_0_ISR isr_sercom2 +/* I2C 0 GCLK */ +#define I2C_0_GCLK_ID SERCOM2_GCLK_ID_CORE +#define I2C_0_GCLK_ID_SLOW SERCOM2_GCLK_ID_SLOW +/* I2C 0 pin configuration */ +#define I2C_0_SDA GPIO_PIN(PA, 8) +#define I2C_0_SCL GPIO_PIN(PA, 9) +#define I2C_0_MUX GPIO_MUX_D /** @} */ /**