#[repr(C)]pub struct sdmmc_host_t {Show 26 fields
pub flags: u32,
pub slot: c_int,
pub max_freq_khz: c_int,
pub io_voltage: f32,
pub driver_strength: sdmmc_driver_strength_t,
pub current_limit: sdmmc_current_limit_t,
pub init: Option<unsafe extern "C" fn() -> esp_err_t>,
pub set_bus_width: Option<unsafe extern "C" fn(slot: c_int, width: usize) -> esp_err_t>,
pub get_bus_width: Option<unsafe extern "C" fn(slot: c_int) -> usize>,
pub set_bus_ddr_mode: Option<unsafe extern "C" fn(slot: c_int, ddr_enable: bool) -> esp_err_t>,
pub set_card_clk: Option<unsafe extern "C" fn(slot: c_int, freq_khz: u32) -> esp_err_t>,
pub set_cclk_always_on: Option<unsafe extern "C" fn(slot: c_int, cclk_always_on: bool) -> esp_err_t>,
pub do_transaction: Option<unsafe extern "C" fn(slot: c_int, cmdinfo: *mut sdmmc_command_t) -> esp_err_t>,
pub __bindgen_anon_1: sdmmc_host_t__bindgen_ty_1,
pub io_int_enable: Option<unsafe extern "C" fn(slot: c_int) -> esp_err_t>,
pub io_int_wait: Option<unsafe extern "C" fn(slot: c_int, timeout_ticks: TickType_t) -> esp_err_t>,
pub command_timeout_ms: c_int,
pub get_real_freq: Option<unsafe extern "C" fn(slot: c_int, real_freq: *mut c_int) -> esp_err_t>,
pub input_delay_phase: sdmmc_delay_phase_t,
pub set_input_delay: Option<unsafe extern "C" fn(slot: c_int, delay_phase: sdmmc_delay_phase_t) -> esp_err_t>,
pub unaligned_multi_block_rw_max_chunk_size: usize,
pub dma_aligned_buffer: *mut c_void,
pub pwr_ctrl_handle: sd_pwr_ctrl_handle_t,
pub get_dma_info: Option<unsafe extern "C" fn(slot: c_int, dma_mem_info: *mut esp_dma_mem_info_t) -> esp_err_t>,
pub check_buffer_alignment: Option<unsafe extern "C" fn(slot: c_int, buf: *const c_void, size: usize) -> bool>,
pub is_slot_set_to_uhs1: Option<unsafe extern "C" fn(slot: c_int, is_uhs1: *mut bool) -> esp_err_t>,
}Expand description
SD/MMC Host description
This structure defines properties of SD/MMC host and functions of SD/MMC host which can be used by upper layers.
Fields§
§flags: u32< flags defining host properties
slot: c_int< slot number, to be passed to host functions
max_freq_khz: c_int< max frequency supported by the host
io_voltage: f32< I/O voltage used by the controller (voltage switching is not supported)
driver_strength: sdmmc_driver_strength_t< Driver Strength
current_limit: sdmmc_current_limit_t< Current Limit
init: Option<unsafe extern "C" fn() -> esp_err_t>< Host function to initialize the driver
set_bus_width: Option<unsafe extern "C" fn(slot: c_int, width: usize) -> esp_err_t>< host function to set bus width
get_bus_width: Option<unsafe extern "C" fn(slot: c_int) -> usize>< host function to get bus width
set_bus_ddr_mode: Option<unsafe extern "C" fn(slot: c_int, ddr_enable: bool) -> esp_err_t>< host function to set DDR mode
set_card_clk: Option<unsafe extern "C" fn(slot: c_int, freq_khz: u32) -> esp_err_t>< host function to set card clock frequency
set_cclk_always_on: Option<unsafe extern "C" fn(slot: c_int, cclk_always_on: bool) -> esp_err_t>< host function to set whether the clock is always enabled
do_transaction: Option<unsafe extern "C" fn(slot: c_int, cmdinfo: *mut sdmmc_command_t) -> esp_err_t>< host function to do a transaction
__bindgen_anon_1: sdmmc_host_t__bindgen_ty_1§io_int_enable: Option<unsafe extern "C" fn(slot: c_int) -> esp_err_t>< Host function to enable SDIO interrupt line
io_int_wait: Option<unsafe extern "C" fn(slot: c_int, timeout_ticks: TickType_t) -> esp_err_t>< Host function to wait for SDIO interrupt line to be active
command_timeout_ms: c_int< timeout, in milliseconds, of a single command. Set to 0 to use the default value.
get_real_freq: Option<unsafe extern "C" fn(slot: c_int, real_freq: *mut c_int) -> esp_err_t>< Host function to provide real working freq, based on SDMMC controller setup
input_delay_phase: sdmmc_delay_phase_t< input delay phase, this will only take into effect when the host works in SDMMC_FREQ_HIGHSPEED or SDMMC_FREQ_52M. Driver will print out how long the delay is
set_input_delay: Option<unsafe extern "C" fn(slot: c_int, delay_phase: sdmmc_delay_phase_t) -> esp_err_t>< set input delay phase
unaligned_multi_block_rw_max_chunk_size: usize@brief Maximum number of blocks to read/write at once when using an unaligned buffer.
When a multi-block read/write is requested with an unaligned buffer, the driver splits the transfer into chunks of this many blocks. Set to 0 to use the default value of 1 (single-block transfers). Higher values improve throughput but require a larger DMA-capable temporary buffer.
dma_aligned_buffer: *mut c_void@brief Cache aligned buffer for multi-block RW and IO commands
Use cases:
- Temporary buffer for multi-block read/write transactions to/from unaligned buffers.
Allocate with DMA capable memory, size should be an integer multiple of your card’s sector size.
The number of blocks transferred per chunk is controlled by
unaligned_multi_block_rw_max_chunk_size. - Cache aligned buffer for IO commands in SDIO mode. If you allocate manually, make sure it is at least SDMMC_IO_BLOCK_SIZE bytes large.
pwr_ctrl_handle: sd_pwr_ctrl_handle_t< Power control handle
get_dma_info: Option<unsafe extern "C" fn(slot: c_int, dma_mem_info: *mut esp_dma_mem_info_t) -> esp_err_t>< host function to dma memory information
check_buffer_alignment: Option<unsafe extern "C" fn(slot: c_int, buf: *const c_void, size: usize) -> bool>< Check if buffer meets alignment requirements
is_slot_set_to_uhs1: Option<unsafe extern "C" fn(slot: c_int, is_uhs1: *mut bool) -> esp_err_t>< host slot is set to uhs1 or not
Trait Implementations§
Source§impl Clone for sdmmc_host_t
impl Clone for sdmmc_host_t
Source§fn clone(&self) -> sdmmc_host_t
fn clone(&self) -> sdmmc_host_t
1.0.0 (const: unstable)§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for sdmmc_host_t
Auto Trait Implementations§
impl !Send for sdmmc_host_t
impl !Sync for sdmmc_host_t
impl Freeze for sdmmc_host_t
impl RefUnwindSafe for sdmmc_host_t
impl Unpin for sdmmc_host_t
impl UnsafeUnpin for sdmmc_host_t
impl UnwindSafe for sdmmc_host_t
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)