Peter Graf wrote:
> 2) Use the QLWA driver of SMSQ/E and change the intitialization / block
> operations for SDHC card. You could look at the QL-SD driver sources or
> at the sources of my Q68 bootloader (written in C) for that purpose.
For a start, SMSQ/E could consider the SDHC card fully initialized,
because the bootloader has already done that job. Then, for example,
reading a 512 bytes sector becomes as simple as this:
unsigned char sdhc_read_sector (unsigned long addr,
unsigned char* buffer)
{
static unsigned short a;
static unsigned char cmd[6];
cmd[0] = 0x51;
cmd[1] = addr >>24;
cmd[2] = addr >>16;
cmd[3] = addr >>8;
cmd[4] = addr;
cmd[5] = 0xFF;
MMC_ENABLE;
if (sdhc_write_command (cmd) != 0)
{
return 0;
}
for (a=0;a<512;a++)
{
*buffer++ = sdhc_read_byte();
}
sdhc_read_byte();
sdhc_read_byte();
MMC_DISABLE;
return 0;
}
_______________________________________________
QL-Users Mailing List