Skip to content

Allow re-initialising an I2C peripheral on Silicon Labs targets #11011

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions targets/TARGET_Silicon_Labs/TARGET_EFM32/i2c_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ void i2c_init(i2c_t *obj, PinName sda, PinName scl)

/* Initializing the I2C */
/* Using default settings */
i2c_reset(obj);
I2C_Init_TypeDef i2cInit = I2C_INIT_DEFAULT;
I2C_Init(obj->i2c.i2c, &i2cInit);

Expand Down Expand Up @@ -315,6 +316,8 @@ int i2c_write(i2c_t *obj, int address, const char *data, int length, int stop)

void i2c_reset(i2c_t *obj)
{
i2c_enable_interrupt(obj, 0, false);
i2c_enable(obj, false);
/* EMLib function */
I2C_Reset(obj->i2c.i2c);
}
Expand Down