I am using SDIO to store data on a SD card and I would like to get the SD card size/capacity [in GB] (which corresponds to CMD9 with SD protocol and SPI). In the example ''periph_SDIO'', there is:
SDIO_Read_Direct(LPC_SDMMC, 1, 0x1C, &val) and SDIO_Read_Direct(LPC_SDMMC, 1, 0x1D, &val)
Where do the 0x1C or 0x1D come from ?
I look into the file "simplified_SDIO_card_spec.pdf" but cannot make sense of it to answer the question above. I understand that the information should be in the FBR -> CIS register (right?).
Looking further in the "periph_SDIO" example, there is SDIO_Read_Direct(LPC_SDMMC, 1, 0x04, &val) (clear the interrupt). Again, I am not able to understand or to calculate the 0x04 address.
Could you explain or point to a good document in order to understand these addresses?
Thank you very much.