1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 05:32:45 +01:00

boards: efm32: adapt to new i2c interface.

This commit is contained in:
Bas Stottelaar 2018-05-27 21:45:07 +02:00 committed by dylad
parent e8a76acea5
commit 0541b5c449
6 changed files with 15 additions and 11 deletions

View File

@ -61,8 +61,6 @@ void pic_init(void)
{
gpio_init(PIC_INT_WAKE_PIN, GPIO_OD);
gpio_set(PIC_INT_WAKE_PIN);
i2c_init_master(PIC_I2C, I2C_SPEED_NORMAL);
}
void pic_write(uint8_t addr, uint8_t value)
@ -74,7 +72,7 @@ void pic_write(uint8_t addr, uint8_t value)
/* write to gpio expander */
i2c_acquire(PIC_I2C);
uint8_t bytes[] = { addr, value };
i2c_write_bytes(PIC_I2C, PIC_I2C_ADDR, bytes, 2);
i2c_write_bytes(PIC_I2C, PIC_I2C_ADDR, bytes, 2, 0);
i2c_release(PIC_I2C);
/* put PIC in sleep mode again */

View File

@ -96,7 +96,8 @@ static const i2c_conf_t i2c_config[] = {
.loc = I2C_ROUTELOC0_SDALOC_LOC15 |
I2C_ROUTELOC0_SCLLOC_LOC15,
.cmu = cmuClock_I2C0,
.irq = I2C0_IRQn
.irq = I2C0_IRQn,
.speed = I2C_SPEED_NORMAL
}
};

View File

@ -96,8 +96,8 @@ static const i2c_conf_t i2c_config[] = {
.loc = I2C_ROUTELOC0_SDALOC_LOC15 |
I2C_ROUTELOC0_SCLLOC_LOC15,
.cmu = cmuClock_I2C0,
.irq = I2C0_IRQn
.irq = I2C0_IRQn,
.speed = I2C_SPEED_NORMAL
}
};

View File

@ -98,7 +98,8 @@ static const i2c_conf_t i2c_config[] = {
.loc = I2C_ROUTELOC0_SDALOC_LOC16 |
I2C_ROUTELOC0_SCLLOC_LOC14,
.cmu = cmuClock_I2C0,
.irq = I2C0_IRQn
.irq = I2C0_IRQn,
.speed = I2C_SPEED_NORMAL
}
};

View File

@ -115,7 +115,8 @@ static const i2c_conf_t i2c_config[] = {
.scl_pin = GPIO_PIN(PD, 7),
.loc = I2C_ROUTE_LOCATION_LOC1,
.cmu = cmuClock_I2C0,
.irq = I2C0_IRQn
.irq = I2C0_IRQn,
.speed = I2C_SPEED_NORMAL
},
{
.dev = I2C1,
@ -123,7 +124,8 @@ static const i2c_conf_t i2c_config[] = {
.scl_pin = GPIO_PIN(PC, 5),
.loc = I2C_ROUTE_LOCATION_LOC0,
.cmu = cmuClock_I2C1,
.irq = I2C1_IRQn
.irq = I2C1_IRQn,
.speed = I2C_SPEED_NORMAL
}
};

View File

@ -115,7 +115,8 @@ static const i2c_conf_t i2c_config[] = {
.scl_pin = GPIO_PIN(PD, 7),
.loc = I2C_ROUTE_LOCATION_LOC1,
.cmu = cmuClock_I2C0,
.irq = I2C0_IRQn
.irq = I2C0_IRQn,
.speed = I2C_SPEED_NORMAL
},
{
.dev = I2C1,
@ -123,7 +124,8 @@ static const i2c_conf_t i2c_config[] = {
.scl_pin = GPIO_PIN(PC, 5),
.loc = I2C_ROUTE_LOCATION_LOC0,
.cmu = cmuClock_I2C1,
.irq = I2C1_IRQn
.irq = I2C1_IRQn,
.speed = I2C_SPEED_NORMAL
}
};