AM263x MCU+ SDK  09.02.00
mmcsd/v1/mmcsd.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2022 Texas Instruments Incorporated
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * distribution.
15  *
16  * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
50 #ifndef MMCSD_H_
51 #define MMCSD_H_
52 
53 /* ========================================================================== */
54 /* Include Files */
55 /* ========================================================================== */
56 
57 #include <stdint.h>
58 #include <kernel/dpl/SystemP.h>
59 #include <kernel/dpl/SemaphoreP.h>
60 #include <kernel/dpl/HwiP.h>
61 #include <drivers/hw_include/csl_types.h>
62 #include <drivers/hw_include/cslr_mmcsd.h>
63 #include <drivers/hw_include/hw_types.h>
64 
65 #ifdef __cplusplus
66 extern "C" {
67 #endif
68 
69 /* ========================================================================== */
70 /* Macros & Typedefs */
71 /* ========================================================================== */
72 
74 #define MMCSD_CARD_SD (0U)
75 
77 #define MMCSD_CARD_MMC (1U)
78 
80 #define MMCSD_CARD_EMMC (2U)
81 
82 /* useful in cases where SoC has MMCSD IP but no device attached to peripheral */
83 #define MMCSD_CARD_TYPE_NO_DEVICE (3U)
84 
86 #define MMCSD_CMD_SETBUSWIDTH (MMCSD_CMD_RESERVED + 0U)
87 
89 #define MMCSD_CMD_SETFREQUENCY (MMCSD_CMD_RESERVED + 1U)
90 
92 #define MMCSD_CMD_GETBUSWIDTH (MMCSD_CMD_RESERVED + 2U)
93 
95 #define MMCSD_CMD_GETFREQUENCY (MMCSD_CMD_RESERVED + 3U)
96 
98 #define MMCSD_CMD_GETMEDIAPARAMS (MMCSD_CMD_RESERVED + 4U)
99 
101 #define MMCSD_INVALID_MUXNUM (-1)
102 
104 #define MMCSD_INVALID_MUX_EVENTNUM (-1)
105 
107 #define MMCSD_BUS_WIDTH_1BIT (1U)
108 
110 #define MMCSD_BUS_WIDTH_4BIT (4U)
111 
113 #define MMCSD_BUS_WIDTH_8BIT (8U)
114 
116 #define MMCSD_TRANSPEED_25MBPS (0x32U)
117 
119 #define MMCSD_TRANSPEED_50MBPS (0x5AU)
120 
122 #define MMCSD_TRANSPEED_DEFAULT (0x32U)
123 
125 #define MMCSD_TRANSPEED_HS (0x5AU)
126 
128 #define MMCSD_TRANSPEED_SDR12 (0x32U)
129 
131 #define MMCSD_TRANSPEED_SDR25 (0x5AU)
132 
134 #define MMCSD_TRANSPEED_SDR50 (0xBU)
135 
137 #define MMCSD_TRANSPEED_SDR104 (0x2BU)
138 
140 #define MMCSD_TRANSPEED_DDR50 (0x3BU)
141 
143 #define MMCSD_TRANSPEED_HS200 (0x2BU)
144 
146 #define MMCSD_LOOPBACK_ANY (0x0U)
147 
149 #define MMCSD_LOOPBACK_INTERNAL (0x1U)
150 
152 #define MMCSD_LOOPBACK_PAD (0x2U)
153 
155 #define MMCSD_VOLTAGE_ANY (0x0U)
156 
157 
158 typedef void* MMCSD_Handle;
159 
160 /* ========================================================================== */
161 /* Structures and Enums */
162 /* ========================================================================== */
171 typedef enum hsMmcsdResetLineMask
172 {
173  MMCSD_RESET_LINE_MASK_DATA = CSL_MMC_SYSCTL_SRD_MASK,
175  MMCSD_RESET_LINE_MASK_CMD = CSL_MMC_SYSCTL_SRC_MASK,
177  MMCSD_RESET_LINE_MASK_ALL = CSL_MMC_SYSCTL_SRA_MASK
180 
182 typedef enum MMCSD_clkAct_t
183 {
184  MMCSD_CLK_ACT_ICLK_FCLK_OFF = CSL_MMC_SYSCONFIG_CLOCKACTIVITY_NONE,
186  MMCSD_CLK_ACT_FCLK_OFF = CSL_MMC_SYSCONFIG_CLOCKACTIVITY_FUNC,
188  MMCSD_CLK_ACT_ICLK_OFF = CSL_MMC_SYSCONFIG_CLOCKACTIVITY_OCP,
190  MMCSD_CLK_ACT_ICLK_FLCK_ON = CSL_MMC_SYSCONFIG_CLOCKACTIVITY_BOTH
193 
195 typedef enum MMCSD_standbyMode_t
196 {
197  MMCSD_STANDBY_MODE_FORCE = CSL_MMC_SYSCONFIG_STANDBYMODE_FORCE,
199  MMCSD_STANDBY_MODE_NONE = CSL_MMC_SYSCONFIG_STANDBYMODE_NOIDLE,
201  MMCSD_STANDBY_MODE_SMART = CSL_MMC_SYSCONFIG_STANDBYMODE_SMART,
204  CSL_MMC_SYSCONFIG_STANDBYMODE_SMARTWAKE
207 
209 typedef enum MMCSD_pwrCtrl_t
210 {
211  MMCSD_PWR_CTRL_ON = CSL_MMC_HCTL_SDBP_PWRON,
213  MMCSD_PWR_CTRL_OFF = CSL_MMC_HCTL_SDBP_PWROFF
216 
218 typedef enum MMCSD_suppVolt_t
219 {
220  MMCSD_SUPP_VOLT_1P8 = CSL_MMC_CAPA_VS18_MASK,
222  MMCSD_SUPP_VOLT_3P0 = CSL_MMC_CAPA_VS30_MASK,
224  MMCSD_SUPP_VOLT_3P3 = CSL_MMC_CAPA_VS33_MASK
227 
229 typedef enum MMCSD_cmdType_t
230 {
231  MMCSD_CMD_TYPE_OTHER = CSL_MMC_CMD_CMD_TYPE_NORMAL,
233  MMCSD_CMD_TYPE_BUS_SUSPEND = CSL_MMC_CMD_CMD_TYPE_SUSPEND,
235  MMCSD_CMD_TYPE_FUNC_SEL = CSL_MMC_CMD_CMD_TYPE_RESUME,
237  MMCSD_CMD_TYPE_IO_ABORT = CSL_MMC_CMD_CMD_TYPE_ABORT
240 
242 typedef enum MMCSD_rspType_t
243 {
244  MMCSD_RSP_TYPE_NONE = CSL_MMC_CMD_RSP_TYPE_NORSP,
246  MMCSD_RSP_TYPE_LEN_136 = CSL_MMC_CMD_RSP_TYPE_LGHT36,
248  MMCSD_RSP_TYPE_LEN_48 = CSL_MMC_CMD_RSP_TYPE_LGHT48,
250  MMCSD_RSP_TYPE_LEN_48_BUSY = CSL_MMC_CMD_RSP_TYPE_LGHT48B
253 
255 typedef enum MMCSD_xFerType_t
256 {
257  MMCSD_XFER_TYPE_TX = CSL_MMC_CMD_DDIR_WRITE,
259  MMCSD_XFER_TYPE_RX = CSL_MMC_CMD_DDIR_READ
262 
264 typedef enum MMCSD_intrMask_t
265 {
266  MMCSD_INTR_MASK_BADACCESS = CSL_MMC_IE_BADA_ENABLE_MASK,
268  MMCSD_INTR_MASK_CARDERROR = CSL_MMC_IE_CERR_ENABLE_MASK,
270  MMCSD_INTR_MASK_ADMAERROR = CSL_MMC_IE_ADMAE_ENABLE_MASK,
272  MMCSD_INTR_MASK_ACMD12ERR = CSL_MMC_IE_ACE_ENABLE_MASK,
274  MMCSD_INTR_MASK_DATABITERR = CSL_MMC_IE_DEB_ENABLE_MASK,
276  MMCSD_INTR_MASK_DATACRCERR = CSL_MMC_IE_DCRC_ENABLE_MASK,
278  MMCSD_INTR_MASK_DATATIMEOUT = CSL_MMC_IE_DTO_ENABLE_MASK,
280  MMCSD_INTR_MASK_CMDINDXERR = CSL_MMC_IE_CIE_ENABLE_MASK,
282  MMCSD_INTR_MASK_CMDBITERR = CSL_MMC_IE_CEB_ENABLE_MASK,
284  MMCSD_INTR_MASK_CMDCRCERR = CSL_MMC_IE_CCRC_ENABLE_MASK,
286  MMCSD_INTR_MASK_CMDTIMEOUT = CSL_MMC_IE_CTO_ENABLE_MASK,
288  MMCSD_INTR_MASK_ERR = CSL_MMC_IE_NULL_MASK,
290  MMCSD_INTR_MASK_CARDREM = CSL_MMC_IE_CREM_ENABLE_MASK,
292  MMCSD_INTR_MASK_CARDINS = CSL_MMC_IE_CINS_ENABLE_MASK,
294  MMCSD_INTR_MASK_BUFRDRDY = CSL_MMC_IE_BRR_ENABLE_MASK,
296  MMCSD_INTR_MASK_BUFWRRDY = CSL_MMC_IE_BWR_ENABLE_MASK,
298  MMCSD_INTR_MASK_TRNFCOMP = CSL_MMC_IE_TC_ENABLE_MASK,
300  MMCSD_INTR_MASK_CMDCOMP = CSL_MMC_IE_CC_ENABLE_MASK
303 
305 typedef struct MMCSD_sysCfg_t
306 {
307  uint32_t clockActivity;
310  uint32_t standbyMode;
313  uint32_t idleMode;
316  uint32_t enableWakeup;
320  uint32_t enableAutoIdle;
324 }MMCSD_sysCfg;
325 
329 typedef struct MMCSD_cmd_t{
330  uint32_t cmdId;
332  uint32_t cmdType;
334  uint32_t rspType;
336  uint32_t xferType;
338 } MMCSD_cmd;
339 
341 typedef struct MMCSD_cmdObj_t
342 {
345  uint32_t cmdArg;
347  uint32_t enableData;
352  uint32_t numBlks;
356  uint32_t enableDma;
360 }MMCSD_cmdObj;
361 
363 typedef enum MMCSD_idleMode_t
364 {
365  MMCSD_IDLE_MODE_FORCE = CSL_MMC_SYSCONFIG_SIDLEMODE_FORCE,
367  MMCSD_IDLE_MODE_NONE = CSL_MMC_SYSCONFIG_SIDLEMODE_NOIDLE,
369  MMCSD_IDLE_MODE_SMART = CSL_MMC_SYSCONFIG_SIDLEMODE_SMART
372 
374 typedef enum MMCSD_busVolt_t
375 {
376  MMCSD_BUS_VOLT_1P8 = CSL_MMC_HCTL_SDVS__1V8,
378  MMCSD_BUS_VOLT_3P0 = CSL_MMC_HCTL_SDVS__3V0,
380  MMCSD_BUS_VOLT_3P3 = CSL_MMC_HCTL_SDVS__3V3
383 
384 typedef struct MMCSD_iodelayParams_s {
385  uint32_t deviceType;
386  uint32_t transferSpeed;
387  uint32_t operatingVoltage;
388  uint32_t loopBackType;
390 
391 typedef enum {
396 
401 typedef enum {
402  MMCSD_INPUT_CLOCK_CTRL_GET, /* Returns the input clock to MMC'n' */
403  MMCSD_INPUT_CLOCK_CTRL_SET /* Sets the input clock to MMC'n' as per a value */
405 
410 typedef int32_t (*MMCSD_iodelayFxn) (uint32_t instanceNum, MMCSD_ioDelayParams *iodelayParams);
411 
415 typedef int32_t (*MMCSD_switchVoltage) (uint32_t controllerNum, MMCSD_BusVoltage voltage);
416 
420 typedef uint32_t (*MMCSD_inputClockControl) (uint32_t instNum, uint32_t *clkFreq, MMCSD_inputClkCtrlMode_e);
421 
422 typedef struct
423 {
424  void* deviceData;
425  /* Pointer to eMMC/SD device data structure. Memory for this structure has to be allocated in application */
426 
427  uint8_t *dataBuf;
428  /* Pointer to a 512 byte dataBuffer used for temporary data transactions internal to driver like ECSD read, tuning etc. To be allocated by application */
429 
430 } MMCSD_Params;
431 
435 typedef struct
436 {
437  uint32_t ocr;
438  /* Operating conditions register */
439 
440  uint32_t rca;
441  /* Relative card address register */
442 
443  uint16_t maxReadBlockLen;
444  /* Maximum supported block length for read */
445 
447  /* Maximum supported block length for read */
448 
449  char manuDate[9];
450  /* ASCII string with the date of manufacture */
451 
452  uint8_t manuID;
453  /* Card manufacturer ID */
454 
455  char productName[7];
456  /* Product name */
457 
458  /* From CSD */
459  uint8_t specVersion;
460  /* eMMC specification version */
461 
462  uint32_t blockCount;
463  /* Number of blocks in the eMMC */
464 
465  uint8_t transferSpeed;
466  /* Transfer speed in code - Freq Unit x Mult Factor */
467 
468  uint8_t supportedModes;
469  /* Supported speed modes by the device - HS200, HS400 etc */
470 
471  uint8_t eStrobeSupport;
472  /* Support of enhanced strobe */
473 
474  uint8_t driveStrength;
475  /* Drive strength of the device */
476 
478 
482 typedef struct
483 {
484  uint32_t ocr;
485  /* Operating conditions register */
486 
487  uint32_t rca;
488  /* Relative card address register */
489 
490  uint16_t maxReadBlockLen;
491  /* Maximum supported block length for read */
492 
494  /* Maximum supported block length for read */
495 
496  char manuDate[9];
497  /* ASCII string with the date of manufacture */
498 
499  uint8_t manuID;
500  /* Card manufacturer ID */
501 
502  char productName[6];
503  /* Product name */
504 
505  /* From CSD */
506  uint8_t specVersion;
507  /* SD card specification version */
508 
509  uint32_t blockCount;
510  /* Number of blocks in the SD */
511 
512  uint8_t transferSpeed;
513  /* Transfer speed in code - Freq Unit x Mult Factor */
514 
515  uint32_t isCmd23;
516  /* CMD23 support */
517 
519  /* Supported data widths by the device */
520 
522 
530 typedef struct
531 {
532  uint32_t cmd;
535  uint32_t flags;
538  uint32_t arg;
541  void *dataBuf;
544  uint32_t blockSize;
547  uint32_t blockCount;
550  uint32_t response[4];
554 
558 typedef struct
559 {
560  uint32_t instNum;
561  /*< MMC Peripheral instance number */
562 
563  uint32_t baseAddr;
566  uint32_t intrNum;
569  uint32_t inputClk;
570  /*< MMC input functional clock */
571 
572  uint32_t outputClk;
573  /*< MMC output clock */
574 
575  uint32_t cardType;
584  uint32_t intrEnable;
585  /*< MMC enable interrupt */
586 
588  /*< MMC Voltage Switch function */
589 
594 
595  uint32_t dmaEnable;
596  /*EDMA related Hardware configuration details*/
597 
598 } MMCSD_Attrs;
599 
603 typedef struct
604 {
605  uint32_t cardType;
606  /*< Type of card. */
607 
611  uint32_t isOpen;
612  /*< flag to indicate module is open */
613 
614  uint32_t ocr;
615  /*< Operation condition register. */
616 
618  /*< Has the card switched to 1.8V */
619 
620  uint32_t rca;
621  /*< Relative card address. */
622 
623  uint32_t blockCount;
624  /*< Number of blocks. */
625 
626  uint32_t dataBlockCount;
627  /*< Data dec. block counter */
628 
629  uint32_t dataBlockSize;
632  uint8_t support1_8V;
633  /*< Does card support 1.8V. */
634 
635  uint64_t size;
636  /*< Size of the card in bytes. */
637 
638  uint8_t highCap;
639  /*< Is card of high capacity. */
640 
641  uint8_t *dataBufIdx;
642  /*< Data buffer index */
643 
644  uint32_t cid[4];
647  volatile uint32_t cmdComp;
648  /*< Command completion flag */
649 
650  volatile uint32_t cmdTimeout;
651  /*< Command timeout flag */
652 
653  volatile uint32_t xferInProgress;
654  /*< Command completion flag */
655 
656  volatile uint32_t xferComp;
657  /*< Transfer completion flag */
658 
659  uint8_t tranSpeed;
660  /*< Transfer speed. */
661 
662  uint32_t csd[4];
663  /*< Card specific data. */
664 
665  uint32_t scr[2];
666  /*< First value of enumeration. Can be used for validation. */
667 
668  volatile uint32_t xferTimeout;
669  /*< Transfer timeout flag */
670 
671  uint8_t sdVer;
672  /*< Version of card. */
673 
674  uint32_t intrEnable;
675  /*< MMC enable interrupt */
676 
677  uint32_t dmaEnable;
683  uint8_t ecsd[512];
684  /*< eMMC specific data. */
685 
686  uint32_t blockSize;
689  uint8_t busWidth;
690  /*< Bus width. */
691 
692  uint8_t *writeBufIdx; /*< Internal inc. dataBuf index */
693 
694  uint32_t writeBlockCount; /*< Internal dec. blockCounter */
695 
696  uint8_t *readBufIdx; /*< Internal inc. dataBuf index */
697 
698  uint32_t readBlockCount; /*< Internal dec. blockCounter */
699 
700  uint32_t isHC;
718 } MMCSD_Object;
719 
720 typedef struct
721 {
726 } MMCSD_Config;
727 
728 /* ========================================================================== */
729 /* Externs */
730 /* ========================================================================== */
731 
733 extern MMCSD_Config gMmcsdConfig[];
735 extern uint32_t gMmcsdConfigNum;
736 
737 /* ========================================================================== */
738 /* Internal/Private Structure Declarations */
739 /* ========================================================================== */
740 
741 /* ========================================================================== */
742 /* Function Declarations */
743 /* ========================================================================== */
744 
748 void MMCSD_init(void);
749 
753 void MMCSD_deinit(void);
754 
760 void MMCSD_Params_init(MMCSD_Params *mmcsdParams);
761 
776 MMCSD_Handle MMCSD_open(uint32_t index, const MMCSD_Params *openParams);
777 
788 
802 
816 int32_t MMCSD_read(MMCSD_Handle handle, uint8_t *buf, uint32_t startBlk, uint32_t numBlks);
817 
831 int32_t MMCSD_write(MMCSD_Handle handle, uint8_t *buf, uint32_t startBlk, uint32_t numBlks);
832 
846 
860 
861 #ifdef __cplusplus
862 }
863 #endif
864 
865 #endif /* MMCSD_H_ */
MMCSD_sysCfg::enableAutoIdle
uint32_t enableAutoIdle
Definition: mmcsd/v1/mmcsd.h:320
MMCSD_Attrs::intrEnable
uint32_t intrEnable
Definition: mmcsd/v1/mmcsd.h:584
MMCSD_RESET_LINE_MASK_ALL
@ MMCSD_RESET_LINE_MASK_ALL
Definition: mmcsd/v1/mmcsd.h:177
MMCSD_CLK_ACT_FCLK_OFF
@ MMCSD_CLK_ACT_FCLK_OFF
Definition: mmcsd/v1/mmcsd.h:186
MMCSD_open
MMCSD_Handle MMCSD_open(uint32_t index, const MMCSD_Params *openParams)
This function opens a given MMCSD peripheral.
MMCSD_XFER_TYPE_TX
@ MMCSD_XFER_TYPE_TX
Definition: mmcsd/v1/mmcsd.h:257
MMCSD_SdDeviceData::ocr
uint32_t ocr
Definition: mmcsd/v1/mmcsd.h:484
MMCSD_inputClkCtrlMode_e
MMCSD_inputClkCtrlMode_e
ENUMs to read/configure the input clock to the MMC controller.
Definition: mmcsd/v1/mmcsd.h:401
MMCSD_CLK_ACT_ICLK_OFF
@ MMCSD_CLK_ACT_ICLK_OFF
Definition: mmcsd/v1/mmcsd.h:188
MMCSD_SdDeviceData::manuID
uint8_t manuID
Definition: mmcsd/v1/mmcsd.h:499
MMCSD_PWR_CTRL_OFF
@ MMCSD_PWR_CTRL_OFF
Definition: mmcsd/v1/mmcsd.h:213
MMCSD_Object::isHC
uint32_t isHC
Definition: mmcsd/v1/mmcsd.h:700
MMCSD_Object::dataCopyCompleteSemObj
SemaphoreP_Object dataCopyCompleteSemObj
Definition: mmcsd/v1/mmcsd.h:712
MMCSD_Config::attrs
MMCSD_Attrs * attrs
Definition: mmcsd/v1/mmcsd.h:722
MMCSD_INTR_MASK_CMDCOMP
@ MMCSD_INTR_MASK_CMDCOMP
Definition: mmcsd/v1/mmcsd.h:300
MMCSD_SdDeviceData::transferSpeed
uint8_t transferSpeed
Definition: mmcsd/v1/mmcsd.h:512
MMCSD_Attrs::instNum
uint32_t instNum
Definition: mmcsd/v1/mmcsd.h:560
MMCSD_Attrs::baseAddr
uint32_t baseAddr
Definition: mmcsd/v1/mmcsd.h:563
MMCSD_ioDelayParams::deviceType
uint32_t deviceType
Definition: mmcsd/v1/mmcsd.h:385
MMCSD_CMD_TYPE_IO_ABORT
@ MMCSD_CMD_TYPE_IO_ABORT
Definition: mmcsd/v1/mmcsd.h:237
MMCSD_Object::tranSpeed
uint8_t tranSpeed
Definition: mmcsd/v1/mmcsd.h:659
MMCSD_Object::highCap
uint8_t highCap
Definition: mmcsd/v1/mmcsd.h:638
MMCSD_EmmcDeviceData::blockCount
uint32_t blockCount
Definition: mmcsd/v1/mmcsd.h:462
MMCSD_IDLE_MODE_NONE
@ MMCSD_IDLE_MODE_NONE
Definition: mmcsd/v1/mmcsd.h:367
MMCSD_SdDeviceData
SD device properties.
Definition: mmcsd/v1/mmcsd.h:483
MMCSD_Object::dataBlockSize
uint32_t dataBlockSize
Definition: mmcsd/v1/mmcsd.h:629
MMCSD_INTR_MASK_ACMD12ERR
@ MMCSD_INTR_MASK_ACMD12ERR
Definition: mmcsd/v1/mmcsd.h:272
MMCSD_cmd::xferType
uint32_t xferType
Definition: mmcsd/v1/mmcsd.h:336
MMCSD_Transaction::cmd
uint32_t cmd
Definition: mmcsd/v1/mmcsd.h:532
MMCSD_EmmcDeviceData::rca
uint32_t rca
Definition: mmcsd/v1/mmcsd.h:440
MMCSD_BUS_VOLTAGE_1_8V
@ MMCSD_BUS_VOLTAGE_1_8V
Definition: mmcsd/v1/mmcsd.h:392
MMCSD_Object::cmdTimeout
volatile uint32_t cmdTimeout
Definition: mmcsd/v1/mmcsd.h:650
MMCSD_Transaction::blockSize
uint32_t blockSize
Definition: mmcsd/v1/mmcsd.h:544
SystemP.h
MMCSD_IDLE_MODE_SMART
@ MMCSD_IDLE_MODE_SMART
Definition: mmcsd/v1/mmcsd.h:369
MMCSD_Object::busWidth
uint8_t busWidth
Definition: mmcsd/v1/mmcsd.h:689
MMCSD_Object::xferMutex
SemaphoreP_Object xferMutex
Definition: mmcsd/v1/mmcsd.h:706
MMCSD_Object::cmdCompleteSemObj
SemaphoreP_Object cmdCompleteSemObj
Definition: mmcsd/v1/mmcsd.h:709
MMCSD_INTR_MASK_DATACRCERR
@ MMCSD_INTR_MASK_DATACRCERR
Definition: mmcsd/v1/mmcsd.h:276
MMCSD_Object::writeBufIdx
uint8_t * writeBufIdx
Definition: mmcsd/v1/mmcsd.h:692
MMCSD_ioDelayParams::loopBackType
uint32_t loopBackType
Definition: mmcsd/v1/mmcsd.h:388
MMCSD_SdDeviceData::specVersion
uint8_t specVersion
Definition: mmcsd/v1/mmcsd.h:506
MMCSD_xFerType
MMCSD_xFerType
Enumerates the list of response types.
Definition: mmcsd/v1/mmcsd.h:256
MMCSD_CLK_ACT_ICLK_FLCK_ON
@ MMCSD_CLK_ACT_ICLK_FLCK_ON
Definition: mmcsd/v1/mmcsd.h:190
MMCSD_INTR_MASK_TRNFCOMP
@ MMCSD_INTR_MASK_TRNFCOMP
Definition: mmcsd/v1/mmcsd.h:298
MMCSD_BUS_VOLT_3P0
@ MMCSD_BUS_VOLT_3P0
Definition: mmcsd/v1/mmcsd.h:378
MMCSD_INTR_MASK_CARDREM
@ MMCSD_INTR_MASK_CARDREM
Definition: mmcsd/v1/mmcsd.h:290
MMCSD_cmd
Structure for MMCSD command.
Definition: mmcsd/v1/mmcsd.h:329
MMCSD_INTR_MASK_DATABITERR
@ MMCSD_INTR_MASK_DATABITERR
Definition: mmcsd/v1/mmcsd.h:274
MMCSD_Object::blockCount
uint32_t blockCount
Definition: mmcsd/v1/mmcsd.h:623
MMCSD_CMD_TYPE_BUS_SUSPEND
@ MMCSD_CMD_TYPE_BUS_SUSPEND
Definition: mmcsd/v1/mmcsd.h:233
MMCSD_Attrs::supportedBusWidth
uint32_t supportedBusWidth
Definition: mmcsd/v1/mmcsd.h:578
MMCSD_Object::xferCompleteSemObj
SemaphoreP_Object xferCompleteSemObj
Definition: mmcsd/v1/mmcsd.h:715
MMCSD_Attrs::supportedBusVoltages
uint32_t supportedBusVoltages
Definition: mmcsd/v1/mmcsd.h:581
MMCSD_STANDBY_MODE_FORCE
@ MMCSD_STANDBY_MODE_FORCE
Definition: mmcsd/v1/mmcsd.h:197
SemaphoreP.h
MMCSD_SdDeviceData::maxReadBlockLen
uint16_t maxReadBlockLen
Definition: mmcsd/v1/mmcsd.h:490
MMCSD_Object::isOpen
uint32_t isOpen
Definition: mmcsd/v1/mmcsd.h:611
MMCSD_Config::object
MMCSD_Object * object
Definition: mmcsd/v1/mmcsd.h:724
MMCSD_INTR_MASK_BADACCESS
@ MMCSD_INTR_MASK_BADACCESS
Definition: mmcsd/v1/mmcsd.h:266
MMCSD_Object::cardType
uint32_t cardType
Definition: mmcsd/v1/mmcsd.h:605
MMCSD_init
void MMCSD_init(void)
This function initializes the MMCSD module.
MMCSD_Attrs::outputClk
uint32_t outputClk
Definition: mmcsd/v1/mmcsd.h:572
MMCSD_suppVolt
MMCSD_suppVolt
Enumerates the list of supported bus voltages.
Definition: mmcsd/v1/mmcsd.h:219
MMCSD_RSP_TYPE_NONE
@ MMCSD_RSP_TYPE_NONE
Definition: mmcsd/v1/mmcsd.h:244
MMCSD_cmdObj::enableData
uint32_t enableData
Definition: mmcsd/v1/mmcsd.h:347
MMCSD_STANDBY_MODE_SMART_WAKEUP
@ MMCSD_STANDBY_MODE_SMART_WAKEUP
Definition: mmcsd/v1/mmcsd.h:203
MMCSD_ioDelayParams::operatingVoltage
uint32_t operatingVoltage
Definition: mmcsd/v1/mmcsd.h:387
MMCSD_sysCfg::enableWakeup
uint32_t enableWakeup
Definition: mmcsd/v1/mmcsd.h:316
MMCSD_cmdType
MMCSD_cmdType
Enumerates the list of command types.
Definition: mmcsd/v1/mmcsd.h:230
MMCSD_Transaction
MMCSD transaction.
Definition: mmcsd/v1/mmcsd.h:531
MMCSD_cmdObj
Structure holding the hs mmcsd controller command object.
Definition: mmcsd/v1/mmcsd.h:342
MMCSD_CMD_TYPE_OTHER
@ MMCSD_CMD_TYPE_OTHER
Definition: mmcsd/v1/mmcsd.h:231
MMCSD_pwrCtrl
MMCSD_pwrCtrl
Enumerates macros to configure power on/off.
Definition: mmcsd/v1/mmcsd.h:210
MMCSD_STANDBY_MODE_NONE
@ MMCSD_STANDBY_MODE_NONE
Definition: mmcsd/v1/mmcsd.h:199
MMCSD_Attrs::inputClk
uint32_t inputClk
Definition: mmcsd/v1/mmcsd.h:569
MMCSD_EmmcDeviceData::eStrobeSupport
uint8_t eStrobeSupport
Definition: mmcsd/v1/mmcsd.h:471
MMCSD_EmmcDeviceData::manuID
uint8_t manuID
Definition: mmcsd/v1/mmcsd.h:452
MMCSD_cmd::cmdId
uint32_t cmdId
Definition: mmcsd/v1/mmcsd.h:330
MMCSD_Object::size
uint64_t size
Definition: mmcsd/v1/mmcsd.h:635
MMCSD_Attrs::cardType
uint32_t cardType
Definition: mmcsd/v1/mmcsd.h:575
MMCSD_switchVoltage
int32_t(* MMCSD_switchVoltage)(uint32_t controllerNum, MMCSD_BusVoltage voltage)
A function pointer to set the voltage of the MMC I/O Cells and PBAIS to the desired voltage.
Definition: mmcsd/v1/mmcsd.h:415
MMCSD_SdDeviceData::isCmd23
uint32_t isCmd23
Definition: mmcsd/v1/mmcsd.h:515
MMCSD_EmmcDeviceData::specVersion
uint8_t specVersion
Definition: mmcsd/v1/mmcsd.h:459
MMCSD_EmmcDeviceData::ocr
uint32_t ocr
Definition: mmcsd/v1/mmcsd.h:437
MMCSD_BUS_VOLT_1P8
@ MMCSD_BUS_VOLT_1P8
Definition: mmcsd/v1/mmcsd.h:376
MMCSD_read
int32_t MMCSD_read(MMCSD_Handle handle, uint8_t *buf, uint32_t startBlk, uint32_t numBlks)
Function to perform block reads from the MMC/SD media.
gMmcsdConfigNum
uint32_t gMmcsdConfigNum
Externally defined driver configuration array size.
MMCSD_IDLE_MODE_FORCE
@ MMCSD_IDLE_MODE_FORCE
Definition: mmcsd/v1/mmcsd.h:365
HwiP.h
MMCSD_Attrs::intrNum
uint32_t intrNum
Definition: mmcsd/v1/mmcsd.h:566
MMCSD_INTR_MASK_DATATIMEOUT
@ MMCSD_INTR_MASK_DATATIMEOUT
Definition: mmcsd/v1/mmcsd.h:278
MMCSD_Attrs::dmaEnable
uint32_t dmaEnable
Definition: mmcsd/v1/mmcsd.h:595
MMCSD_SUPP_VOLT_3P0
@ MMCSD_SUPP_VOLT_3P0
Definition: mmcsd/v1/mmcsd.h:222
MMCSD_INTR_MASK_ERR
@ MMCSD_INTR_MASK_ERR
Definition: mmcsd/v1/mmcsd.h:288
MMCSD_busVolt
MMCSD_busVolt
Enumerates mmc sd controller's bus voltages.
Definition: mmcsd/v1/mmcsd.h:375
MMCSD_clkAct
MMCSD_clkAct
Enumerates the clock activity configurations during wake up .
Definition: mmcsd/v1/mmcsd.h:183
MMCSD_Transaction::flags
uint32_t flags
Definition: mmcsd/v1/mmcsd.h:535
MMCSD_Object::hwiObj
HwiP_Object hwiObj
Definition: mmcsd/v1/mmcsd.h:680
MMCSD_Attrs::iodelayFxn
MMCSD_iodelayFxn iodelayFxn
Definition: mmcsd/v1/mmcsd.h:587
MMCSD_getBlockCount
uint32_t MMCSD_getBlockCount(MMCSD_Handle handle)
This function returns the block count of User Data Area of the MMC/SD media connected to the MMCSD co...
MMCSD_BUS_VOLT_3P3
@ MMCSD_BUS_VOLT_3P3
Definition: mmcsd/v1/mmcsd.h:380
MMCSD_cmdObj::enableDma
uint32_t enableDma
Definition: mmcsd/v1/mmcsd.h:356
MMCSD_rspType
MMCSD_rspType
Enumerates the list of response types.
Definition: mmcsd/v1/mmcsd.h:243
MMCSD_SdDeviceData::rca
uint32_t rca
Definition: mmcsd/v1/mmcsd.h:487
MMCSD_RSP_TYPE_LEN_48_BUSY
@ MMCSD_RSP_TYPE_LEN_48_BUSY
Definition: mmcsd/v1/mmcsd.h:250
MMCSD_XFER_TYPE_RX
@ MMCSD_XFER_TYPE_RX
Definition: mmcsd/v1/mmcsd.h:259
MMCSD_EmmcDeviceData::supportedModes
uint8_t supportedModes
Definition: mmcsd/v1/mmcsd.h:468
MMCSD_Params::dataBuf
uint8_t * dataBuf
Definition: mmcsd/v1/mmcsd.h:427
MMCSD_Object::readBufIdx
uint8_t * readBufIdx
Definition: mmcsd/v1/mmcsd.h:696
MMCSD_resetLineMask
MMCSD_resetLineMask
MMCSD instance attributes - used during init time.
Definition: mmcsd/v1/mmcsd.h:172
MMCSD_Attrs::inputClockControl
MMCSD_inputClockControl inputClockControl
Definition: mmcsd/v1/mmcsd.h:593
MMCSD_Handle
void * MMCSD_Handle
Definition: mmcsd/v1/mmcsd.h:158
MMCSD_INTR_MASK_CMDINDXERR
@ MMCSD_INTR_MASK_CMDINDXERR
Definition: mmcsd/v1/mmcsd.h:280
MMCSD_BUS_VOLTAGE_3_0V
@ MMCSD_BUS_VOLTAGE_3_0V
Definition: mmcsd/v1/mmcsd.h:393
MMCSD_Object::xferInProgress
volatile uint32_t xferInProgress
Definition: mmcsd/v1/mmcsd.h:653
MMCSD_Params
Definition: mmcsd/v1/mmcsd.h:423
MMCSD_getBlockSize
uint32_t MMCSD_getBlockSize(MMCSD_Handle handle)
This function returns the block size of the MMC/SD media connected to the MMCSD controller.
MMCSD_INPUT_CLOCK_CTRL_GET
@ MMCSD_INPUT_CLOCK_CTRL_GET
Definition: mmcsd/v1/mmcsd.h:402
MMCSD_Object::dataBlockCount
uint32_t dataBlockCount
Definition: mmcsd/v1/mmcsd.h:626
MMCSD_EmmcDeviceData
eMMC device properties
Definition: mmcsd/v1/mmcsd.h:436
MMCSD_BUS_VOLTAGE_3_3V
@ MMCSD_BUS_VOLTAGE_3_3V
Definition: mmcsd/v1/mmcsd.h:394
MMCSD_SUPP_VOLT_3P3
@ MMCSD_SUPP_VOLT_3P3
Definition: mmcsd/v1/mmcsd.h:224
MMCSD_deinit
void MMCSD_deinit(void)
This function de-initializes the MMCSD module.
MMCSD_cmdObj::cmd
MMCSD_cmd cmd
Definition: mmcsd/v1/mmcsd.h:343
MMCSD_EmmcDeviceData::maxReadBlockLen
uint16_t maxReadBlockLen
Definition: mmcsd/v1/mmcsd.h:443
MMCSD_Object
MMCSD driver object.
Definition: mmcsd/v1/mmcsd.h:604
MMCSD_sysCfg::idleMode
uint32_t idleMode
Definition: mmcsd/v1/mmcsd.h:313
MMCSD_Object::xferComp
volatile uint32_t xferComp
Definition: mmcsd/v1/mmcsd.h:656
MMCSD_INTR_MASK_CMDCRCERR
@ MMCSD_INTR_MASK_CMDCRCERR
Definition: mmcsd/v1/mmcsd.h:284
MMCSD_EmmcDeviceData::transferSpeed
uint8_t transferSpeed
Definition: mmcsd/v1/mmcsd.h:465
MMCSD_SdDeviceData::supportedDataWidths
uint32_t supportedDataWidths
Definition: mmcsd/v1/mmcsd.h:518
MMCSD_iodelayFxn
int32_t(* MMCSD_iodelayFxn)(uint32_t instanceNum, MMCSD_ioDelayParams *iodelayParams)
Return status of MMCSD.
Definition: mmcsd/v1/mmcsd.h:410
MMCSD_Params_init
void MMCSD_Params_init(MMCSD_Params *mmcsdParams)
Initialize data structure with defaults.
MMCSD_RSP_TYPE_LEN_136
@ MMCSD_RSP_TYPE_LEN_136
Definition: mmcsd/v1/mmcsd.h:246
MMCSD_Transaction::dataBuf
void * dataBuf
Definition: mmcsd/v1/mmcsd.h:541
HwiP_Object
Opaque Hwi object used with the Hwi APIs.
Definition: HwiP.h:93
MMCSD_Object::handle
MMCSD_Handle handle
Definition: mmcsd/v1/mmcsd.h:608
MMCSD_cmdObj::numBlks
uint32_t numBlks
Definition: mmcsd/v1/mmcsd.h:352
MMCSD_Params::deviceData
void * deviceData
Definition: mmcsd/v1/mmcsd.h:424
MMCSD_INTR_MASK_CMDTIMEOUT
@ MMCSD_INTR_MASK_CMDTIMEOUT
Definition: mmcsd/v1/mmcsd.h:286
MMCSD_EmmcDeviceData::maxWriteBlockLen
uint16_t maxWriteBlockLen
Definition: mmcsd/v1/mmcsd.h:446
MMCSD_Object::rca
uint32_t rca
Definition: mmcsd/v1/mmcsd.h:620
MMCSD_INTR_MASK_CARDERROR
@ MMCSD_INTR_MASK_CARDERROR
Definition: mmcsd/v1/mmcsd.h:268
MMCSD_INTR_MASK_CMDBITERR
@ MMCSD_INTR_MASK_CMDBITERR
Definition: mmcsd/v1/mmcsd.h:282
MMCSD_Transaction::arg
uint32_t arg
Definition: mmcsd/v1/mmcsd.h:538
MMCSD_Object::sdVer
uint8_t sdVer
Definition: mmcsd/v1/mmcsd.h:671
MMCSD_Config
Definition: mmcsd/v1/mmcsd.h:721
MMCSD_BusVoltage
MMCSD_BusVoltage
Definition: mmcsd/v1/mmcsd.h:391
MMCSD_Transaction::blockCount
uint32_t blockCount
Definition: mmcsd/v1/mmcsd.h:547
SemaphoreP_Object
Opaque semaphore object used with the semaphore APIs.
Definition: SemaphoreP.h:59
MMCSD_sysCfg::standbyMode
uint32_t standbyMode
Definition: mmcsd/v1/mmcsd.h:310
MMCSD_cmdObj::cmdArg
uint32_t cmdArg
Definition: mmcsd/v1/mmcsd.h:345
gMmcsdConfig
MMCSD_Config gMmcsdConfig[]
Externally defined driver configuration array.
MMCSD_RSP_TYPE_LEN_48
@ MMCSD_RSP_TYPE_LEN_48
Definition: mmcsd/v1/mmcsd.h:248
MMCSD_ioDelayParams
Definition: mmcsd/v1/mmcsd.h:384
MMCSD_Attrs
MMCSD instance attributes - used during init time.
Definition: mmcsd/v1/mmcsd.h:559
MMCSD_ioDelayParams::transferSpeed
uint32_t transferSpeed
Definition: mmcsd/v1/mmcsd.h:386
MMCSD_RESET_LINE_MASK_DATA
@ MMCSD_RESET_LINE_MASK_DATA
Definition: mmcsd/v1/mmcsd.h:173
MMCSD_sysCfg::clockActivity
uint32_t clockActivity
Definition: mmcsd/v1/mmcsd.h:307
MMCSD_SUPP_VOLT_1P8
@ MMCSD_SUPP_VOLT_1P8
Definition: mmcsd/v1/mmcsd.h:220
MMCSD_SdDeviceData::blockCount
uint32_t blockCount
Definition: mmcsd/v1/mmcsd.h:509
MMCSD_close
void MMCSD_close(MMCSD_Handle handle)
Function to close a MMCSD peripheral specified by the MMCSD handle.
MMCSD_STANDBY_MODE_SMART
@ MMCSD_STANDBY_MODE_SMART
Definition: mmcsd/v1/mmcsd.h:201
MMCSD_CMD_TYPE_FUNC_SEL
@ MMCSD_CMD_TYPE_FUNC_SEL
Definition: mmcsd/v1/mmcsd.h:235
MMCSD_Object::cmdMutex
SemaphoreP_Object cmdMutex
Definition: mmcsd/v1/mmcsd.h:703
MMCSD_Attrs::switchVoltageFxn
MMCSD_switchVoltage switchVoltageFxn
Definition: mmcsd/v1/mmcsd.h:590
MMCSD_INTR_MASK_BUFRDRDY
@ MMCSD_INTR_MASK_BUFRDRDY
Definition: mmcsd/v1/mmcsd.h:294
MMCSD_cmd::cmdType
uint32_t cmdType
Definition: mmcsd/v1/mmcsd.h:332
MMCSD_Object::xferTimeout
volatile uint32_t xferTimeout
Definition: mmcsd/v1/mmcsd.h:668
MMCSD_cmd::rspType
uint32_t rspType
Definition: mmcsd/v1/mmcsd.h:334
MMCSD_Object::ocr
uint32_t ocr
Definition: mmcsd/v1/mmcsd.h:614
MMCSD_RESET_LINE_MASK_CMD
@ MMCSD_RESET_LINE_MASK_CMD
Definition: mmcsd/v1/mmcsd.h:175
MMCSD_Object::intrEnable
uint32_t intrEnable
Definition: mmcsd/v1/mmcsd.h:674
MMCSD_Object::readBlockCount
uint32_t readBlockCount
Definition: mmcsd/v1/mmcsd.h:698
MMCSD_idleMode
MMCSD_idleMode
Enumerates the idle modes.
Definition: mmcsd/v1/mmcsd.h:364
MMCSD_write
int32_t MMCSD_write(MMCSD_Handle handle, uint8_t *buf, uint32_t startBlk, uint32_t numBlks)
Function to perform block writes to the MMC/SD media.
MMCSD_Object::cmdComp
volatile uint32_t cmdComp
Definition: mmcsd/v1/mmcsd.h:647
MMCSD_getHandle
MMCSD_Handle MMCSD_getHandle(uint32_t index)
This function returns the handle of an open MMCSD Instance from the instance index.
MMCSD_intrMask
MMCSD_intrMask
Enumerates the controller's interrupt masks.
Definition: mmcsd/v1/mmcsd.h:265
MMCSD_Object::support1_8V
uint8_t support1_8V
Definition: mmcsd/v1/mmcsd.h:632
MMCSD_CLK_ACT_ICLK_FCLK_OFF
@ MMCSD_CLK_ACT_ICLK_FCLK_OFF
Definition: mmcsd/v1/mmcsd.h:184
MMCSD_Object::dmaEnable
uint32_t dmaEnable
Definition: mmcsd/v1/mmcsd.h:677
MMCSD_EmmcDeviceData::driveStrength
uint8_t driveStrength
Definition: mmcsd/v1/mmcsd.h:474
MMCSD_sysCfg
Structure holding the hs mmcsd controller system configurations.
Definition: mmcsd/v1/mmcsd.h:306
MMCSD_standbyMode
MMCSD_standbyMode
Enumerates the standby modes.
Definition: mmcsd/v1/mmcsd.h:196
MMCSD_Object::switched_to_v18
uint8_t switched_to_v18
Definition: mmcsd/v1/mmcsd.h:617
MMCSD_inputClockControl
uint32_t(* MMCSD_inputClockControl)(uint32_t instNum, uint32_t *clkFreq, MMCSD_inputClkCtrlMode_e)
A function pointer to read/configure the input clock to the MMC controller.
Definition: mmcsd/v1/mmcsd.h:420
MMCSD_Object::dataBufIdx
uint8_t * dataBufIdx
Definition: mmcsd/v1/mmcsd.h:641
MMCSD_INTR_MASK_ADMAERROR
@ MMCSD_INTR_MASK_ADMAERROR
Definition: mmcsd/v1/mmcsd.h:270
MMCSD_Object::writeBlockCount
uint32_t writeBlockCount
Definition: mmcsd/v1/mmcsd.h:694
MMCSD_INTR_MASK_BUFWRRDY
@ MMCSD_INTR_MASK_BUFWRRDY
Definition: mmcsd/v1/mmcsd.h:296
MMCSD_Object::blockSize
uint32_t blockSize
Definition: mmcsd/v1/mmcsd.h:686
MMCSD_PWR_CTRL_ON
@ MMCSD_PWR_CTRL_ON
Definition: mmcsd/v1/mmcsd.h:211
MMCSD_INPUT_CLOCK_CTRL_SET
@ MMCSD_INPUT_CLOCK_CTRL_SET
Definition: mmcsd/v1/mmcsd.h:403
MMCSD_INTR_MASK_CARDINS
@ MMCSD_INTR_MASK_CARDINS
Definition: mmcsd/v1/mmcsd.h:292
MMCSD_SdDeviceData::maxWriteBlockLen
uint16_t maxWriteBlockLen
Definition: mmcsd/v1/mmcsd.h:493