Renesas USB Device
USB Host Mass Storage Class Driver(HMSC)
R01AN0513EJ0110 Rev.1.10
Page 32 of 55
Aug 10, 2011
Table 6.4
read_sector() / R_tfat_disk_read()
Name Read
Sector
Call format
int read_sector(int side, unsigned char *buff, unsigned long secno, long seccnt)
int side
Drive
number
unsigned char
*buff
Read data area
unsigned long
secno
Sector number
Arguments
long seccnt
Sector
count
Return values
int
Success 0
Failure
-1
Call format
DRESULT R_tfat_disk_read(uint8_t drive, uint8_t* buffer, uint32_t sector_number, uint8_t
sector_count)
uint8_t drive
Drive
number
uint8_t
*buffer
Read data area
uint32_t
sector_num
ber
Sector number
Arguments
uint8_t sector_count
Sector
count
Return values
DRESULT
Success TFAT_RES_OK
Failure
TFAT_RES_ERROR
Description Reads
the
specified sectors.
Notes
The function calculates the logical block address from the sector number.
It calculates the read data count from the sector count and sector size (global variables).
Table 6.5
write_sector() / R_tfat_disk_write()
Name Write
Sector
Call format
int write_sector(int side, unsigned char *buff, unsigned long secno, long seccnt)
int side
Drive
number
unsigned char
*buff
Write data area
unsigned long
secno
Sector number
Arguments
long seccnt
Sector
count
Return values
int
Success 0
Failure
-1
Call format
DRESULT R_tfat_disk_write(uint8_t drive, const uint8_t* buffer, uint32_t sector_number,
uint8_t sector_count)
uint8_t drive
Drive
number
const uint8_t
*buffer
Write data area
uint32_t
sector_num
ber
Sector number
Arguments
uint8_t sector_count
Sector
count
Return values
DRESULT
Success TFAT_RES_OK
Failure
TFAT_RES_ERROR
Description Reads
the
specified sectors.
Notes
The function calculates the logical block address from the sector number.
It calculates the write data count from the sector count and sector size (global variables).
Содержание R8A66597
Страница 56: ......