Skip to content

Commit

Permalink
Merge pull request #764 from stm32-rs/sdio446
Browse files Browse the repository at this point in the history
enable sdio for f446
  • Loading branch information
burrbull authored Jun 12, 2024
2 parents 8420580 + 5a9f081 commit 4ca768f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Added

- `i2c_scanner` example [#758]
- Enable `sdio` for stm32f446
- port LTDC implementation and example from stm32f7xx-hal [#731]
- IrDA mode for USARTs

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ gpio-f446 = [
"otg-hs",
"sai1",
"sai2",
#"sdio",
"sdio",
"spi3",
"spi4",
"spdifrx",
Expand Down
7 changes: 6 additions & 1 deletion src/sdio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,10 @@ impl<P: SdioPeripheral> Sdio<P> {
self.sdio.dlen().write(|w| w.datalength().set(length_bytes));
// Transfer
self.sdio.dctrl().write(|w| {
w.dblocksize().set(block_size); // 2^n bytes block size
#[allow(unused_unsafe)]
unsafe {
w.dblocksize().bits(block_size);
} // 2^n bytes block size
w.dtdir().variant(dtdir);
w.dten().enabled() // Enable transfer
});
Expand Down Expand Up @@ -755,6 +758,7 @@ fn clear_all_interrupts(icr: &pac::sdio::ICR) {
icr.modify(|_, w| {
w.ccrcfailc().set_bit();
w.ctimeoutc().set_bit();
#[cfg(not(feature = "stm32f446"))]
w.ceataendc().set_bit();
w.cmdrendc().set_bit();
w.cmdsentc().set_bit();
Expand All @@ -763,6 +767,7 @@ fn clear_all_interrupts(icr: &pac::sdio::ICR) {
w.dcrcfailc().set_bit();
w.dtimeoutc().set_bit();
w.sdioitc().set_bit();
#[cfg(not(feature = "stm32f446"))]
w.stbiterrc().set_bit();
w.rxoverrc().set_bit();
w.txunderrc().set_bit()
Expand Down

0 comments on commit 4ca768f

Please sign in to comment.