<h3>Contribution description</h3>
<p>This commit enhances the I2C code of the nRF52 family to block on a<br>
mutex while the I2C transfer is busy. The mutex is unlocked in the ISR<br>
when it is trigger by either a stop condition or an error condition.</p>
<p>While the current code already allows the MCU to sleep during the transfer, this enhancement allows the RIOT scheduler to schedule other (lower priority) threads during the transfer.</p>
<h3>Testing procedure</h3>
<p>I2C operations should still work, any connected peripheral such as an BME280 must still function as before.</p>
<p><a class="user-mention" data-hovercard-type="user" data-hovercard-url="/users/MrKevinWeiss/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/MrKevinWeiss">@MrKevinWeiss</a> Do you have the time and hardware to give this a shot with RIOT-HIL?</p>
<h3>Issues/PRs references</h3>
<p>None</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/RIOT-OS/RIOT/pull/14165'>https://github.com/RIOT-OS/RIOT/pull/14165</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>nrf52/i2c: Use mutex and IRQ for blocking</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/14165/files#diff-cd412c50a4c7ced08ffcb9064a530b7a">cpu/nrf52/periph/i2c.c</a>
    (29)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/RIOT-OS/RIOT/pull/14165.patch'>https://github.com/RIOT-OS/RIOT/pull/14165.patch</a></li>
  <li><a href='https://github.com/RIOT-OS/RIOT/pull/14165.diff'>https://github.com/RIOT-OS/RIOT/pull/14165.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/14165">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYHAY6YYNZBEX7IDYOLRT5R4HANCNFSM4NNZXO3A">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABE7WYFFIEX3NA67PRMSCTDRT5R4HA5CNFSM4NNZXO3KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4JLAKLVQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/14165",
"url": "https://github.com/RIOT-OS/RIOT/pull/14165",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>