Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into cram-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
bunnie committed Feb 1, 2025
2 parents 8518743 + 1b18152 commit 935a11b
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions libs/cramium-hal/src/udma/i2c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,6 @@ impl<'a> I2c<'a> {
}

pub fn reset(&mut self) {
// reset the block
self.udma_reset(Bank::Custom);
self.udma_reset(Bank::Tx);
self.udma_reset(Bank::Rx);
// reset the block, if MPW. If NTO, this needs to be handled by the upper level code with a
// reset to udma_global
#[cfg(feature = "mpw")]
Expand All @@ -323,6 +319,19 @@ impl<'a> I2c<'a> {
I2cChannel::Channel3 => PeriphId::I2c3,
});
}
for _i in 0..20 {
// dummy read
let _ = self.csr.rf(utra::udma_i2c_0::REG_STATUS_R_BUSY);
}
// reset the block
self.udma_reset(Bank::Custom);
self.udma_reset(Bank::Tx);
self.udma_reset(Bank::Rx);

for _i in 0..20 {
// dummy read
let _ = self.csr.rf(utra::udma_i2c_0::REG_STATUS_R_BUSY);
}

self.send_cmd_list(&[I2cCmd::Config(self.divider)]);
self.pending.take();
Expand Down

0 comments on commit 935a11b

Please sign in to comment.