Lines Matching full:card
14 static struct sd_card card; variable
17 * Verify that SD stack can initialize an SDIO card.
18 * This test must run first, to ensure the card is initialized.
27 zassert_equal(ret, 1, "SD card not present in slot"); in ZTEST()
29 ret = sd_init(sdhc_dev, &card); in ZTEST()
30 zassert_equal(ret, 0, "Card initialization failed"); in ZTEST()
35 * we just read from the card common I/O area.
42 /* Read from card common I/O area. */ in ZTEST()
43 ret = sdio_read_byte(&card.func0, SDIO_CCCR_CCCR, ®); in ZTEST()
44 zassert_equal(ret, 0, "SD card read failed"); in ZTEST()
49 /* Simply dump the card configuration. */
52 switch (card.card_voltage) { in ZTEST()
54 TC_PRINT("Card voltage: 1.2V\n"); in ZTEST()
57 TC_PRINT("Card voltage: 1.8V\n"); in ZTEST()
60 TC_PRINT("Card voltage: 3.0V\n"); in ZTEST()
63 TC_PRINT("Card voltage: 3.3V\n"); in ZTEST()
66 zassert_unreachable("Card voltage is not known value"); in ZTEST()
68 zassert_equal(card.status, CARD_INITIALIZED, "Card status is not OK"); in ZTEST()
69 switch (card.card_speed) { in ZTEST()
71 TC_PRINT("Card timing: SDR12\n"); in ZTEST()
74 TC_PRINT("Card timing: SDR25\n"); in ZTEST()
77 TC_PRINT("Card timing: SDR50\n"); in ZTEST()
80 TC_PRINT("Card timing: SDR104\n"); in ZTEST()
83 TC_PRINT("Card timing: DDR50\n"); in ZTEST()
86 zassert_unreachable("Card timing is not known value"); in ZTEST()
88 switch (card.type) { in ZTEST()
90 TC_PRINT("Card type: SDIO\n"); in ZTEST()
93 TC_PRINT("Card type: SDMMC\n"); in ZTEST()
96 TC_PRINT("Card type: combo card\n"); in ZTEST()
99 zassert_unreachable("Card type is not known value"); in ZTEST()
101 if (card.sd_version >= SD_SPEC_VER3_0) { in ZTEST()
102 TC_PRINT("Card spec: 3.0\n"); in ZTEST()
103 } else if (card.sd_version >= SD_SPEC_VER2_0) { in ZTEST()
104 TC_PRINT("Card spec: 2.0\n"); in ZTEST()
105 } else if (card.sd_version >= SD_SPEC_VER1_1) { in ZTEST()
106 TC_PRINT("Card spec: 1.1\n"); in ZTEST()
107 } else if (card.sd_version >= SD_SPEC_VER1_0) { in ZTEST()
108 TC_PRINT("Card spec: 1.0\n"); in ZTEST()
110 zassert_unreachable("Card spec is unknown value"); in ZTEST()