stm32h7-sdmmc
Hardware Abstraction Layer for 'Secure' digital input/output MultiMediaCard interface (SDMMC) on the STM32H7.
This crate depends on the GPIO and Clock functionality from
stm32h7xx-hal
.
SDMMC
The H7 has two SDMMC peripherals, SDMMC1
and SDMMC2
.
IO Setup
For high speed signalling (bus clock > 16MHz), the IO speed needs to be increased from the default.
use Speed;
let d0 = d0.set_speed;
Usage
By default the SDMMC bus clock is derived from the pll1_q_ck
. This can be
set when initialising the RCC.
let ccdr = rcc
.pll1_q_ck
.freeze;
There is an extension trait implemented for the SDMMC1
and SDMMC2
periperhals for easy initialisation.
// Create SDMMC
let mut sdmmc = dp.SDMMC1.sdmmc;
The next step is to initialise a card. The bus speed is also set.
if let Err = sdmmc.init_card
The card()
method returns useful information about
the card.
let card = sdmmc.card;
if let Some = sdmmc.card
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
License: MIT/Apache-2.0