From 75e1e7a5e26491e942fb2b25f518d8e2e3112721 Mon Sep 17 00:00:00 2001 From: inmarket Date: Fri, 15 Aug 2014 02:22:02 +1000 Subject: Add GFILE support for PetitFS (a very tiny FAT implementation) --- 3rdparty/petitfs-0.03/doc/pf/write.html | 86 +++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 3rdparty/petitfs-0.03/doc/pf/write.html (limited to '3rdparty/petitfs-0.03/doc/pf/write.html') diff --git a/3rdparty/petitfs-0.03/doc/pf/write.html b/3rdparty/petitfs-0.03/doc/pf/write.html new file mode 100644 index 00000000..573a298b --- /dev/null +++ b/3rdparty/petitfs-0.03/doc/pf/write.html @@ -0,0 +1,86 @@ + + + + + + + + +Petit FatFs - pf_write + + + + +
+

pf_write

+

The pf_write function writes data to the file.

+
+FRESULT pf_write (
+  const void* buff, /* [IN]  Pointer to the data to be written */
+  UINT btw,         /* [IN]  Number of bytes to write */
+  UINT* bw          /* [OUT] Pointer to the variable to return number of bytes written */
+);
+
+
+ +
+

Parameters

+
+
buff
+
Pointer to the data to be wtitten. A NULL specifies to finalize the current write operation.
+
btw
+
Number of bytes to write.
+
bw
+
Pointer to the variable to return number of bytes read.
+
+
+ + +
+

Return Values

+
+
FR_OK (0)
+
The function succeeded.
+
FR_DISK_ERR
+
The function failed due to a hard error in the disk function, write protected, a wrong FAT structure or an internal error.
+
FR_NOT_OPENED
+
The file has not been opened.
+
FR_NOT_ENABLED
+
The volume has not been mounted.
+
+
+ + +
+

Description

+

The write function has some restrictions listed below:

+ +

File write operation must be done in following sequence.

+
    +
  1. pf_lseek(ofs); read/write pointer must be moved to sector bundary prior to initiate write operation or it will be rounded-down to the sector boundary.
  2. +
  3. pf_write(buff, btw, &bw); Initiate write operation. Write first data to the file.
  4. +
  5. pf_write(buff, btw, &bw); Write next data. Any other file function cannot be used while a write operation is in progress.
  6. +
  7. pf_write(0, 0, &bw); Finalize the write operation. If read/write pointer is not on the sector boundary, left bytes in the sector will be filled with zero.
  8. +
+

The read/write pointer in the file system object advances in number of bytes written. After the function succeeded, *bw should be checked to detect end of file. In case of *bw < btw, it means the read/write pointer reached end of file during the write operation. Once a write operation is initiated, it must be finalized or the written data can be lost.

+
+ +
+

QuickInfo

+

Available when _USE_WRITE == 1.

+
+ +
+

References

+

pf_open, FATFS

+
+ +

Return

+ + -- cgit v1.2.3