Lines Matching full:response

143     uint8_t *response  in _send_cmd()  argument
184 message.recv_buf = response; in _send_cmd()
191 if (0 == (response[0] & 0x80)) in _send_cmd()
195 } /* wait response */ in _send_cmd()
238 message.recv_buf = response + 1; in _send_cmd()
249 message.recv_buf = response + 1; in _send_cmd()
404 /* put crc and get data response */ in _write_block()
407 uint8_t response; in _write_block() local
418 // response = 0x0E & recv_buffer[2]; in _write_block()
419 response = MSD_GET_DATA_RESPONSE(recv_buffer[2]); in _write_block()
420 if (response != MSD_DATA_OK) in _write_block()
422 MSD_DEBUG("[err] write block fail! data response : 0x%02X\r\n", response); in _write_block()
457 uint8_t response[MSD_RESPONSE_MAX_LEN]; in rt_msd_init() local
514 … result = _send_cmd(msd->spi_device, GO_IDLE_STATE, 0x00, 0x95, response_r1, response); in rt_msd_init()
517 if ((result == RT_EOK) && (response[0] == MSD_IN_IDLE_STATE)) in rt_msd_init()
540 … result = _send_cmd(msd->spi_device, SEND_IF_COND, 0x01AA, 0x87, response_r7, response); in rt_msd_init()
545 MSD_DEBUG("[info] CMD8 response : 0x%02X 0x%02X 0x%02X 0x%02X 0x%02X\r\n", in rt_msd_init()
546 response[0], response[1], response[2], response[3], response[4]); in rt_msd_init()
548 if (response[0] & (1 << 2)) in rt_msd_init()
563 if ((0xAA == response[4]) && (0x00 == response[3])) in rt_msd_init()
581 while (0xAA != response[4]); in rt_msd_init()
595 result = _send_cmd(msd->spi_device, READ_OCR, 0x00, 0x00, response_r3, response); in rt_msd_init()
599 MSD_DEBUG("[info] It maybe SD1.x or MMC But it is Not response to CMD58!\r\n"); in rt_msd_init()
603 if (0 != (response[0] & 0xFE)) in rt_msd_init()
611 OCR = response[1]; in rt_msd_init()
612 OCR = (OCR << 8) + response[2]; in rt_msd_init()
613 OCR = (OCR << 8) + response[3]; in rt_msd_init()
614 OCR = (OCR << 8) + response[4]; in rt_msd_init()
640 result = _send_cmd(msd->spi_device, APP_CMD, 0x00, 0x00, response_r1, response); in rt_msd_init()
647 if (0 != (response[0] & 0xFE)) in rt_msd_init()
655 … result = _send_cmd(msd->spi_device, SD_SEND_OP_COND, 0x00, 0x00, response_r1, response); in rt_msd_init()
662 if (0 != (response[0] & 0xFE)) in rt_msd_init()
669 if (0 == (response[0] & 0xFF)) in rt_msd_init()
712 … result = _send_cmd(msd->spi_device, GO_IDLE_STATE, 0x00, 0x95, response_r1, response); in rt_msd_init()
715 if ((result == RT_EOK) && (response[0] == MSD_IN_IDLE_STATE)) in rt_msd_init()
733 … result = _send_cmd(msd->spi_device, SEND_OP_COND, 0x00, 0x00, response_r1, response); in rt_msd_init()
736 if ((result == RT_EOK) && (response[0] == MSD_RESPONSE_NO_ERROR)) in rt_msd_init()
756 result = _send_cmd(msd->spi_device, READ_OCR, 0x00, 0x00, response_r3, response); in rt_msd_init()
760 MSD_DEBUG("[err] It maybe SD2.0 But it is Not response to CMD58!\r\n"); in rt_msd_init()
764 if ((response[0] & 0xFE) != 0) in rt_msd_init()
774 OCR = response[1]; in rt_msd_init()
775 OCR = (OCR << 8) + response[2]; in rt_msd_init()
776 OCR = (OCR << 8) + response[3]; in rt_msd_init()
777 OCR = (OCR << 8) + response[4]; in rt_msd_init()
803 result = _send_cmd(msd->spi_device, APP_CMD, 0x00, 0x65, response_r1, response); in rt_msd_init()
804 // if((result != RT_EOK) || (response[0] == 0x01)) in rt_msd_init()
811 if ((response[0] & 0xFE) != 0) in rt_msd_init()
820 … result = _send_cmd(msd->spi_device, SD_SEND_OP_COND, 0x40000000, 0x77, response_r1, response); in rt_msd_init()
829 if ((response[0] & 0xFE) != 0) in rt_msd_init()
832 MSD_DEBUG("[info] Not SD card4 , response : 0x%02X\r\n", response[0]); in rt_msd_init()
836 while (response[0] != MSD_RESPONSE_NO_ERROR); in rt_msd_init()
842 result = _send_cmd(msd->spi_device, READ_OCR, 0x00, 0x00, response_r3, response); in rt_msd_init()
846 MSD_DEBUG("[err] It maybe SD2.0 But it is Not response to 2nd CMD58!\r\n"); in rt_msd_init()
850 if ((response[0] & 0xFE) != 0) in rt_msd_init()
859 OCR = response[1]; in rt_msd_init()
860 OCR = (OCR << 8) + response[2]; in rt_msd_init()
861 OCR = (OCR << 8) + response[3]; in rt_msd_init()
862 OCR = (OCR << 8) + response[4]; in rt_msd_init()
907 result = _send_cmd(msd->spi_device, CRC_ON_OFF, 0x01, 0x83, response_r1, response); in rt_msd_init()
909 result = _send_cmd(msd->spi_device, CRC_ON_OFF, 0x00, 0x91, response_r1, response); in rt_msd_init()
912 if ((result != RT_EOK) || (response[0] != MSD_RESPONSE_NO_ERROR)) in rt_msd_init()
914 MSD_DEBUG("[err] CMD59 CRC_ON_OFF fail! response : 0x%02X\r\n", response[0]); in rt_msd_init()
924 result = _send_cmd(msd->spi_device, SET_BLOCKLEN, SECTOR_SIZE, 0x00, response_r1, response); in rt_msd_init()
926 if ((result != RT_EOK) || (response[0] != MSD_RESPONSE_NO_ERROR)) in rt_msd_init()
928 MSD_DEBUG("[err] CMD16 SET_BLOCKLEN fail! response : 0x%02X\r\n", response[0]); in rt_msd_init()
941 // result = _send_cmd(msd->spi_device, SEND_CSD, 0x00, 0xAF, response_r1, response); in rt_msd_init()
942 result = _send_cmd(msd->spi_device, SEND_CSD, 0x00, 0x00, response_r1, response); in rt_msd_init()
951 if ((result != RT_EOK) || (response[0] != MSD_RESPONSE_NO_ERROR)) in rt_msd_init()
954 MSD_DEBUG("[err] CMD9 SEND_CSD fail! response : 0x%02X\r\n", response[0]); in rt_msd_init()
1209 uint8_t response[MSD_RESPONSE_MAX_LEN]; in rt_msd_read() local
1224 …>spi_device, READ_SINGLE_BLOCK, pos * msd->geometry.bytes_per_sector, 0x00, response_r1, response); in rt_msd_read()
1225 if ((result != RT_EOK) || (response[0] != MSD_RESPONSE_NO_ERROR)) in rt_msd_read()
1245 …pi_device, READ_MULTIPLE_BLOCK, pos * msd->geometry.bytes_per_sector, 0x00, response_r1, response); in rt_msd_read()
1246 if ((result != RT_EOK) || (response[0] != MSD_RESPONSE_NO_ERROR)) in rt_msd_read()
1267 result = _send_cmd(msd->spi_device, STOP_TRANSMISSION, 0x00, 0x00, response_r1b, response); in rt_msd_read()
1285 uint8_t response[MSD_RESPONSE_MAX_LEN]; in rt_msd_sdhc_read() local
1300 result = _send_cmd(msd->spi_device, READ_SINGLE_BLOCK, pos, 0x00, response_r1, response); in rt_msd_sdhc_read()
1301 if ((result != RT_EOK) || (response[0] != MSD_RESPONSE_NO_ERROR)) in rt_msd_sdhc_read()
1321 result = _send_cmd(msd->spi_device, READ_MULTIPLE_BLOCK, pos, 0x00, response_r1, response); in rt_msd_sdhc_read()
1322 if ((result != RT_EOK) || (response[0] != MSD_RESPONSE_NO_ERROR)) in rt_msd_sdhc_read()
1343 result = _send_cmd(msd->spi_device, STOP_TRANSMISSION, 0x00, 0x00, response_r1b, response); in rt_msd_sdhc_read()
1361 uint8_t response[MSD_RESPONSE_MAX_LEN]; in rt_msd_write() local
1377 …d(msd->spi_device, WRITE_BLOCK, pos * msd->geometry.bytes_per_sector, 0x00, response_r1, response); in rt_msd_write()
1378 if ((result != RT_EOK) || (response[0] != MSD_RESPONSE_NO_ERROR)) in rt_msd_write()
1403 result = _send_cmd(msd->spi_device, APP_CMD, 0x00, 0x00, response_r1, response); in rt_msd_write()
1404 if ((result != RT_EOK) || (response[0] != MSD_RESPONSE_NO_ERROR)) in rt_msd_write()
1412 … result = _send_cmd(msd->spi_device, SET_WR_BLK_ERASE_COUNT, size, 0x00, response_r1, response); in rt_msd_write()
1413 if ((result != RT_EOK) || (response[0] != MSD_RESPONSE_NO_ERROR)) in rt_msd_write()
1422 …i_device, WRITE_MULTIPLE_BLOCK, pos * msd->geometry.bytes_per_sector, 0x00, response_r1, response); in rt_msd_write()
1423 if ((result != RT_EOK) || (response[0] != MSD_RESPONSE_NO_ERROR)) in rt_msd_write()
1481 uint8_t response[MSD_RESPONSE_MAX_LEN]; in rt_msd_sdhc_write() local
1495 result = _send_cmd(msd->spi_device, WRITE_BLOCK, pos, 0x00, response_r1, response); in rt_msd_sdhc_write()
1496 if ((result != RT_EOK) || (response[0] != MSD_RESPONSE_NO_ERROR)) in rt_msd_sdhc_write()
1519 result = _send_cmd(msd->spi_device, APP_CMD, 0x00, 0x00, response_r1, response); in rt_msd_sdhc_write()
1520 if ((result != RT_EOK) || (response[0] != MSD_RESPONSE_NO_ERROR)) in rt_msd_sdhc_write()
1528 … result = _send_cmd(msd->spi_device, SET_WR_BLK_ERASE_COUNT, size, 0x00, response_r1, response); in rt_msd_sdhc_write()
1529 if ((result != RT_EOK) || (response[0] != MSD_RESPONSE_NO_ERROR)) in rt_msd_sdhc_write()
1537 result = _send_cmd(msd->spi_device, WRITE_MULTIPLE_BLOCK, pos, 0x00, response_r1, response); in rt_msd_sdhc_write()
1538 if ((result != RT_EOK) || (response[0] != MSD_RESPONSE_NO_ERROR)) in rt_msd_sdhc_write()