FatFs

Started by tha, May 05, 2022, 10:00:40 AM

Previous topic - Next topic

tha

http://elm-chan.org/fsw/ff/doc/gets.html



Parameters
   buff
       ตัวชี้ไปยัง read buffer เพื่อเก็บ the read string.
   len
       ขนาดของ the read buffer ในหน่วยของรายการ.
   fp
       ตัวชี้ไปยัง the open file object structure.

Return Values
เมื่อ the function สำเร็จ, buff จะถูกส่งคืนกลับ.

Description
The read operation จะดำเนินต่อไปจนกว่า a '\n' ถูกเก็บ, ถึง end of the file หรือ the buffer ถูกเติมด้วย len - 1 characters. The read string ถูกสิ้นสุดด้วย a '\0'. เมื่อไม่มี character ที่จะอ่านหรือ error ใดๆเกิดขึ้นในระหว่าง read operation, มันจะส่งคืนกลับ a null pointer. The status of EOF and error สามารถถูกตรวจสอบด้วย f_eof and f_error function.
เมื่อ FatFs ถูกกำหนดค่าเป็น Unicode API (FF_LFN_UNICODE >= 1), data types บน the string fuctions, f_putc, f_puts, f_printf and f_gets, ถูกสลับเป็น Unicode ด้วย. The character encoding บน the file ที่จะถูกอ่านโดยทางฟังชั่นนี้จะถูกถือว่าตาม FF_STRF_ENCODE. ถ้า the character encoding บน the file แตกต่างจากตัวนั้นบน the API, มันจะถูกแปลงในฟังชั่นนี้. ในกรณีนี้, input characters ที่มี wrong encoding จะสูญหาย.

QuickInfo
นี้เป็น a wrapper function ของ f_read function. มีให้ใช้งานเมื่อ FF_USE_STRFUNC >= 1. เมื่อมันถูกเซ็ตเป็น 2, '\r's ที่บรรจุใน the file จะถูกแยกออก.

See Also
f_open, f_read, f_putc, f_puts, f_printf, f_close, FIL

tha

http://elm-chan.org/fsw/ff/doc/putc.html



Parameters
   chr
       A character ที่จะเขียน.
   fp
       ตัวชี้ไปยัง the open file object structuer.

Return Values
เมื่อ the character ถูกเขียนสำเร็จแล้ว, มันส่งคืนกลับ number of character encoding units ที่เขียนไปยัง the file. เมื่อ the function ล้มเหลวเนื่องจาก disk full หรือ any error, ค่าลบจะถูกส่งคืนกลับ.

Description
เมื่อ FatFs ถูกกำหนดค่าสำหรับ Unicode API (FF_LFN_UNICODE >= 1), character encoding บน the string fuctions, f_putc, f_puts, f_printf and f_gets function, จะถูกสลับเป็น Unicode ด้วย. The character encoding บน the file  ที่จะถูกอ่าน/ถูกเขียนโดยทางฟังชั่นเหล่านี้จะถูกเลือกโดย FF_STRF_ENCODE. The Unicode characters ใน multiple encoding unit, อย่างเช่น surrogate pair and multi-byte sequence, ไม่สามารถถูกเขียนด้วยฟังก์ชันนี้.

QuickInfo
นี้เป็น a wrapper function ของ f_write function. มีให้ใช้งานเมื่อ FF_FS_READONLY == 0 and FF_USE_STRFUNC >= 1. เมื่อ FF_USE_STRFUNC == 2, a '\n' จะถูกเอ๊าท์พุทเป็น '\r'+'\n'.

See Also
f_open, f_puts, f_printf, f_gets, f_close, FIL

tha

http://elm-chan.org/fsw/ff/doc/puts.html



Parameters
   str
       ตัวชี้ไปยัง the null terminated string ที่จะถูกเขียน. The terminator character จะไม่ถูกเขียน.
   fp
       ตัวชี้ไปยัง the open file object structure.

Return Values
เมื่อ the character ถูกเขียนสำเร็จแล้ว, มันส่งคืนกลับ number of character encoding units ที่เขียนไปยัง the file. เมื่อ the function ล้มเหลวเนื่องจาก disk full หรือ any error, ค่าลบจะถูกส่งคืนกลับ.

Description
เมื่อ FatFs ถูกกำหนดค่าสำหรับ Unicode API (FF_LFN_UNICODE >= 1), character encoding บน the string fuctions, f_putc, f_puts, f_printf and f_gets function, จะถูกสลับเป็น Unicode ด้วย.  The input Unicode characters ใน multiple encoding unit, อย่างเช่น surrogate pair and multi-byte sequence, ไม่ควรถูกแบ่งลงใน two function calls, หรือ the character จะสูญหาย. The character encoding บน the file  ที่จะถูกเขียนโดยทางฟังชั่นนี้จะถูกเลือกโดย FF_STRF_ENCODE. The characters ที่มี wrong encoding หรือใช้ไม่ได้สำหรับ the output encoding จะสูญหาย.

QuickInfo
นี้เป็น a wrapper function ของ f_write function. มีให้ใช้งานเมื่อ FF_FS_READONLY == 0 and FF_USE_STRFUNC >= 1. เมื่อ FF_USE_STRFUNC == 2,  '\n's ที่บรรจุใน the input string จะถูกเอ๊าท์พุทเป็นแต่ละ '\r'+'\n'.

