![]() |
LPCOpen Platform
LPCOpen Platform for NXP LPC Microcontrollers
|
Data Structures | |
struct | mci_card_struct |
Macros | |
#define | MMC_GO_IDLE_STATE 0 /* bc */ |
#define | MMC_SEND_OP_COND 1 /* bcr [31:0] OCR R3 */ |
#define | MMC_ALL_SEND_CID 2 /* bcr R2 */ |
#define | MMC_SET_RELATIVE_ADDR 3 /* ac [31:16] RCA R1 */ |
#define | MMC_SET_DSR 4 /* bc [31:16] RCA */ |
#define | MMC_SELECT_CARD 7 /* ac [31:16] RCA R1 */ |
#define | MMC_SEND_EXT_CSD 8 /* bc R1 */ |
#define | MMC_SEND_CSD 9 /* ac [31:16] RCA R2 */ |
#define | MMC_SEND_CID 10 /* ac [31:16] RCA R2 */ |
#define | MMC_STOP_TRANSMISSION 12 /* ac R1b */ |
#define | MMC_SEND_STATUS 13 /* ac [31:16] RCA R1 */ |
#define | MMC_GO_INACTIVE_STATE 15 /* ac [31:16] RCA */ |
#define | MMC_SET_BLOCKLEN 16 /* ac [31:0] block len R1 */ |
#define | MMC_READ_SINGLE_BLOCK 17 /* adtc [31:0] data addr R1 */ |
#define | MMC_READ_MULTIPLE_BLOCK 18 /* adtc [31:0] data addr R1 */ |
#define | MMC_WRITE_DAT_UNTIL_STOP 20 /* adtc [31:0] data addr R1 */ |
#define | MMC_SET_BLOCK_COUNT 23 /* adtc [31:0] data addr R1 */ |
#define | MMC_WRITE_BLOCK 24 /* adtc [31:0] data addr R1 */ |
#define | MMC_WRITE_MULTIPLE_BLOCK 25 /* adtc R1 */ |
#define | MMC_PROGRAM_CID 26 /* adtc R1 */ |
#define | MMC_PROGRAM_CSD 27 /* adtc R1 */ |
#define | MMC_SET_WRITE_PROT 28 /* ac [31:0] data addr R1b */ |
#define | MMC_CLR_WRITE_PROT 29 /* ac [31:0] data addr R1b */ |
#define | MMC_SEND_WRITE_PROT 30 /* adtc [31:0] wpdata addr R1 */ |
#define | MMC_ERASE_GROUP_START 35 /* ac [31:0] data addr R1 */ |
#define | MMC_ERASE_GROUP_END 36 /* ac [31:0] data addr R1 */ |
#define | MMC_ERASE 37 /* ac R1b */ |
#define | MMC_FAST_IO 39 /* ac <Complex> R4 */ |
#define | MMC_GO_IRQ_STATE 40 /* bcr R5 */ |
#define | MMC_LOCK_UNLOCK 42 /* adtc R1b */ |
#define | MMC_APP_CMD 55 /* ac [31:16] RCA R1 */ |
#define | MMC_GEN_CMD 56 /* adtc [0] RD/WR R1b */ |
#define | SD_SEND_RELATIVE_ADDR 3 /* ac R6 */ |
#define | SD_CMD8 8 /* bcr [31:0] OCR R3 */ |
#define | SD_APP_SET_BUS_WIDTH 6 /* ac [1:0] bus width R1 */ |
#define | SD_APP_OP_COND 41 /* bcr [31:0] OCR R1 (R4) */ |
#define | SD_APP_SEND_SCR 51 /* adtc R1 */ |
#define | R1_OUT_OF_RANGE (1UL << 31) /* er, c */ |
#define | R1_ADDRESS_ERROR (1 << 30) /* erx, c */ |
#define | R1_BLOCK_LEN_ERROR (1 << 29) /* er, c */ |
#define | R1_ERASE_SEQ_ERROR (1 << 28) /* er, c */ |
#define | R1_ERASE_PARAM (1 << 27) /* ex, c */ |
#define | R1_WP_VIOLATION (1 << 26) /* erx, c */ |
#define | R1_CARD_IS_LOCKED (1 << 25) /* sx, a */ |
#define | R1_LOCK_UNLOCK_FAILED (1 << 24) /* erx, c */ |
#define | R1_COM_CRC_ERROR (1 << 23) /* er, b */ |
#define | R1_ILLEGAL_COMMAND (1 << 22) /* er, b */ |
#define | R1_CARD_ECC_FAILED (1 << 21) /* ex, c */ |
#define | R1_CC_ERROR (1 << 20) /* erx, c */ |
#define | R1_ERROR (1 << 19) /* erx, c */ |
#define | R1_UNDERRUN (1 << 18) /* ex, c */ |
#define | R1_OVERRUN (1 << 17) /* ex, c */ |
#define | R1_CID_CSD_OVERWRITE (1 << 16) /* erx, c, CID/CSD overwrite */ |
#define | R1_WP_ERASE_SKIP (1 << 15) /* sx, c */ |
#define | R1_CARD_ECC_DISABLED (1 << 14) /* sx, a */ |
#define | R1_ERASE_RESET (1 << 13) /* sr, c */ |
#define | R1_STATUS(x) (x & 0xFFFFE000) |
#define | R1_CURRENT_STATE(x) ((x & 0x00001E00) >> 9) /* sx, b (4 bits) */ |
#define | R1_READY_FOR_DATA (1 << 8)/* sx, a */ |
#define | R1_APP_CMD (1 << 5)/* sr, c */ |
#define | OCR_ALL_READY (1UL << 31) /* Card Power up status bit */ |
#define | OCR_HC_CCS (1 << 30) /* High capacity card */ |
#define | OCR_VOLTAGE_RANGE_MSK 0x00ff8000 |
#define | SD_SEND_IF_ARG 0x000001AA |
#define | SD_SEND_IF_ECHO_MSK 0x000000FF |
#define | SD_SEND_IF_RESP 0x000000AA |
#define | CMD_MASK_RESP (0x3UL << 28) |
#define | CMD_RESP(r) (((r) & 0x3) << 28) |
#define | CMD_RESP_R0 (0 << 28) |
#define | CMD_RESP_R1 (1 << 28) |
#define | CMD_RESP_R2 (2 << 28) |
#define | CMD_RESP_R3 (3 << 28) |
#define | CMD_BIT_AUTO_STOP (1 << 24) |
#define | CMD_BIT_APP (1 << 23) |
#define | CMD_BIT_INIT (1 << 22) |
#define | CMD_BIT_BUSY (1 << 21) |
#define | CMD_BIT_LS (1 << 20) /* Low speed, used during acquire */ |
#define | CMD_BIT_DATA (1 << 19) |
#define | CMD_BIT_WRITE (1 << 18) |
#define | CMD_BIT_STREAM (1 << 17) |
#define | CMD_MASK_CMD (0xff) |
#define | CMD_SHIFT_CMD (0) |
#define | CMD(c, r) ( ((c) & CMD_MASK_CMD) | CMD_RESP((r)) ) |
#define | CMD_IDLE CMD(MMC_GO_IDLE_STATE, 0) | CMD_BIT_LS | CMD_BIT_INIT |
#define | CMD_SD_OP_COND CMD(SD_APP_OP_COND, 1) | CMD_BIT_LS | CMD_BIT_APP |
#define | CMD_SD_SEND_IF_COND CMD(SD_CMD8, 1) | CMD_BIT_LS |
#define | CMD_MMC_OP_COND CMD(MMC_SEND_OP_COND, 3) | CMD_BIT_LS | CMD_BIT_INIT |
#define | CMD_ALL_SEND_CID CMD(MMC_ALL_SEND_CID, 2) | CMD_BIT_LS |
#define | CMD_MMC_SET_RCA CMD(MMC_SET_RELATIVE_ADDR, 1) | CMD_BIT_LS |
#define | CMD_SD_SEND_RCA CMD(SD_SEND_RELATIVE_ADDR, 1) | CMD_BIT_LS |
#define | CMD_SEND_CSD CMD(MMC_SEND_CSD, 2) | CMD_BIT_LS |
#define | CMD_SEND_EXT_CSD CMD(MMC_SEND_EXT_CSD, 1) | CMD_BIT_LS | CMD_BIT_DATA |
#define | CMD_DESELECT_CARD CMD(MMC_SELECT_CARD, 0) |
#define | CMD_SELECT_CARD CMD(MMC_SELECT_CARD, 1) |
#define | CMD_SET_BLOCKLEN CMD(MMC_SET_BLOCKLEN, 1) |
#define | CMD_SEND_STATUS CMD(MMC_SEND_STATUS, 1) |
#define | CMD_READ_SINGLE CMD(MMC_READ_SINGLE_BLOCK, 1) | CMD_BIT_DATA |
#define | CMD_READ_MULTIPLE CMD(MMC_READ_MULTIPLE_BLOCK, 1) | CMD_BIT_DATA | CMD_BIT_AUTO_STOP |
#define | CMD_SD_SET_WIDTH CMD(SD_APP_SET_BUS_WIDTH, 1) | CMD_BIT_APP |
#define | CMD_STOP CMD(MMC_STOP_TRANSMISSION, 1) | CMD_BIT_BUSY |
#define | CMD_WRITE_SINGLE CMD(MMC_WRITE_BLOCK, 1) | CMD_BIT_DATA | CMD_BIT_WRITE |
#define | CMD_WRITE_MULTIPLE CMD(MMC_WRITE_MULTIPLE_BLOCK, 1) | CMD_BIT_DATA | CMD_BIT_WRITE | CMD_BIT_AUTO_STOP |
#define | CARD_TYPE_SD (1 << 0) |
card type defines | |
#define | CARD_TYPE_4BIT (1 << 1) |
#define | CARD_TYPE_8BIT (1 << 2) |
#define | CARD_TYPE_HC (OCR_HC_CCS) |
#define | MMC_SECTOR_SIZE 512 |
#define | US_TIMEOUT 1000000 |
Setup options for the SDIO driver. | |
#define | MS_ACQUIRE_DELAY (10) |
#define | INIT_OP_RETRIES 50 |
#define | SET_OP_RETRIES 1000 |
#define | SDIO_BUS_WIDTH 4 |
#define | SD_MMC_ENUM_CLOCK 400000 |
#define | MMC_MAX_CLOCK 20000000 |
#define | MMC_LOW_BUS_MAX_CLOCK 26000000 |
#define | MMC_HIGH_BUS_MAX_CLOCK 52000000 |
#define | SD_MAX_CLOCK 25000000 |
Typedefs | |
typedef void(* | MCI_EVSETUP_FUNC_T )(uint32_t) |
typedef uint32_t(* | MCI_WAIT_CB_FUNC_T )(void) |
typedef void(* | MCI_MSDELAY_FUNC_T )(uint32_t) |
Functions | |
STATIC INLINE int32_t | Chip_SDMMC_CardNDetect (void) |
Detect if an SD card is inserted. | |
STATIC INLINE int32_t | Chip_CardWpOn (void) |
Detect if write protect is enabled. | |
STATIC INLINE void | Chip_SDMMC_Init (void) |
Initializes the MCI card controller. | |
STATIC INLINE void | Chip_SDMMC_PowerOnOff (int32_t enable) |
Enable or disable slot power. | |
STATIC INLINE void | Chip_SDMMC_SetIntMask (uint32_t iVal) |
Sets the SD interface interrupt mask. | |
uint32_t | Chip_SDMMC_GetIntStatus (void) |
Returns the current SD status, clears pending ints, and disables all ints. | |
int32_t | Chip_SDMMC_GetState (void) |
Get card's current state (idle, transfer, program, etc.) | |
uint32_t | Chip_SDMMC_Acquire (mci_card_struct *pcardinfo) |
Function to enumerate the SD/MMC/SDHC/MMC+ cards. | |
int32_t | Chip_SDMMC_GetDeviceSize (void) |
Get the device size of SD/MMC card (after enumeration) | |
int32_t | Chip_SDMMC_ReadBlocks (void *buffer, int32_t start_block, int32_t num_blocks) |
Performs the read of data from the SD/MMC card. | |
int32_t | Chip_SDMMC_WriteBlocks (void *buffer, int32_t start_block, int32_t num_blocks) |
Performs write of data to the SD/MMC card. | |
#define CARD_TYPE_4BIT (1 << 1) |
Definition at line 329 of file sdmmc_18xx_43xx.h.
#define CARD_TYPE_8BIT (1 << 2) |
Definition at line 330 of file sdmmc_18xx_43xx.h.
#define CARD_TYPE_HC (OCR_HC_CCS) |
high capacity card > 2GB
Definition at line 331 of file sdmmc_18xx_43xx.h.
#define CARD_TYPE_SD (1 << 0) |
card type defines
Definition at line 328 of file sdmmc_18xx_43xx.h.
#define CMD | ( | c, | |
r | |||
) | ( ((c) & CMD_MASK_CMD) | CMD_RESP((r)) ) |
Definition at line 304 of file sdmmc_18xx_43xx.h.
#define CMD_ALL_SEND_CID CMD(MMC_ALL_SEND_CID, 2) | CMD_BIT_LS |
Definition at line 310 of file sdmmc_18xx_43xx.h.
#define CMD_BIT_APP (1 << 23) |
Definition at line 294 of file sdmmc_18xx_43xx.h.
#define CMD_BIT_AUTO_STOP (1 << 24) |
Definition at line 293 of file sdmmc_18xx_43xx.h.
#define CMD_BIT_BUSY (1 << 21) |
Definition at line 296 of file sdmmc_18xx_43xx.h.
#define CMD_BIT_DATA (1 << 19) |
Definition at line 298 of file sdmmc_18xx_43xx.h.
#define CMD_BIT_INIT (1 << 22) |
Definition at line 295 of file sdmmc_18xx_43xx.h.
#define CMD_BIT_LS (1 << 20) /* Low speed, used during acquire */ |
Definition at line 297 of file sdmmc_18xx_43xx.h.
#define CMD_BIT_STREAM (1 << 17) |
Definition at line 300 of file sdmmc_18xx_43xx.h.
#define CMD_BIT_WRITE (1 << 18) |
Definition at line 299 of file sdmmc_18xx_43xx.h.
#define CMD_DESELECT_CARD CMD(MMC_SELECT_CARD, 0) |
Definition at line 315 of file sdmmc_18xx_43xx.h.
#define CMD_IDLE CMD(MMC_GO_IDLE_STATE, 0) | CMD_BIT_LS | CMD_BIT_INIT |
Definition at line 306 of file sdmmc_18xx_43xx.h.
#define CMD_MASK_CMD (0xff) |
Definition at line 301 of file sdmmc_18xx_43xx.h.
#define CMD_MASK_RESP (0x3UL << 28) |
Definition at line 287 of file sdmmc_18xx_43xx.h.
#define CMD_MMC_OP_COND CMD(MMC_SEND_OP_COND, 3) | CMD_BIT_LS | CMD_BIT_INIT |
Definition at line 309 of file sdmmc_18xx_43xx.h.
#define CMD_MMC_SET_RCA CMD(MMC_SET_RELATIVE_ADDR, 1) | CMD_BIT_LS |
Definition at line 311 of file sdmmc_18xx_43xx.h.
#define CMD_READ_MULTIPLE CMD(MMC_READ_MULTIPLE_BLOCK, 1) | CMD_BIT_DATA | CMD_BIT_AUTO_STOP |
Definition at line 320 of file sdmmc_18xx_43xx.h.
#define CMD_READ_SINGLE CMD(MMC_READ_SINGLE_BLOCK, 1) | CMD_BIT_DATA |
Definition at line 319 of file sdmmc_18xx_43xx.h.
#define CMD_RESP | ( | r | ) | (((r) & 0x3) << 28) |
Definition at line 288 of file sdmmc_18xx_43xx.h.
#define CMD_RESP_R0 (0 << 28) |
Definition at line 289 of file sdmmc_18xx_43xx.h.
#define CMD_RESP_R1 (1 << 28) |
Definition at line 290 of file sdmmc_18xx_43xx.h.
#define CMD_RESP_R2 (2 << 28) |
Definition at line 291 of file sdmmc_18xx_43xx.h.
#define CMD_RESP_R3 (3 << 28) |
Definition at line 292 of file sdmmc_18xx_43xx.h.
#define CMD_SD_OP_COND CMD(SD_APP_OP_COND, 1) | CMD_BIT_LS | CMD_BIT_APP |
Definition at line 307 of file sdmmc_18xx_43xx.h.
#define CMD_SD_SEND_IF_COND CMD(SD_CMD8, 1) | CMD_BIT_LS |
Definition at line 308 of file sdmmc_18xx_43xx.h.
#define CMD_SD_SEND_RCA CMD(SD_SEND_RELATIVE_ADDR, 1) | CMD_BIT_LS |
Definition at line 312 of file sdmmc_18xx_43xx.h.
#define CMD_SD_SET_WIDTH CMD(SD_APP_SET_BUS_WIDTH, 1) | CMD_BIT_APP |
Definition at line 321 of file sdmmc_18xx_43xx.h.
#define CMD_SELECT_CARD CMD(MMC_SELECT_CARD, 1) |
Definition at line 316 of file sdmmc_18xx_43xx.h.
#define CMD_SEND_CSD CMD(MMC_SEND_CSD, 2) | CMD_BIT_LS |
Definition at line 313 of file sdmmc_18xx_43xx.h.
#define CMD_SEND_EXT_CSD CMD(MMC_SEND_EXT_CSD, 1) | CMD_BIT_LS | CMD_BIT_DATA |
Definition at line 314 of file sdmmc_18xx_43xx.h.
#define CMD_SEND_STATUS CMD(MMC_SEND_STATUS, 1) |
Definition at line 318 of file sdmmc_18xx_43xx.h.
#define CMD_SET_BLOCKLEN CMD(MMC_SET_BLOCKLEN, 1) |
Definition at line 317 of file sdmmc_18xx_43xx.h.
#define CMD_SHIFT_CMD (0) |
Definition at line 302 of file sdmmc_18xx_43xx.h.
#define CMD_STOP CMD(MMC_STOP_TRANSMISSION, 1) | CMD_BIT_BUSY |
Definition at line 322 of file sdmmc_18xx_43xx.h.
#define CMD_WRITE_MULTIPLE CMD(MMC_WRITE_MULTIPLE_BLOCK, 1) | CMD_BIT_DATA | CMD_BIT_WRITE | CMD_BIT_AUTO_STOP |
Definition at line 324 of file sdmmc_18xx_43xx.h.
#define CMD_WRITE_SINGLE CMD(MMC_WRITE_BLOCK, 1) | CMD_BIT_DATA | CMD_BIT_WRITE |
Definition at line 323 of file sdmmc_18xx_43xx.h.
#define INIT_OP_RETRIES 50 |
initial OP_COND retries
Definition at line 339 of file sdmmc_18xx_43xx.h.
#define MMC_ALL_SEND_CID 2 /* bcr R2 */ |
Definition at line 182 of file sdmmc_18xx_43xx.h.
#define MMC_APP_CMD 55 /* ac [31:16] RCA R1 */ |
Definition at line 226 of file sdmmc_18xx_43xx.h.
#define MMC_CLR_WRITE_PROT 29 /* ac [31:0] data addr R1b */ |
Definition at line 210 of file sdmmc_18xx_43xx.h.
#define MMC_ERASE 37 /* ac R1b */ |
Definition at line 216 of file sdmmc_18xx_43xx.h.
#define MMC_ERASE_GROUP_END 36 /* ac [31:0] data addr R1 */ |
Definition at line 215 of file sdmmc_18xx_43xx.h.
#define MMC_ERASE_GROUP_START 35 /* ac [31:0] data addr R1 */ |
Definition at line 214 of file sdmmc_18xx_43xx.h.
#define MMC_FAST_IO 39 /* ac <Complex> R4 */ |
Definition at line 219 of file sdmmc_18xx_43xx.h.
#define MMC_GEN_CMD 56 /* adtc [0] RD/WR R1b */ |
Definition at line 227 of file sdmmc_18xx_43xx.h.
#define MMC_GO_IDLE_STATE 0 /* bc */ |
Definition at line 180 of file sdmmc_18xx_43xx.h.
#define MMC_GO_INACTIVE_STATE 15 /* ac [31:16] RCA */ |
Definition at line 191 of file sdmmc_18xx_43xx.h.
#define MMC_GO_IRQ_STATE 40 /* bcr R5 */ |
Definition at line 220 of file sdmmc_18xx_43xx.h.
#define MMC_HIGH_BUS_MAX_CLOCK 52000000 |
Type 1 MMC card max clock rate
Definition at line 345 of file sdmmc_18xx_43xx.h.
#define MMC_LOCK_UNLOCK 42 /* adtc R1b */ |
Definition at line 223 of file sdmmc_18xx_43xx.h.
#define MMC_LOW_BUS_MAX_CLOCK 26000000 |
Type 0 MMC card max clock rate
Definition at line 344 of file sdmmc_18xx_43xx.h.
#define MMC_MAX_CLOCK 20000000 |
Max MMC clock rate
Definition at line 343 of file sdmmc_18xx_43xx.h.
#define MMC_PROGRAM_CID 26 /* adtc R1 */ |
Definition at line 205 of file sdmmc_18xx_43xx.h.
#define MMC_PROGRAM_CSD 27 /* adtc R1 */ |
Definition at line 206 of file sdmmc_18xx_43xx.h.
#define MMC_READ_MULTIPLE_BLOCK 18 /* adtc [31:0] data addr R1 */ |
Definition at line 196 of file sdmmc_18xx_43xx.h.
#define MMC_READ_SINGLE_BLOCK 17 /* adtc [31:0] data addr R1 */ |
Definition at line 195 of file sdmmc_18xx_43xx.h.
#define MMC_SECTOR_SIZE 512 |
Definition at line 333 of file sdmmc_18xx_43xx.h.
#define MMC_SELECT_CARD 7 /* ac [31:16] RCA R1 */ |
Definition at line 185 of file sdmmc_18xx_43xx.h.
#define MMC_SEND_CID 10 /* ac [31:16] RCA R2 */ |
Definition at line 188 of file sdmmc_18xx_43xx.h.
#define MMC_SEND_CSD 9 /* ac [31:16] RCA R2 */ |
Definition at line 187 of file sdmmc_18xx_43xx.h.
#define MMC_SEND_EXT_CSD 8 /* bc R1 */ |
Definition at line 186 of file sdmmc_18xx_43xx.h.
#define MMC_SEND_OP_COND 1 /* bcr [31:0] OCR R3 */ |
Definition at line 181 of file sdmmc_18xx_43xx.h.
#define MMC_SEND_STATUS 13 /* ac [31:16] RCA R1 */ |
Definition at line 190 of file sdmmc_18xx_43xx.h.
#define MMC_SEND_WRITE_PROT 30 /* adtc [31:0] wpdata addr R1 */ |
Definition at line 211 of file sdmmc_18xx_43xx.h.
#define MMC_SET_BLOCK_COUNT 23 /* adtc [31:0] data addr R1 */ |
Definition at line 202 of file sdmmc_18xx_43xx.h.
#define MMC_SET_BLOCKLEN 16 /* ac [31:0] block len R1 */ |
Definition at line 194 of file sdmmc_18xx_43xx.h.
#define MMC_SET_DSR 4 /* bc [31:16] RCA */ |
Definition at line 184 of file sdmmc_18xx_43xx.h.
#define MMC_SET_RELATIVE_ADDR 3 /* ac [31:16] RCA R1 */ |
Definition at line 183 of file sdmmc_18xx_43xx.h.
#define MMC_SET_WRITE_PROT 28 /* ac [31:0] data addr R1b */ |
Definition at line 209 of file sdmmc_18xx_43xx.h.
#define MMC_STOP_TRANSMISSION 12 /* ac R1b */ |
Definition at line 189 of file sdmmc_18xx_43xx.h.
#define MMC_WRITE_BLOCK 24 /* adtc [31:0] data addr R1 */ |
Definition at line 203 of file sdmmc_18xx_43xx.h.
#define MMC_WRITE_DAT_UNTIL_STOP 20 /* adtc [31:0] data addr R1 */ |
Definition at line 199 of file sdmmc_18xx_43xx.h.
#define MMC_WRITE_MULTIPLE_BLOCK 25 /* adtc R1 */ |
Definition at line 204 of file sdmmc_18xx_43xx.h.
#define MS_ACQUIRE_DELAY (10) |
inter-command acquire oper condition delay in msec
Definition at line 338 of file sdmmc_18xx_43xx.h.
#define OCR_ALL_READY (1UL << 31) /* Card Power up status bit */ |
Definition at line 279 of file sdmmc_18xx_43xx.h.
#define OCR_HC_CCS (1 << 30) /* High capacity card */ |
Definition at line 280 of file sdmmc_18xx_43xx.h.
#define OCR_VOLTAGE_RANGE_MSK 0x00ff8000 |
Definition at line 281 of file sdmmc_18xx_43xx.h.
#define R1_ADDRESS_ERROR (1 << 30) /* erx, c */ |
Definition at line 256 of file sdmmc_18xx_43xx.h.
#define R1_APP_CMD (1 << 5)/* sr, c */ |
Definition at line 277 of file sdmmc_18xx_43xx.h.
#define R1_BLOCK_LEN_ERROR (1 << 29) /* er, c */ |
Definition at line 257 of file sdmmc_18xx_43xx.h.
#define R1_CARD_ECC_DISABLED (1 << 14) /* sx, a */ |
Definition at line 272 of file sdmmc_18xx_43xx.h.
#define R1_CARD_ECC_FAILED (1 << 21) /* ex, c */ |
Definition at line 265 of file sdmmc_18xx_43xx.h.
#define R1_CARD_IS_LOCKED (1 << 25) /* sx, a */ |
Definition at line 261 of file sdmmc_18xx_43xx.h.
#define R1_CC_ERROR (1 << 20) /* erx, c */ |
Definition at line 266 of file sdmmc_18xx_43xx.h.
#define R1_CID_CSD_OVERWRITE (1 << 16) /* erx, c, CID/CSD overwrite */ |
Definition at line 270 of file sdmmc_18xx_43xx.h.
#define R1_COM_CRC_ERROR (1 << 23) /* er, b */ |
Definition at line 263 of file sdmmc_18xx_43xx.h.
#define R1_CURRENT_STATE | ( | x | ) | ((x & 0x00001E00) >> 9) /* sx, b (4 bits) */ |
Definition at line 275 of file sdmmc_18xx_43xx.h.
#define R1_ERASE_PARAM (1 << 27) /* ex, c */ |
Definition at line 259 of file sdmmc_18xx_43xx.h.
#define R1_ERASE_RESET (1 << 13) /* sr, c */ |
Definition at line 273 of file sdmmc_18xx_43xx.h.
#define R1_ERASE_SEQ_ERROR (1 << 28) /* er, c */ |
Definition at line 258 of file sdmmc_18xx_43xx.h.
#define R1_ERROR (1 << 19) /* erx, c */ |
Definition at line 267 of file sdmmc_18xx_43xx.h.
#define R1_ILLEGAL_COMMAND (1 << 22) /* er, b */ |
Definition at line 264 of file sdmmc_18xx_43xx.h.
#define R1_LOCK_UNLOCK_FAILED (1 << 24) /* erx, c */ |
Definition at line 262 of file sdmmc_18xx_43xx.h.
#define R1_OUT_OF_RANGE (1UL << 31) /* er, c */ |
Definition at line 255 of file sdmmc_18xx_43xx.h.
#define R1_OVERRUN (1 << 17) /* ex, c */ |
Definition at line 269 of file sdmmc_18xx_43xx.h.
#define R1_READY_FOR_DATA (1 << 8)/* sx, a */ |
Definition at line 276 of file sdmmc_18xx_43xx.h.
#define R1_STATUS | ( | x | ) | (x & 0xFFFFE000) |
Definition at line 274 of file sdmmc_18xx_43xx.h.
#define R1_UNDERRUN (1 << 18) /* ex, c */ |
Definition at line 268 of file sdmmc_18xx_43xx.h.
#define R1_WP_ERASE_SKIP (1 << 15) /* sx, c */ |
Definition at line 271 of file sdmmc_18xx_43xx.h.
#define R1_WP_VIOLATION (1 << 26) /* erx, c */ |
Definition at line 260 of file sdmmc_18xx_43xx.h.
#define SD_APP_OP_COND 41 /* bcr [31:0] OCR R1 (R4) */ |
Definition at line 237 of file sdmmc_18xx_43xx.h.
#define SD_APP_SEND_SCR 51 /* adtc R1 */ |
Definition at line 238 of file sdmmc_18xx_43xx.h.
#define SD_APP_SET_BUS_WIDTH 6 /* ac [1:0] bus width R1 */ |
Definition at line 236 of file sdmmc_18xx_43xx.h.
#define SD_CMD8 8 /* bcr [31:0] OCR R3 */ |
Definition at line 233 of file sdmmc_18xx_43xx.h.
#define SD_MAX_CLOCK 25000000 |
Max SD clock rate
Definition at line 346 of file sdmmc_18xx_43xx.h.
#define SD_MMC_ENUM_CLOCK 400000 |
Typical enumeration clock rate
Definition at line 342 of file sdmmc_18xx_43xx.h.
#define SD_SEND_IF_ARG 0x000001AA |
Definition at line 283 of file sdmmc_18xx_43xx.h.
#define SD_SEND_IF_ECHO_MSK 0x000000FF |
Definition at line 284 of file sdmmc_18xx_43xx.h.
#define SD_SEND_IF_RESP 0x000000AA |
Definition at line 285 of file sdmmc_18xx_43xx.h.
#define SD_SEND_RELATIVE_ADDR 3 /* ac R6 */ |
Definition at line 232 of file sdmmc_18xx_43xx.h.
#define SDIO_BUS_WIDTH 4 |
Max bus width supported
Definition at line 341 of file sdmmc_18xx_43xx.h.
#define SET_OP_RETRIES 1000 |
set OP_COND retries
Definition at line 340 of file sdmmc_18xx_43xx.h.
#define US_TIMEOUT 1000000 |
Setup options for the SDIO driver.
give 1 atleast 1 sec for the card to respond
Definition at line 337 of file sdmmc_18xx_43xx.h.
typedef void(* MCI_EVSETUP_FUNC_T)(uint32_t) |
Definition at line 349 of file sdmmc_18xx_43xx.h.
typedef void(* MCI_MSDELAY_FUNC_T)(uint32_t) |
Definition at line 355 of file sdmmc_18xx_43xx.h.
typedef uint32_t(* MCI_WAIT_CB_FUNC_T)(void) |
Definition at line 352 of file sdmmc_18xx_43xx.h.
enum SD_APP_CMD_T |
SDMMC application specific commands for SD cards only - these must be preceded by the SDMMC CMD55 to work correctly.
Definition at line 140 of file sdmmc_18xx_43xx.h.
enum SDMMC_COMMAND_T |
SD/MMC command enumeration value.
Definition at line 99 of file sdmmc_18xx_43xx.h.
enum SDMMC_RESPONSE_T |
Possible SDMMC response types.
Definition at line 153 of file sdmmc_18xx_43xx.h.
enum SDMMC_STATE_T |
Possible SDMMC card state types.
Definition at line 166 of file sdmmc_18xx_43xx.h.
Detect if write protect is enabled.
Definition at line 393 of file sdmmc_18xx_43xx.h.
uint32_t Chip_SDMMC_Acquire | ( | mci_card_struct * | pcardinfo | ) |
Function to enumerate the SD/MMC/SDHC/MMC+ cards.
pcardinfo | : Pointer to pre-allocated card info structure |
Definition at line 334 of file sdmmc_18xx_43xx.c.
Detect if an SD card is inserted.
Definition at line 382 of file sdmmc_18xx_43xx.h.
int32_t Chip_SDMMC_GetDeviceSize | ( | void | ) |
Get the device size of SD/MMC card (after enumeration)
Definition at line 496 of file sdmmc_18xx_43xx.c.
uint32_t Chip_SDMMC_GetIntStatus | ( | void | ) |
Returns the current SD status, clears pending ints, and disables all ints.
Definition at line 306 of file sdmmc_18xx_43xx.c.
int32_t Chip_SDMMC_GetState | ( | void | ) |
Get card's current state (idle, transfer, program, etc.)
Definition at line 319 of file sdmmc_18xx_43xx.c.
Enable or disable slot power.
enable | : !0 to enable, or 0 to disable |
Definition at line 414 of file sdmmc_18xx_43xx.h.
int32_t Chip_SDMMC_ReadBlocks | ( | void * | buffer, |
int32_t | start_block, | ||
int32_t | num_blocks | ||
) |
Performs the read of data from the SD/MMC card.
buffer | : Pointer to data buffer to copy to |
start_block | : Start block number |
num_blocks | : Number of block to read |
Definition at line 502 of file sdmmc_18xx_43xx.c.
Sets the SD interface interrupt mask.
iVal | : Interrupts to enable, Or'ed values MCI_INT_* |
Definition at line 424 of file sdmmc_18xx_43xx.h.
int32_t Chip_SDMMC_WriteBlocks | ( | void * | buffer, |
int32_t | start_block, | ||
int32_t | num_blocks | ||
) |
Performs write of data to the SD/MMC card.
buffer | : Pointer to data buffer to copy to |
start_block | : Start block number |
num_blocks | : Number of block to write |
Definition at line 549 of file sdmmc_18xx_43xx.c.