Lines Matching refs: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()
245 response[1] = recv_buffer[0]; in _send_cmd()
257 response[1] = recv_buffer[0]; in _send_cmd()
258 response[2] = recv_buffer[1]; in _send_cmd()
259 response[3] = recv_buffer[2]; in _send_cmd()
260 response[4] = recv_buffer[3]; in _send_cmd()
413 uint8_t response; in _write_block() local
425 response = MSD_GET_DATA_RESPONSE(recv_buffer[2]); in _write_block()
426 if (response != MSD_DATA_OK) in _write_block()
428 MSD_DEBUG("[err] write block fail! data response : 0x%02X\r\n", response); in _write_block()
463 uint8_t response[MSD_RESPONSE_MAX_LEN]; in rt_msd_init() local
520 … result = _send_cmd(msd->spi_device, GO_IDLE_STATE, 0x00, 0x95, response_r1, response); in rt_msd_init()
523 if ((result == RT_EOK) && (response[0] == MSD_IN_IDLE_STATE)) in rt_msd_init()
546 … result = _send_cmd(msd->spi_device, SEND_IF_COND, 0x01AA, 0x87, response_r7, response); in rt_msd_init()
552 response[0], response[1], response[2], response[3], response[4]); in rt_msd_init()
554 if (response[0] & (1 << 2)) in rt_msd_init()
569 if ((0xAA == response[4]) && (0x00 == response[3])) in rt_msd_init()
587 while (0xAA != response[4]); in rt_msd_init()
601 result = _send_cmd(msd->spi_device, READ_OCR, 0x00, 0x00, response_r3, response); in rt_msd_init()
609 if (0 != (response[0] & 0xFE)) in rt_msd_init()
617 OCR = response[1]; in rt_msd_init()
618 OCR = (OCR << 8) + response[2]; in rt_msd_init()
619 OCR = (OCR << 8) + response[3]; in rt_msd_init()
620 OCR = (OCR << 8) + response[4]; in rt_msd_init()
646 result = _send_cmd(msd->spi_device, APP_CMD, 0x00, 0x00, response_r1, response); in rt_msd_init()
653 if (0 != (response[0] & 0xFE)) in rt_msd_init()
661 … result = _send_cmd(msd->spi_device, SD_SEND_OP_COND, 0x00, 0x00, response_r1, response); in rt_msd_init()
668 if (0 != (response[0] & 0xFE)) in rt_msd_init()
675 if (0 == (response[0] & 0xFF)) in rt_msd_init()
718 … result = _send_cmd(msd->spi_device, GO_IDLE_STATE, 0x00, 0x95, response_r1, response); in rt_msd_init()
721 if ((result == RT_EOK) && (response[0] == MSD_IN_IDLE_STATE)) in rt_msd_init()
739 … result = _send_cmd(msd->spi_device, SEND_OP_COND, 0x00, 0x00, response_r1, response); in rt_msd_init()
742 if ((result == RT_EOK) && (response[0] == MSD_RESPONSE_NO_ERROR)) in rt_msd_init()
762 result = _send_cmd(msd->spi_device, READ_OCR, 0x00, 0x00, response_r3, response); in rt_msd_init()
770 if ((response[0] & 0xFE) != 0) in rt_msd_init()
780 OCR = response[1]; in rt_msd_init()
781 OCR = (OCR << 8) + response[2]; in rt_msd_init()
782 OCR = (OCR << 8) + response[3]; in rt_msd_init()
783 OCR = (OCR << 8) + response[4]; in rt_msd_init()
809 result = _send_cmd(msd->spi_device, APP_CMD, 0x00, 0x65, response_r1, response); in rt_msd_init()
817 if ((response[0] & 0xFE) != 0) in rt_msd_init()
826 … result = _send_cmd(msd->spi_device, SD_SEND_OP_COND, 0x40000000, 0x77, response_r1, response); in rt_msd_init()
835 if ((response[0] & 0xFE) != 0) in rt_msd_init()
838 MSD_DEBUG("[info] Not SD card4 , response : 0x%02X\r\n", response[0]); in rt_msd_init()
842 while (response[0] != MSD_RESPONSE_NO_ERROR); in rt_msd_init()
848 result = _send_cmd(msd->spi_device, READ_OCR, 0x00, 0x00, response_r3, response); in rt_msd_init()
856 if ((response[0] & 0xFE) != 0) in rt_msd_init()
865 OCR = response[1]; in rt_msd_init()
866 OCR = (OCR << 8) + response[2]; in rt_msd_init()
867 OCR = (OCR << 8) + response[3]; in rt_msd_init()
868 OCR = (OCR << 8) + response[4]; in rt_msd_init()
913 result = _send_cmd(msd->spi_device, CRC_ON_OFF, 0x01, 0x83, response_r1, response); in rt_msd_init()
915 result = _send_cmd(msd->spi_device, CRC_ON_OFF, 0x00, 0x91, response_r1, response); in rt_msd_init()
918 if ((result != RT_EOK) || (response[0] != MSD_RESPONSE_NO_ERROR)) in rt_msd_init()
920 MSD_DEBUG("[err] CMD59 CRC_ON_OFF fail! response : 0x%02X\r\n", response[0]); in rt_msd_init()
930 result = _send_cmd(msd->spi_device, SET_BLOCKLEN, SECTOR_SIZE, 0x00, response_r1, response); in rt_msd_init()
932 if ((result != RT_EOK) || (response[0] != MSD_RESPONSE_NO_ERROR)) in rt_msd_init()
934 MSD_DEBUG("[err] CMD16 SET_BLOCKLEN fail! response : 0x%02X\r\n", response[0]); in rt_msd_init()
948 result = _send_cmd(msd->spi_device, SEND_CSD, 0x00, 0x00, response_r1, response); in rt_msd_init()
957 if ((result != RT_EOK) || (response[0] != MSD_RESPONSE_NO_ERROR)) in rt_msd_init()
960 MSD_DEBUG("[err] CMD9 SEND_CSD fail! response : 0x%02X\r\n", response[0]); in rt_msd_init()
1215 uint8_t response[MSD_RESPONSE_MAX_LEN]; in rt_msd_read() local
1230 …>spi_device, READ_SINGLE_BLOCK, pos * msd->geometry.bytes_per_sector, 0x00, response_r1, response); in rt_msd_read()
1231 if ((result != RT_EOK) || (response[0] != MSD_RESPONSE_NO_ERROR)) in rt_msd_read()
1251 …pi_device, READ_MULTIPLE_BLOCK, pos * msd->geometry.bytes_per_sector, 0x00, response_r1, response); in rt_msd_read()
1252 if ((result != RT_EOK) || (response[0] != MSD_RESPONSE_NO_ERROR)) in rt_msd_read()
1273 result = _send_cmd(msd->spi_device, STOP_TRANSMISSION, 0x00, 0x00, response_r1b, response); in rt_msd_read()
1291 uint8_t response[MSD_RESPONSE_MAX_LEN]; in rt_msd_sdhc_read() local
1306 result = _send_cmd(msd->spi_device, READ_SINGLE_BLOCK, pos, 0x00, response_r1, response); in rt_msd_sdhc_read()
1307 if ((result != RT_EOK) || (response[0] != MSD_RESPONSE_NO_ERROR)) in rt_msd_sdhc_read()
1327 result = _send_cmd(msd->spi_device, READ_MULTIPLE_BLOCK, pos, 0x00, response_r1, response); in rt_msd_sdhc_read()
1328 if ((result != RT_EOK) || (response[0] != MSD_RESPONSE_NO_ERROR)) in rt_msd_sdhc_read()
1349 result = _send_cmd(msd->spi_device, STOP_TRANSMISSION, 0x00, 0x00, response_r1b, response); in rt_msd_sdhc_read()
1367 uint8_t response[MSD_RESPONSE_MAX_LEN]; in rt_msd_write() local
1383 …d(msd->spi_device, WRITE_BLOCK, pos * msd->geometry.bytes_per_sector, 0x00, response_r1, response); in rt_msd_write()
1384 if ((result != RT_EOK) || (response[0] != MSD_RESPONSE_NO_ERROR)) in rt_msd_write()
1409 result = _send_cmd(msd->spi_device, APP_CMD, 0x00, 0x00, response_r1, response); in rt_msd_write()
1410 if ((result != RT_EOK) || (response[0] != MSD_RESPONSE_NO_ERROR)) in rt_msd_write()
1418 … result = _send_cmd(msd->spi_device, SET_WR_BLK_ERASE_COUNT, size, 0x00, response_r1, response); in rt_msd_write()
1419 if ((result != RT_EOK) || (response[0] != MSD_RESPONSE_NO_ERROR)) in rt_msd_write()
1428 …i_device, WRITE_MULTIPLE_BLOCK, pos * msd->geometry.bytes_per_sector, 0x00, response_r1, response); in rt_msd_write()
1429 if ((result != RT_EOK) || (response[0] != MSD_RESPONSE_NO_ERROR)) in rt_msd_write()
1487 uint8_t response[MSD_RESPONSE_MAX_LEN]; in rt_msd_sdhc_write() local
1501 result = _send_cmd(msd->spi_device, WRITE_BLOCK, pos, 0x00, response_r1, response); in rt_msd_sdhc_write()
1502 if ((result != RT_EOK) || (response[0] != MSD_RESPONSE_NO_ERROR)) in rt_msd_sdhc_write()
1525 result = _send_cmd(msd->spi_device, APP_CMD, 0x00, 0x00, response_r1, response); in rt_msd_sdhc_write()
1526 if ((result != RT_EOK) || (response[0] != MSD_RESPONSE_NO_ERROR)) in rt_msd_sdhc_write()
1534 … result = _send_cmd(msd->spi_device, SET_WR_BLK_ERASE_COUNT, size, 0x00, response_r1, response); in rt_msd_sdhc_write()
1535 if ((result != RT_EOK) || (response[0] != MSD_RESPONSE_NO_ERROR)) in rt_msd_sdhc_write()
1543 result = _send_cmd(msd->spi_device, WRITE_MULTIPLE_BLOCK, pos, 0x00, response_r1, response); in rt_msd_sdhc_write()
1544 if ((result != RT_EOK) || (response[0] != MSD_RESPONSE_NO_ERROR)) in rt_msd_sdhc_write()