zephyr/subsys/sd/sd_ops.h
Pisit Sawangvonganan 4889c9ca17 sd: update comment to reference 'SD host controller specification'
In the code comments referring to section 3.6.1, changed the reference
from 'SD specification' to 'SD host controller specification'
for a clearer and more accurate context.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-01-25 20:13:25 +01:00

63 lines
1.5 KiB
C

/*
* Copyright 2022 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_SUBSYS_SD_SD_OPS_H_
#define ZEPHYR_SUBSYS_SD_SD_OPS_H_
/*
* Switches voltage of SD card to 1.8V, as described by
* "Signal voltage switch procedure" in section 3.6.1 of SD host controller specification.
*/
int sdmmc_switch_voltage(struct sd_card *card);
/*
* Reads card identification register, and decodes it
*/
int card_read_cid(struct sd_card *card);
/*
* Read card specific data register
*/
int sdmmc_read_csd(struct sd_card *card);
/*
* Requests card to publish a new relative card address, and move from
* identification to data mode
*/
int sdmmc_request_rca(struct sd_card *card);
/*
* Selects card, moving it into data transfer mode
*/
int sdmmc_select_card(struct sd_card *card);
/* Returns 1 if host supports UHS, zero otherwise */
static inline int sdmmc_host_uhs(struct sdhc_host_props *props)
{
return (props->host_caps.sdr50_support |
props->host_caps.uhs_2_support |
props->host_caps.sdr104_support |
props->host_caps.ddr50_support)
& (props->host_caps.vol_180_support);
}
int card_ioctl(struct sd_card *card, uint8_t cmd, void *buf);
int card_read_blocks(struct sd_card *card, uint8_t *rbuf,
uint32_t start_block, uint32_t num_blocks);
int card_write_blocks(struct sd_card *card, const uint8_t *wbuf,
uint32_t start_block, uint32_t num_blocks);
int card_app_command(struct sd_card *card, int relative_card_address);
int sdmmc_read_status(struct sd_card *card);
int sdmmc_wait_ready(struct sd_card *card);
#endif /* ZEPHYR_SUBSYS_SD_SD_OPS_H_ */