FatFs Configuration Options

Started by tha, May 12, 2022, 01:39:05 PM

Previous topic - Next topic

tha

Configuration Options

มีตัวเลือกมากมายเพื่อกำหนดค่าคุณลักษณะของ FatFs สำหรับข้อกำหนดต่างๆของแต่ละ project. The configuration options ถูกกำหนดใน ffconf.h.



tha

Function Configurations

FF_FS_READONLY
Read/Write (0) or Read-only (1). Read-only configuration เอาออก writing API functions, f_write, f_sync, f_unlink, f_mkdir, f_chmod, f_rename, f_truncate, f_getfree และ optional writing functions อีกด้วย.

tha

FF_FS_MINIMIZE
ตัวเลือกนี้กำหนดลำดับการลดขนาดให้น้อยลงเพื่อเอาออกบาง basic API functions ดังต่อไปนี้:



tha

FF_USE_FIND
Disable (0) or Enable (1) filtered directory read functions, f_findfirst and f_findnext. นอกจากนี้ FF_FS_MINIMIZE จำเป็นต้องเป็น 0 หรือ 1.

FF_USE_MKFS
Disable (0) or Enable (1) f_mkfs function.

FF_USE_FASTSEEK
Disable (0) or Enable (1) fast seek function เพื่อเปิดการใช้งาน accelerated mode สำหรับ f_lseek, f_read and f_write function. สำหรับข้อมูลเพิ่มเติม, อ่านที่นี่.

FF_USE_EXPAND
Disable (0) or Enable (1) f_expand function.

FF_USE_CHMOD
Disable (0) or Enable (1) metadata control functions, f_chmod and f_utime. นอกจากนี้ FF_FS_READONLY จำเป็นต้องเป็น 0.

FF_USE_LABEL
Disable (0) or Enable (1) API functions for volume label, f_getlabel and f_setlabel.

FF_USE_FORWARD
Disable (0) or Enable (1) f_forward function.

tha

FF_USE_STRFUNC
ตัวเลือกนี้สวิทช์ string functions, f_gets, f_putc, f_puts and f_printf. ฟังก์ชันเหล่านี้เทียบเท่ากับ regular string stream I/O functions ใน POSIX. ถ้า sprintf มีให้ใช้ประโยชน์และ code conversion ไม่ถูกต้องการ, f_write ที่มี sprintf จะมีประสิทธิภาพใน code size และ performance มากกว่า f_printf.

tha

FF_PRINT_LLI
ตัวเลือกนี้สวิทช์การรองรับสำหรับ long long integer argument ใน f_printf.
Disable (0) or Enable (1). C standard จำเป็นต้องเป็น C99 หรือใหม่กว่าเพื่อเปิดใช้งานคุณสมบัตินี้.

FF_PRINT_FLOAT
ตัวเลือกนี้สวิทช์การรองรับสำหรับ floating point argument ใน f_printf. C standard จำเป็นต้องเป็น C99 หรือใหม่กว่าเพื่อเปิดใช้งานคุณสมบัตินี้.

tha

FF_STRF_ENCODE
เมื่อ character encoding บน the API เป็น Unicode (FF_LFN_UNICODE >= 1), string I/O functions ที่เปิดใช้งานโดย FF_USE_STRFUNC จะแปลง the character encoding ในนั้น. ตัวเลือกนี้กำหนดสมมุติฐานของ character encoding บน the file ที่จะถูกอ่าน/เขียนโดยทางฟังชั่นเหล่านั้น. เมื่อ LFN ไม่ถูกเปิดใช้งานหรือ FF_LFN_UNICODE == 0, the string functions จะทำงานโดยไม่มี code conversion ใดๆและตัวเลือกนี้จะไม่มีผล.

tha

Namespace and Locale Configurations

FF_CODE_PAGE
ตัวเลือกนี้ระบุ the OEM code page ที่ใช้บน the target system. การเซ็ตที่ไม่ถูกต้องของ the code page สามารถเป็นเหตุให้ a file open ล้มเหลว. ถ้า any non-ASCII character ไม่ถูกใช้สำหรับ the path name หรือ FF_LFN_UNICODE != 0, ไม่มีความแตกต่างกันระหว่าง any code page settings. เซ็ตมัน 437 อย่างไรก็ตาม.