res = disk.drv[pdrv]->disk_read(buff, sector, count);
I am not sure what the above statement means.
This is from FATFS open source driver and i am trying to udnerstand how it works. I am using STM32 SPI interface.
Your learning experience might be greater if you ask a question about which specific part of this confuses you... but lets break it down:
disk.drv means "get the member (a pointer that points into an array, in this case) that corresponds to the
drv member of
disk.drv[pdrv] means "get the element of that array indexed by
disk.drv[pdrv]->disk_read means "get the member (a function pointer) that corresponds to the
disk.drv[pdrv]->disk_read(buff, sector, count); means "call that function with
count as arguments".
res = disk.drv[pdrv]->disk_read(buff, sector, count); means "assign the return value of that function call to
It seems as though the aim of the whole statement is to read a chunk of data from a drive.