See Also
f_open, f_putc, f_printf, f_gets, f_close, FIL


tha

http://elm-chan.org/fsw/ff/doc/printf.html



Parameters
   fp
       ตัวชี้ไปยัง the open file object structure.
   fmt
       ตัวชี้ไปยัง the null '\0' terminated format string. The terminator character จะไม่ถูกส่งออก.
   ...
       Optional arguments...

Return Values
เมื่อ the string ถูกเขียนสำเร็จแล้ว, มันส่งคืนกลับ number of character encoding units ที่เขียนไปยัง the file. เมื่อ the function ล้มเหลวเนื่องจาก disk full หรือ any error, ค่าลบจะถูกส่งคืนกลับ.

tha

Description
The format control directive เป็น a sub-set of standard library ที่แสดงดังต่อไปนี้:

   flag
       ทางเลือกการรอง. A - ระบุชิดซ้าย. A 0 ระบุศูนย์ถูกรอง. The default setting อยู่ในชิดขวาและเว้นวรรค(ช่องว่าง)ถูกรอง.
   width
       ความกว้างต่ำสุดของฟิลด์, 1-99 หรือ *. ถ้าความกว้างของ generated string น้อยกว่าค่าที่ระบุ, ฟิลด์ที่เหลือจะถูกรองด้วย spaces
       หรือ zeros. An * ระบุค่าที่มาจาก an argument ใน int type
   precision
       ระบุจำนวนของเศษส่วนหรือความกว้างสูงสุดของ string, .0-.99 or .*. ถ้า number ถูกละเว้น, มันจะเป็นเช่นเดียวกันกับ .0.
       Default setting คือ 6 สำหรับ number และไม่จำกัดสำหรับ string.
   size
       ระบุขนาดของ integer argument, l(long) and ll(long long). ถ้า sizeof (long) == sizeof (int) เป็นจริง (นี่เป็นเรื่องปกติ
       ของ 32-bit systems), คำนำหน้า l สามารถถูกละเว้นได้สำหรับ long integer argument. The default size เป็น int สำหรับ
       integer arrument และ floating point argument จะถูกถือว่าเป็น double เสมอ.
   type
       ระบุประเภทของ the output format และ the argument ดังแสดงข้างล่าง. ความยาวของ generated string อยู่ในการสันนิษฐาน
       ว่าเป็น int คือ 32-bit.

เมื่อ FatFs ถูกกำหนดค่าสำหรับ Unicode API (FF_LFN_UNICODE >= 1), character encoding บน the string fuctions, f_putc, f_puts, f_printf and f_gets function, จะถูกสลับเป็น Unicode ด้วย.  The input Unicode characters ใน multiple encoding unit, อย่างเช่น surrogate pair and multi-byte sequence, ไม่ควรถูกแบ่งลงใน two function calls, หรือ the character จะสูญหาย. The character encoding บน the file  ที่จะถูกเขียนโดยทางฟังชั่นนี้จะถูกเลือกโดย FF_STRF_ENCODE. The characters ที่มี wrong encoding หรือใช้ไม่ได้สำหรับ the output encoding จะสูญหาย.

QuickInfo
นี้เป็น a wrapper function ของ f_write function. มีให้ใช้งานเมื่อ FF_FS_READONLY == 0 and FF_USE_STRFUNC >= 1. เมื่อ FF_USE_STRFUNC == 2,  '\n's ใน the generated string จะถูกเขียนเป็นแต่ละ '\r'+'\n'.

Example


See Also
f_open, f_putc, f_puts, f_gets, f_close, FIL

tha

http://elm-chan.org/fsw/ff/doc/tell.html



Parameters
   fp
       ตัวชี้ไปยัง the open file object structure.

Return Values
ส่งคืนกลับ current read/write pointer of the file.

Description
ในขบวนการปรับปรุงนี้, the f_tell function ถูกนำไปใช้เป็น a macro. มันไม่มีการตรวจสอบความถูกต้องใดๆและ mutual exclusion.


QuickInfo
มีให้ใช้งานเสมอ.

See Also
f_open, f_lseek, FIL

tha

http://elm-chan.org/fsw/ff/doc/eof.html



Parameters
   fp
       ตัวชี้ไปยัง the open file object structure.

Return Values
The f_eof function ส่งคืนกลับ a non-zero value ถ้า the read/write pointer ถึง end of the file แล้ว; ถ้าเป็นอย่างอื่นมันจะส่งคืนกลับ a zero.

Description
ในขบวนการปรับปรุงนี้, function นี้ถูกนำไปใช้เป็น a macro. มันไม่มีการตรวจสอบความถูกต้องใดๆและ mutual exclusion.


QuickInfo
มีให้ใช้งานเสมอ.

See Also
f_open, f_lseek, FIL

tha

http://elm-chan.org/fsw/ff/doc/size.html



Parameters
   fp
       ตัวชี้ไปยัง the open file object structure.

Return Values
ส่งคืนกลับขนาดของ the file ในหน่วยของ byte.

Description
ในขบวนการปรับปรุงนี้, the f_size function ถูกนำไปใช้เป็น a macro. มันไม่มีการตรวจสอบความถูกต้องใดๆและ mutual exclusion.


QuickInfo
มีให้ใช้งานเสมอ.

See Also
f_open, f_lseek, FIL