Wr() - Device Driver

static  void  FSDev_####_Wr (FS_DEV      *p_dev,
                             void        *p_src,
                             FS_SEC_NBR   start,
                             FS_SEC_QTY   cnt,
                             FS_ERR      *p_err);

File

Called from

Code enabled by

fs_dev_####.c

FSDev_WrLocked()

N/A

The device driver Wr() function should write to a device the data from a buffer. If an error is returned, the file system suite assumes that no data has been written.

Arguments

p_dev

Pointer to device to write to.

p_src

Pointer to source buffer.

start

Start sector of write.

cnt

Number of sectors to write

p_err

Pointer to variable that will receive the return error code from this function

FS_ERR_NONE

Sector(s) written.

FS_ERR_DEV_INVALID_UNIT_NBR

Device unit number is invalid.

FS_ERR_DEV_IO

Device I/O error.

FS_ERR_DEV_NOT_OPEN

Device is not open.

FS_ERR_DEV_NOT_PRESENT

Device is not present.

FS_ERR_DEV_TIMEOUT

Device timeout.

Returned Value

None.

Notes/Warnings

  1. Tracking whether a device is open is not necessary, because this should only be called when a device is open.
  2. The device driver Wr() function is called while the caller holds the device lock.