mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
sam0/i2c: update sam0 based periph_conf
Signed-off-by: dylad <dylan.laduranty@mesotic.com>
This commit is contained in:
parent
ef8ed2620c
commit
93558125b5
@ -200,23 +200,21 @@ static const spi_conf_t spi_config[] = {
|
||||
* @name I2C configuration
|
||||
* @{
|
||||
*/
|
||||
#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 SERCOM3->I2CM
|
||||
#define I2C_0_IRQ SERCOM3_IRQn
|
||||
#define I2C_0_ISR isr_sercom3
|
||||
/* I2C 0 GCLK */
|
||||
#define I2C_0_GCLK_ID SERCOM3_GCLK_ID_CORE
|
||||
#define I2C_0_GCLK_ID_SLOW SERCOM3_GCLK_ID_SLOW
|
||||
/* I2C 0 pin configuration */
|
||||
#define I2C_0_SDA GPIO_PIN(PA, 22)
|
||||
#define I2C_0_SCL GPIO_PIN(PA, 23)
|
||||
#define I2C_0_MUX GPIO_MUX_C
|
||||
static const i2c_conf_t i2c_config[] = {
|
||||
{
|
||||
.dev = &(SERCOM3->I2CM),
|
||||
.speed = I2C_SPEED_FAST,
|
||||
.sda_pin = GPIO_PIN(PA, 22),
|
||||
.scl_pin = GPIO_PIN(PA, 23),
|
||||
.mux = GPIO_MUX_C,
|
||||
.gclk_src = GCLK_CLKCTRL_GEN_GCLK0,
|
||||
.flags = I2C_FLAG_NONE
|
||||
}
|
||||
};
|
||||
|
||||
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name RTC configuration
|
||||
|
@ -214,23 +214,18 @@ static const spi_conf_t spi_config[] = {
|
||||
* @name I2C configuration
|
||||
* @{
|
||||
*/
|
||||
#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 SERCOM0->I2CM
|
||||
#define I2C_0_IRQ SERCOM0_IRQn
|
||||
#define I2C_0_ISR isr_sercom0
|
||||
/* I2C 0 GCLK */
|
||||
#define I2C_0_GCLK_ID SERCOM0_GCLK_ID_CORE
|
||||
#define I2C_0_GCLK_ID_SLOW SERCOM0_GCLK_ID_SLOW
|
||||
/* I2C 0 pin configuration */
|
||||
#define I2C_0_SDA GPIO_PIN(PA, 8) /* SERCOM0-SDA, on-board pull-up */
|
||||
#define I2C_0_SCL GPIO_PIN(PA, 9) /* SERCOM0-SCL, on-board pull-up */
|
||||
#define I2C_0_MUX GPIO_MUX_C
|
||||
static const i2c_conf_t i2c_config[] = {
|
||||
{
|
||||
.dev = &(SERCOM0->I2CM),
|
||||
.speed = I2C_SPEED_NORMAL,
|
||||
.sda_pin = GPIO_PIN(PA, 8),
|
||||
.scl_pin = GPIO_PIN(PA, 9),
|
||||
.mux = GPIO_MUX_C,
|
||||
.gclk_src = GCLK_CLKCTRL_GEN_GCLK0,
|
||||
.flags = I2C_FLAG_NONE
|
||||
}
|
||||
};
|
||||
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
|
@ -208,23 +208,18 @@ static const spi_conf_t spi_config[] = {
|
||||
* @name I2C configuration
|
||||
* @{
|
||||
*/
|
||||
#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 SERCOM3->I2CM
|
||||
#define I2C_0_IRQ SERCOM3_IRQn
|
||||
#define I2C_0_ISR isr_sercom3
|
||||
/* I2C 0 GCLK */
|
||||
#define I2C_0_GCLK_ID SERCOM3_GCLK_ID_CORE
|
||||
#define I2C_0_GCLK_ID_SLOW SERCOM3_GCLK_ID_SLOW
|
||||
/* I2C 0 pin configuration */
|
||||
#define I2C_0_SDA GPIO_PIN(PA, 22) /* SDA pin */
|
||||
#define I2C_0_SCL GPIO_PIN(PA, 23) /* SCL pin */
|
||||
#define I2C_0_MUX GPIO_MUX_C
|
||||
static const i2c_conf_t i2c_config[] = {
|
||||
{
|
||||
.dev = &(SERCOM3->I2CM),
|
||||
.speed = I2C_SPEED_NORMAL,
|
||||
.sda_pin = GPIO_PIN(PA, 22),
|
||||
.scl_pin = GPIO_PIN(PA, 23),
|
||||
.mux = GPIO_MUX_C,
|
||||
.gclk_src = GCLK_CLKCTRL_GEN_GCLK0,
|
||||
.flags = I2C_FLAG_NONE
|
||||
}
|
||||
};
|
||||
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
|
@ -240,23 +240,19 @@ static const spi_conf_t spi_config[] = {
|
||||
* @name I2C configuration
|
||||
* @{
|
||||
*/
|
||||
#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
|
||||
static const i2c_conf_t i2c_config[] = {
|
||||
{
|
||||
.dev = &(SERCOM2->I2CM),
|
||||
.speed = I2C_SPEED_NORMAL,
|
||||
.sda_pin = GPIO_PIN(PA, 8),
|
||||
.scl_pin = GPIO_PIN(PA, 9),
|
||||
.mux = GPIO_MUX_D,
|
||||
.gclk_src = GCLK_CLKCTRL_GEN_GCLK0,
|
||||
.flags = I2C_FLAG_NONE
|
||||
}
|
||||
};
|
||||
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name RTC configuration
|
||||
|
@ -108,23 +108,19 @@ static const spi_conf_t spi_config[] = {
|
||||
* @name I2C configuration
|
||||
* @{
|
||||
*/
|
||||
#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
|
||||
static const i2c_conf_t i2c_config[] = {
|
||||
{
|
||||
.dev = &(SERCOM2->I2CM),
|
||||
.speed = I2C_SPEED_NORMAL,
|
||||
.sda_pin = GPIO_PIN(PA, 8),
|
||||
.scl_pin = GPIO_PIN(PA, 9),
|
||||
.mux = GPIO_MUX_D,
|
||||
.gclk_src = GCLK_PCHCTRL_GEN_GCLK0,
|
||||
.flags = I2C_FLAG_NONE
|
||||
}
|
||||
};
|
||||
|
||||
#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
|
||||
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
|
@ -211,23 +211,19 @@ static const spi_conf_t spi_config[] = {
|
||||
* @name I2C configuration
|
||||
* @{
|
||||
*/
|
||||
#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 SERCOM3->I2CM
|
||||
#define I2C_0_IRQ SERCOM3_IRQn
|
||||
#define I2C_0_ISR isr_sercom3
|
||||
/* I2C 0 GCLK */
|
||||
#define I2C_0_GCLK_ID SERCOM3_GCLK_ID_CORE
|
||||
#define I2C_0_GCLK_ID_SLOW SERCOM3_GCLK_ID_SLOW
|
||||
/* I2C 0 pin configuration */
|
||||
#define I2C_0_SDA GPIO_PIN(PA, 16)
|
||||
#define I2C_0_SCL GPIO_PIN(PA, 17)
|
||||
#define I2C_0_MUX GPIO_MUX_D
|
||||
static const i2c_conf_t i2c_config[] = {
|
||||
{
|
||||
.dev = &(SERCOM3->I2CM),
|
||||
.speed = I2C_SPEED_NORMAL,
|
||||
.sda_pin = GPIO_PIN(PA, 16),
|
||||
.scl_pin = GPIO_PIN(PA, 17),
|
||||
.mux = GPIO_MUX_D,
|
||||
.gclk_src = GCLK_CLKCTRL_GEN_GCLK0,
|
||||
.flags = I2C_FLAG_NONE
|
||||
}
|
||||
};
|
||||
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name RTC configuration
|
||||
|
@ -213,23 +213,19 @@ static const spi_conf_t spi_config[] = {
|
||||
* @name I2C configuration
|
||||
* @{
|
||||
*/
|
||||
#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, 12)
|
||||
#define I2C_0_SCL GPIO_PIN(PA, 13)
|
||||
#define I2C_0_MUX GPIO_MUX_C
|
||||
static const i2c_conf_t i2c_config[] = {
|
||||
{
|
||||
.dev = &(SERCOM2->I2CM),
|
||||
.speed = I2C_SPEED_NORMAL,
|
||||
.sda_pin = GPIO_PIN(PA, 12),
|
||||
.scl_pin = GPIO_PIN(PA, 13),
|
||||
.mux = GPIO_MUX_C,
|
||||
.gclk_src = GCLK_CLKCTRL_GEN_GCLK0,
|
||||
.flags = I2C_FLAG_NONE
|
||||
}
|
||||
};
|
||||
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name RTC configuration
|
||||
|
@ -196,34 +196,28 @@ static const spi_conf_t spi_config[] = {
|
||||
* @name I2C configuration
|
||||
* @{
|
||||
*/
|
||||
#define I2C_NUMOF (2U)
|
||||
#define I2C_0_EN 1
|
||||
#define I2C_1_EN 1
|
||||
#define I2C_2_EN 0
|
||||
#define I2C_3_EN 0
|
||||
#define I2C_IRQ_PRIO 1
|
||||
static const i2c_conf_t i2c_config[] = {
|
||||
{
|
||||
.dev = &(SERCOM1->I2CM),
|
||||
.speed = I2C_SPEED_NORMAL,
|
||||
.sda_pin = GPIO_PIN(PA, 16),
|
||||
.scl_pin = GPIO_PIN(PA, 17),
|
||||
.mux = GPIO_MUX_C,
|
||||
.gclk_src = GCLK_CLKCTRL_GEN_GCLK0,
|
||||
.flags = I2C_FLAG_NONE,
|
||||
},
|
||||
{
|
||||
.dev = &(SERCOM2->I2CM),
|
||||
.speed = I2C_SPEED_NORMAL,
|
||||
.sda_pin = GPIO_PIN(PA, 8),
|
||||
.scl_pin = GPIO_PIN(PA, 9),
|
||||
.mux = GPIO_MUX_C,
|
||||
.gclk_src = GCLK_CLKCTRL_GEN_GCLK0,
|
||||
.flags = I2C_FLAG_NONE
|
||||
}
|
||||
};
|
||||
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
|
||||
|
||||
#define I2C_0_DEV SERCOM1->I2CM
|
||||
#define I2C_0_IRQ SERCOM1_IRQn
|
||||
#define I2C_0_ISR isr_sercom1
|
||||
/* I2C 0 GCLK */
|
||||
#define I2C_0_GCLK_ID SERCOM1_GCLK_ID_CORE
|
||||
#define I2C_0_GCLK_ID_SLOW SERCOM1_GCLK_ID_SLOW
|
||||
/* I2C 0 pin configuration */
|
||||
#define I2C_0_SDA GPIO_PIN(PA, 16)
|
||||
#define I2C_0_SCL GPIO_PIN(PA, 17)
|
||||
#define I2C_0_MUX GPIO_MUX_C
|
||||
|
||||
#define I2C_1_DEV SERCOM2->I2CM
|
||||
#define I2C_1_IRQ SERCOM2_IRQn
|
||||
#define I2C_1_ISR isr_sercom2
|
||||
/* I2C 1 GCLK */
|
||||
#define I2C_1_GCLK_ID SERCOM2_GCLK_ID_CORE
|
||||
#define I2C_1_GCLK_ID_SLOW SERCOM2_GCLK_ID_SLOW
|
||||
/* I2C 1 pin configuration */
|
||||
#define I2C_1_SDA GPIO_PIN(PA, 8)
|
||||
#define I2C_1_SCL GPIO_PIN(PA, 9)
|
||||
#define I2C_1_MUX GPIO_MUX_C
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user