Browse Source

boards/saml21-xpro: add i2c configuration

master
Antonio Galea 6 years ago committed by Alexandre Abadie
parent
commit
7913d19250
  1. 1
      boards/saml21-xpro/Makefile.features
  2. 18
      boards/saml21-xpro/include/periph_conf.h

1
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

18
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
/** @} */
/**

Loading…
Cancel
Save