Commands And Responses - Motorola DragonBall MC9328MX1 Reference Manual

Integrated portable system processor
Table of Contents

Advertisement

Multimedia Card/Secure Digital Host Controller Module (MMC/SD)
block_read_with_read_wait_without_DMA(rca, nob, addr_h, addr_l, buswidth)
{
send_cmd_wait_resp(SEND_STATUS, rca, 0x00, 0x01, 0x40);
while(!Ready for data in card status is true)
{
send_cmd_wait_resp(SEND_STATUS, rca, 0x00, 0x01, 0x40);
}
write_reg(NOB, <nob>);
send_cmd_wait_resp(SET_BLOCKLEN, 0x00, 0x0200, 0x01, 0x40);
if(buswidth==4-bit mode)
{
send_cmd_wait_resp(APP_CMD, rca, 0x0, 0x01, 0x40);
send_cmd_wait_resp(SET_BUS_WIDTH, 0x00, 0x02, 0x01, 0x40);
}
write_reg(CMD_DAT_CONT, set bit 10); // Enable Read Wait at the
// following block boundary
if(nob==1)
send_cmd_wait_resp(READ_SINGLE_BLOCK, addr_h, addr_l, 0x09, 0x40);
else
send_cmd_wait_resp(READ_MULTIPLE_BLOCK, addr_h, addr_l, 0x09, 0x40);
if(buswidth==4-bit mode)
{
for(i=0;i<(nob*8);i++)
{
while(!FIFO full in STATUS);// polling instead of irq or dma req
for(j=0;j<32;j++)
{
SDRAM_ADDR[i*32+j] = BUFFER_ACCESS;
}
send_cmd_wait_resp(IO_RW_DIRECT, arg_h, arg_l, 0x5, 0x40);
write_reg(CMD_DAT_CONT, set bit 11 to stop Read Wait);
}
}
else// 1-bit mode
{
for(i=0;i<(nob*32);i++)
{
while(!FIFO full in STATUS);// polling instead of irq or dma req
for(j=0;j<8;j++)
{
SDRAM_ADDR[i*8+j] = BUFFER_ACCESS;
}
send_cmd_wait_resp(IO_RW_DIRECT, arg_h, arg_l, 0x5, 0x40);
write_reg(CMD_DAT_CONT, set bit 11 to stop Read Wait);
}
}
while(!Data Transfer Done in STATUS true);
while(!card bus is stop);
if(nob > 1)
{
send_cmd_wait_resp(STOP_TRANS, 0x00, 0x00, 0x41, 0x40);
}
}

20.7.8 Commands and Responses

This section describes application-specific and general commands in addition to the command types and
formats. Table 20-25 on page 20-56 is a list of all the MMC/SD module commands. Section 20.7.8.5,
"Response Formats," identifies and describes all command response formats.
20-54
Code Example 20-13. Read_Wait
MC9328MX1 Reference Manual
MOTOROLA

Advertisement

Table of Contents
loading

Table of Contents