Skip to content
Snippets Groups Projects
Commit 5ab2297b authored by Peter Kietzmann's avatar Peter Kietzmann
Browse files

samd21/i2c: wait for bus idle after stop condition

parent fe7f173b
No related branches found
No related tags found
No related merge requests found
...@@ -489,6 +489,8 @@ static inline void _stop(SercomI2cm *dev) ...@@ -489,6 +489,8 @@ static inline void _stop(SercomI2cm *dev)
while(dev->SYNCBUSY.reg & SERCOM_I2CM_SYNCBUSY_MASK) {} while(dev->SYNCBUSY.reg & SERCOM_I2CM_SYNCBUSY_MASK) {}
/* Stop command */ /* Stop command */
dev->CTRLB.reg |= SERCOM_I2CM_CTRLB_CMD(3); dev->CTRLB.reg |= SERCOM_I2CM_CTRLB_CMD(3);
/* Wait for bus to be idle again */
while(dev->STATUS.reg & SERCOM_I2CM_STATUS_BUSSTATE(1)) {}
DEBUG("Stop sent\n"); DEBUG("Stop sent\n");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment