1 /*---------------------------------------------------------------------------*
2   Project:  TwlSDK - FATFS - include
3   File:     api.h
4 
5   Copyright 2007-2009 Nintendo. All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law. They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Date:: 2009-06-04#$
14   $Rev: 10698 $
15   $Author: okubata_ryoma $
16  *---------------------------------------------------------------------------*/
17 
18 #ifndef NITRO_FATFS_API_H_
19 #define NITRO_FATFS_API_H_
20 
21 
22 #include <twl/fatfs/common/types.h>
23 
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 
30 /*---------------------------------------------------------------------------*/
31 /* Functions */
32 
33 /*---------------------------------------------------------------------------*
34   Name:         FATFS_Init
35 
36   Description:  Initializes the FATFS library.
37 
38   Arguments:    None.
39 
40   Returns:      None.
41  *---------------------------------------------------------------------------*/
42 #ifdef  SDK_ARM9
43 void FATFS_Init(void);
44 #else
45 BOOL FATFS_Init(u32 dma1, u32 dma2, u32 priority);
46 #endif
47 
48 /*---------------------------------------------------------------------------*
49   Name:         FATFSi_IsInitialized
50 
51   Description:  Returns a value indicating whether the FATFS library has been initialized.
52 
53   Arguments:    None.
54 
55   Returns:      TRUE if it has been initialized.
56  *---------------------------------------------------------------------------*/
57 BOOL FATFSi_IsInitialized(void);
58 
59 /*---------------------------------------------------------------------------*
60   Name:         FATFSi_GetArcnameList
61 
62   Description:  Gets a list of accessible archive names.
63 
64   Arguments:    None.
65 
66   Returns:      A list of archive names delimited by the null character ('\0'), with two null characters ("\0\0") at the end.
67  *---------------------------------------------------------------------------*/
68 const char* FATFSi_GetArcnameList(void);
69 
70 /*---------------------------------------------------------------------------*
71   Name:         FATFS_GetLastError
72 
73   Description:  Gets the result of the last issued request.
74 
75   Arguments:    None.
76 
77   Returns:      None.
78  *---------------------------------------------------------------------------*/
79 u32 FATFS_GetLastError(void);
80 
81 /*---------------------------------------------------------------------------*
82   Name:         FATFS_RegisterResultBuffer
83 
84   Description:  Registers a command result buffer to associate with the calling thread.
85 
86   Arguments:    buffer: FATFSResultBuffer structure
87                 enable: TRUE to register and FALSE to unregister it
88 
89   Returns:      None.
90  *---------------------------------------------------------------------------*/
91 void FATFS_RegisterResultBuffer(FATFSResultBuffer *buffer, BOOL enable);
92 
93 /*---------------------------------------------------------------------------*
94   Name:         FATFS_MountDrive
95 
96   Description:  Mounts the specified NAND partition on a drive.
97 
98   Arguments:    name: Drive name (characters from 'A' to 'Z')
99                 partition: NAND partition number
100 
101   Returns:      TRUE if the process is successful.
102  *---------------------------------------------------------------------------*/
103 BOOL FATFS_MountDrive(const char *name, FATFSMediaType media, u32 partition);
104 
105 /*---------------------------------------------------------------------------*
106   Name:         FATFS_MountNAND
107 
108   Description:  Mounts the specified NAND partition on a drive.
109 
110   Arguments:    name: Drive name (characters from 'A' to 'Z')
111                 partition: NAND partition number
112 
113   Returns:      TRUE if the process is successful.
114  *---------------------------------------------------------------------------*/
FATFS_MountNAND(const char * name,u32 partition)115 SDK_INLINE BOOL FATFS_MountNAND(const char *name, u32 partition)
116 {
117     return FATFS_MountDrive(name, FATFS_MEDIA_TYPE_NAND, partition);
118 }
119 
120 /*---------------------------------------------------------------------------*
121   Name:         FATFS_UnmountDrive
122 
123   Description:  Unmounts the specified drive.
124 
125   Arguments:    name: Drive name (characters from 'A' to 'Z')
126 
127   Returns:      TRUE if the process is successful.
128  *---------------------------------------------------------------------------*/
129 BOOL FATFS_UnmountDrive(const char *name);
130 
131 /*---------------------------------------------------------------------------*
132   Name:         FATFS_SetDefaultDrive
133 
134   Description:  Selects the default drive.
135 
136   Arguments:    path: Path, including the drive name
137 
138   Returns:      TRUE if the process is successful.
139  *---------------------------------------------------------------------------*/
140 BOOL FATFS_SetDefaultDrive(const char *path);
141 
142 /*---------------------------------------------------------------------------*
143   Name:         FATFS_FormatDrive
144 
145   Description:  Initializes the drive indicated by the specified path.
146 
147   Arguments:    path: Path, including the drive name
148 
149   Returns:      TRUE if the process is successful.
150  *---------------------------------------------------------------------------*/
151 BOOL FATFS_FormatDrive(const char *path);
152 
153 /*---------------------------------------------------------------------------*
154   Name:         FATFSi_FormatDriveEx
155 
156   Description:  Initializes the entire media or the entire drive indicated by the specified path.
157 
158   Arguments:    path: Path, including the drive name
159                 formatMedia: TRUE to erase the entire media
160 
161   Returns:      TRUE if the process is successful.
162  *---------------------------------------------------------------------------*/
163 BOOL FATFSi_FormatDriveEx(const char *path, BOOL formatMedia);
164 
165 /*---------------------------------------------------------------------------*
166   Name:         FATFSi_FormatMedia
167 
168   Description:  Initializes the entire media indicated by the specified path.
169 
170   Arguments:    path: Path, including the drive name
171 
172   Returns:      TRUE if the process is successful.
173  *---------------------------------------------------------------------------*/
FATFSi_FormatMedia(const char * path)174 SDK_INLINE BOOL FATFSi_FormatMedia(const char *path)
175 {
176     return FATFSi_FormatDriveEx(path, TRUE);
177 }
178 
179 /*---------------------------------------------------------------------------*
180   Name:         FATFS_CheckDisk
181 
182   Description:  Checks disk content and fixes it if necessary.
183 
184   Arguments:    name: Drive name (characters from 'A' to 'Z')
185                 info: FATFSDiskInfo structure to store the result
186                 verbose: TRUE to send checked content to debug output
187                 fixProblems: TRUE to fix FAT errors once they are detected
188                 writeChains: TRUE to recover files from isolated chains
189                               (valid only when fixProblems is enabled)
190 
191   Returns:      TRUE if the process is successful.
192  *---------------------------------------------------------------------------*/
193 BOOL FATFS_CheckDisk(const char *name, FATFSDiskInfo *info, BOOL verbose, BOOL fixProblems, BOOL writeChains);
194 
195 /*---------------------------------------------------------------------------*
196   Name:         FATFS_GetDriveResource
197 
198   Description:  Gets the amount of free disk space.
199 
200   Arguments:    path: Path, including the drive name
201                 resource: The FATFSDriveResource structure to store the result
202 
203   Returns:      TRUE if the process is successful.
204  *---------------------------------------------------------------------------*/
205 BOOL FATFS_GetDriveResource(const char *path, FATFSDriveResource *resource);
206 
207 /*---------------------------------------------------------------------------*
208   Name:         FATFS_GetDiskSpace
209 
210   Description:  Gets the amount of free disk space.
211 
212   Arguments:    name: Drive name (characters from 'A' to 'Z')
213                 totalBlocks: Pointer to get the total block count, or NULL
214                 freeBlocks: Pointer to get the free block count, or NULL
215 
216   Returns:      The number of bytes of free space on success and -1 on failure.
217  *---------------------------------------------------------------------------*/
218 int FATFS_GetDiskSpace(const char *name, u32 *totalBlocks, u32 *freeBlocks);
219 
220 /*---------------------------------------------------------------------------*
221   Name:         FATFS_GetFileInfo
222 
223   Description:  Gets information for a file or directory.
224 
225   Arguments:    path: Path name
226                 info: FATFSFileInfo structure to store the result
227 
228   Returns:      Gets information and returns TRUE if the specified path exists; otherwise, returns FALSE.
229  *---------------------------------------------------------------------------*/
230 BOOL FATFS_GetFileInfo(const char *path, FATFSFileInfo *info);
231 
232 /*---------------------------------------------------------------------------*
233   Name:         FATFS_SetFileInfo
234 
235   Description:  Changes file or directory information.
236 
237   Arguments:    path: Path name
238                 info: FATFSFileInfo structure storing the information that should be changed
239 
240   Returns:      Changes information and returns TRUE if the specified path exists; otherwise, returns FALSE.
241  *---------------------------------------------------------------------------*/
242 BOOL FATFS_SetFileInfo(const char *path, const FATFSFileInfo *info);
243 
244 /*---------------------------------------------------------------------------*
245   Name:         FATFS_CreateFile
246 
247   Description:  Creates a file at the specified path.
248 
249   Arguments:    path: Path name
250                 trunc: TRUE to delete the file if it already exists
251                 permit: File access permissions (rwx){1,3}
252 
253   Returns:      TRUE if the process is successful.
254  *---------------------------------------------------------------------------*/
255 BOOL FATFS_CreateFile(const char *path, BOOL trunc, const char *permit);
256 
257 /*---------------------------------------------------------------------------*
258   Name:         FATFS_DeleteFile
259 
260   Description:  Deletes the specified file.
261 
262   Arguments:    path: Path name
263 
264   Returns:      TRUE if it was deleted successfully.
265  *---------------------------------------------------------------------------*/
266 BOOL FATFS_DeleteFile(const char *path);
267 
268 /*---------------------------------------------------------------------------*
269   Name:         FATFS_RenameFile
270 
271   Description:  Renames the specified file.
272 
273   Arguments:    path: Path name
274                 newpath: New path name
275 
276   Returns:      TRUE if it was renamed successfully.
277  *---------------------------------------------------------------------------*/
278 BOOL FATFS_RenameFile(const char *path, const char *newpath);
279 
280 /*---------------------------------------------------------------------------*
281   Name:         FATFS_CreateDirectory
282 
283   Description:  Creates a directory at the specified path.
284 
285   Arguments:    path: Path name
286                 permit: Directory access permissions (rwx){1,3}
287 
288   Returns:      TRUE if the process is successful.
289  *---------------------------------------------------------------------------*/
290 BOOL FATFS_CreateDirectory(const char *path, const char *permit);
291 
292 /*---------------------------------------------------------------------------*
293   Name:         FATFS_DeleteDirectory
294 
295   Description:  Deletes the specified directory.
296 
297   Arguments:    path: Path name
298 
299   Returns:      TRUE if it was deleted successfully.
300  *---------------------------------------------------------------------------*/
301 BOOL FATFS_DeleteDirectory(const char *path);
302 
303 /*---------------------------------------------------------------------------*
304   Name:         FATFS_RenameDirectory
305 
306   Description:  Renames the specified directory.
307 
308   Arguments:    path: Path name
309                 newpath: New path name
310 
311   Returns:      TRUE if it was renamed successfully.
312  *---------------------------------------------------------------------------*/
313 BOOL FATFS_RenameDirectory(const char *path, const char *newpath);
314 
315 /*---------------------------------------------------------------------------*
316   Name:         FATFS_OpenFile
317 
318   Description:  Opens the file at the specified path.
319 
320   Arguments:    path: Path name
321                 mode: File access mode ("r/w/r+/w+" and "b/t")
322 
323   Returns:      The opened file handle or NULL.
324  *---------------------------------------------------------------------------*/
325 FATFSFileHandle FATFS_OpenFile(const char *path, const char *mode);
326 
327 /*---------------------------------------------------------------------------*
328   Name:         FATFS_CloseFile
329 
330   Description:  Closes the file.
331 
332   Arguments:    file: File handle
333 
334   Returns:      TRUE if successful.
335  *---------------------------------------------------------------------------*/
336 BOOL FATFS_CloseFile(FATFSFileHandle file);
337 
338 /*---------------------------------------------------------------------------*
339   Name:         FATFS_ReadFile
340 
341   Description:  Reads data from the file.
342 
343   Arguments:    file: File handle
344                 buffer: Location to store the data that is read
345                 length: Data size to read
346 
347   Returns:      The data size that was actually read or -1.
348  *---------------------------------------------------------------------------*/
349 int FATFS_ReadFile(FATFSFileHandle file, void *buffer, int length);
350 
351 /*---------------------------------------------------------------------------*
352   Name:         FATFS_WriteFile
353 
354   Description:  Writes data to the file.
355 
356   Arguments:    file: File handle
357                 buffer: Location storing the data to write
358                 length: Data size to write
359 
360   Returns:      The data size that was actually written or -1.
361  *---------------------------------------------------------------------------*/
362 int FATFS_WriteFile(FATFSFileHandle file, const void *buffer, int length);
363 
364 /*---------------------------------------------------------------------------*
365   Name:         FATFS_SetSeekCache
366 
367   Description:  Assigns the cache buffer for a fast reverse seek.
368 
369   Arguments:    file: File handle
370                 buf: Cache buffer
371                 buf_size: Cache buffer size
372 
373   Returns:      TRUE if successful.
374  *---------------------------------------------------------------------------*/
375 BOOL FATFS_SetSeekCache(FATFSFileHandle file, void* buf, u32 buf_size);
376 
377 /*---------------------------------------------------------------------------*
378   Name:         FATFS_SeekFile
379 
380   Description:  Moves the file pointer.
381 
382   Arguments:    file: File handle
383                 offset: Distance to move
384                 origin: Starting point to move from
385 
386   Returns:      The shifted offset or -1.
387  *---------------------------------------------------------------------------*/
388 int FATFS_SeekFile(FATFSFileHandle file, int offset, FATFSSeekMode origin);
389 
390 /*---------------------------------------------------------------------------*
391   Name:         FATFS_FlushFile
392 
393   Description:  Flushes file content to the drive.
394 
395   Arguments:    file: File handle
396 
397   Returns:      TRUE if it was flushed normally.
398  *---------------------------------------------------------------------------*/
399 BOOL FATFS_FlushFile(FATFSFileHandle file);
400 
401 /*---------------------------------------------------------------------------*
402   Name:         FATFS_GetFileLength
403 
404   Description:  Gets file size.
405 
406   Arguments:    file: File handle
407 
408   Returns:      The file size or -1.
409  *---------------------------------------------------------------------------*/
410 int FATFS_GetFileLength(FATFSFileHandle file);
411 
412 /*---------------------------------------------------------------------------*
413   Name:         FATFS_SetFileLength
414 
415   Description:  Sets the file size.
416 
417   Arguments:    file: File handle
418 
419   Returns:      TRUE if it was set successfully.
420  *---------------------------------------------------------------------------*/
421 BOOL FATFS_SetFileLength(FATFSFileHandle file, int length);
422 
423 /*---------------------------------------------------------------------------*
424   Name:         FATFS_OpenDirectory
425 
426   Description:  Opens the directory at the specified path.
427 
428   Arguments:    path: Path name
429                 mode: Directory access mode (this is currently ignored)
430 
431   Returns:      The opened directory handle or NULL.
432  *---------------------------------------------------------------------------*/
433 FATFSDirectoryHandle FATFS_OpenDirectory(const char *path, const char *mode);
434 
435 /*---------------------------------------------------------------------------*
436   Name:         FATFS_CloseDirectory
437 
438   Description:  Closes a directory.
439 
440   Arguments:    dir: Directory handle
441 
442   Returns:      TRUE if successful.
443  *---------------------------------------------------------------------------*/
444 BOOL FATFS_CloseDirectory(FATFSDirectoryHandle dir);
445 
446 /*---------------------------------------------------------------------------*
447   Name:         FATFS_ReadDirectory
448 
449   Description:  Reads the next entry information from a directory.
450 
451   Arguments:    dir: Directory handle
452                 info: Location to store the entry information
453 
454   Returns:      TRUE if the entry information was read normally.
455  *---------------------------------------------------------------------------*/
456 BOOL FATFS_ReadDirectory(FATFSDirectoryHandle dir, FATFSFileInfo *info);
457 
458 /*---------------------------------------------------------------------------*
459   Name:         FATFS_FlushAll
460 
461   Description:  Flushes all drive content to the device.
462 
463   Arguments:    None.
464 
465   Returns:      TRUE if the process is successful.
466  *---------------------------------------------------------------------------*/
467 BOOL FATFS_FlushAll(void);
468 
469 /*---------------------------------------------------------------------------*
470   Name:         FATFS_UnmountAll
471 
472   Description:  Unmounts all drives.
473 
474   Arguments:    None.
475 
476   Returns:      TRUE if the process is successful.
477  *---------------------------------------------------------------------------*/
478 BOOL FATFS_UnmountAll(void);
479 
480 /*---------------------------------------------------------------------------*
481   Name:         FATFS_MountSpecial
482 
483   Description:  Mounts a special drive.
484 
485   Arguments:    param: Parameter that specifies the mounting target
486                 arcname: Archive name to mount
487                           You can specify "otherPub", "otherPrv", and "share".
488                           If NULL is specified, previously mounted drives will be unmounted
489                 slot: Buffer to store the assigned index.
490                           This will be set when mounting and accessed when unmounting.
491 
492   Returns:      TRUE if the process is successful.
493  *---------------------------------------------------------------------------*/
494 BOOL FATFS_MountSpecial(u64 param, const char *arcname, int *slot);
495 
496 /*---------------------------------------------------------------------------*
497   Name:         FATFS_FormatSpecial
498 
499   Description:  Re-initializes a special drive owned by the caller of this function.
500 
501   Arguments:    path: Path including the drive name
502 
503   Returns:      TRUE if the process is successful.
504  *---------------------------------------------------------------------------*/
505 BOOL FATFS_FormatSpecial(const char *path);
506 
507 /*---------------------------------------------------------------------------*
508   Name:         FATFS_SetLatencyEmulation
509 
510   Description:  Indicates that the drive layer should emulate the wait times that occur when accessing a deteriorated device.
511 
512 
513   Arguments:    enable: TRUE to enable this.
514 
515   Returns:      TRUE if the process is successful.
516  *---------------------------------------------------------------------------*/
517 BOOL FATFS_SetLatencyEmulation(BOOL enable);
518 
519 /*---------------------------------------------------------------------------*
520   Name:         FATFS_SearchWildcard
521 
522   Description:  Runs a wildcard search within a specified SD Card directory.
523 
524   Arguments:    directory: Arbitrary directory name of no more than 8 characters.
525                            NULL to write files directly under the application's root directory.
526 
527                 prefix: Filename prefix (1-5 characters)
528                 suffix: Name of the file extension (1-3 characters)
529                 buffer: Buffer in which to record existing files that match the conditions.
530                         If (buffer[i / 8] & (1 << (i % 8))) is TRUE, it indicates that "prefix{i}.suffix" exists.
531 
532                 length: Length of the buffer
533 
534   Returns:      TRUE if the process is successful.
535  *---------------------------------------------------------------------------*/
536 BOOL FATFS_SearchWildcard(const char* directory, const char *prefix, const char *suffix,
537                           void *buffer, u32 length);
538 
539 /*---------------------------------------------------------------------------*
540  * Versions with Unicode support
541  *---------------------------------------------------------------------------*/
542 
543 /*---------------------------------------------------------------------------*
544   Name:         FATFS_GetDriveResourceW
545 
546   Description:  Gets the amount of free disk space.
547 
548   Arguments:    path: Path, including the drive name
549                 resource: FATFSDriveResource structure to store the result
550 
551   Returns:      TRUE if the process is successful.
552  *---------------------------------------------------------------------------*/
553 BOOL FATFS_GetDriveResourceW(const u16 *path, FATFSDriveResource *resource);
554 
555 /*---------------------------------------------------------------------------*
556   Name:         FATFS_GetFileInfoW
557 
558   Description:  Gets information for a file or directory.
559 
560   Arguments:    path: Path name
561                 info: FATFSFileInfoW structure to store the result
562 
563   Returns:      Gets information and returns TRUE if the specified path exists; otherwise, returns FALSE.
564  *---------------------------------------------------------------------------*/
565 BOOL FATFS_GetFileInfoW(const u16 *path, FATFSFileInfoW *info);
566 
567 /*---------------------------------------------------------------------------*
568   Name:         FATFS_SetFileInfoW
569 
570   Description:  Changes file or directory information.
571 
572   Arguments:    path: Path name
573                 info: FATFSFileInfoW structure storing the information that should be changed
574 
575   Returns:      Changes information and returns TRUE if the specified path exists; otherwise, returns FALSE.
576  *---------------------------------------------------------------------------*/
577 BOOL FATFS_SetFileInfoW(const u16 *path, const FATFSFileInfoW *info);
578 
579 /*---------------------------------------------------------------------------*
580   Name:         FATFS_CreateFileW
581 
582   Description:  Creates a file at the specified path.
583 
584   Arguments:    path: Path name
585                 trunc: TRUE to delete the file if it already exists
586                 permit: File access permissions (rwx){1,3}
587 
588   Returns:      TRUE if the process is successful.
589  *---------------------------------------------------------------------------*/
590 BOOL FATFS_CreateFileW(const u16 *path, BOOL trunc, const char *permit);
591 
592 /*---------------------------------------------------------------------------*
593   Name:         FATFS_DeleteFileW
594 
595   Description:  Deletes the specified file.
596 
597   Arguments:    path: Path name
598 
599   Returns:      TRUE if it was deleted successfully.
600  *---------------------------------------------------------------------------*/
601 BOOL FATFS_DeleteFileW(const u16 *path);
602 
603 /*---------------------------------------------------------------------------*
604   Name:         FATFS_RenameFileW
605 
606   Description:  Renames the specified file.
607 
608   Arguments:    path: Path name
609                 newpath: New path name
610 
611   Returns:      TRUE if it was renamed successfully.
612  *---------------------------------------------------------------------------*/
613 BOOL FATFS_RenameFileW(const u16 *path, const u16 *newpath);
614 
615 /*---------------------------------------------------------------------------*
616   Name:         FATFS_CreateDirectoryW
617 
618   Description:  Creates a directory at the specified path.
619 
620   Arguments:    path: Path name
621                 permit: File access permissions (rwx){1,3}
622 
623   Returns:      TRUE if the process is successful.
624  *---------------------------------------------------------------------------*/
625 BOOL FATFS_CreateDirectoryW(const u16 *path, const char *permit);
626 
627 /*---------------------------------------------------------------------------*
628   Name:         FATFS_DeleteDirectoryW
629 
630   Description:  Deletes the specified directory.
631 
632   Arguments:    path: Path name
633 
634   Returns:      TRUE if it was deleted successfully.
635  *---------------------------------------------------------------------------*/
636 BOOL FATFS_DeleteDirectoryW(const u16 *path);
637 
638 /*---------------------------------------------------------------------------*
639   Name:         FATFS_RenameDirectoryW
640 
641   Description:  Renames the specified directory.
642 
643   Arguments:    path: Path name
644                 newpath: New path name
645 
646   Returns:      TRUE if it was renamed successfully.
647  *---------------------------------------------------------------------------*/
648 BOOL FATFS_RenameDirectoryW(const u16 *path, const u16 *newpath);
649 
650 /*---------------------------------------------------------------------------*
651   Name:         FATFS_OpenFileW
652 
653   Description:  Opens the file at the specified path.
654 
655   Arguments:    path: Path name
656                 mode: File access mode ("r/w/r+/w+" and "b/t")
657 
658   Returns:      The opened file handle or NULL.
659  *---------------------------------------------------------------------------*/
660 FATFSFileHandle FATFS_OpenFileW(const u16 *path, const char *mode);
661 
662 /*---------------------------------------------------------------------------*
663   Name:         FATFS_OpenDirectoryW
664 
665   Description:  Opens the directory at the specified path.
666 
667   Arguments:    path: Path name
668                 mode: Directory access mode (this is currently ignored)
669 
670   Returns:      The opened directory handle or NULL.
671  *---------------------------------------------------------------------------*/
672 FATFSDirectoryHandle FATFS_OpenDirectoryW(const u16 *path, const char *mode);
673 
674 /*---------------------------------------------------------------------------*
675   Name:         FATFS_ReadDirectoryW
676 
677   Description:  Reads the next entry information from a directory.
678 
679   Arguments:    dir: Directory handle
680                 info: Location to store the entry information
681 
682   Returns:      TRUE if the entry information was read normally.
683  *---------------------------------------------------------------------------*/
684 BOOL FATFS_ReadDirectoryW(FATFSDirectoryHandle dir, FATFSFileInfoW *info);
685 
686 
687 /*---------------------------------------------------------------------------*
688  * Internal functions
689  *---------------------------------------------------------------------------*
690 
691  /*---------------------------------------------------------------------------*
692   Name:         FATFSiArcnameList
693 
694   Description:  This static buffer maintains a list of archive names that are accessible from the ARM9.
695                 It must be memory that can be referenced by both ARM9/ARM7, and by default a static variable in the LTDMAIN segment is used.
696                 For applications constructed using a special memory layout, you can change these variables to set the appropriate buffer before calling the FATFS_Init function.
697 
698 
699 
700 
701   Arguments:    None.
702 
703   Returns:      A static buffer that maintains a list of archive names that are accessible from the ARM9.
704  *---------------------------------------------------------------------------*/
705 extern char *FATFSiArcnameList/* [MATH_ROUNDUP(OS_MOUNT_ARCHIVE_NAME_LEN * OS_MOUNT_INFO_MAX + 1, 32)] ATTRIBUTE_ALIGN(32) */;
706 
707 /*---------------------------------------------------------------------------*
708   Name:         FATFSiCommandBuffer
709 
710   Description:  This is a pointer to a static command buffer for issuing requests.
711                 It must be memory that can be referenced by both ARM9/ARM7, and by default a static variable in the LTDMAIN segment is used.
712                 For applications constructed using a special memory layout, you can change these variables to set the appropriate buffer before calling the FATFS_Init function.
713 
714 
715 
716 
717   Arguments:    None.
718 
719   Returns:      Static command buffer of FATFS_COMMAND_BUFFER_MAX bytes.
720  *---------------------------------------------------------------------------*/
721 extern u8 *FATFSiCommandBuffer/* [FATFS_COMMAND_BUFFER_MAX] ATTRIBUTE_ALIGN(32)*/;
722 
723 /*---------------------------------------------------------------------------*
724   Name:         FATFSi_GetUnicodeConversionTable
725 
726   Description:  Gets the Unicode conversion table for sharing with the ARM7.
727                 You can override and disable this function to delete the (slightly less than) 80KB Unicode conversion table for applications that will clearly handle only ASCII path names.
728 
729 
730 
731   Arguments:    u2s: Conversion table from Unicode to Shift_JIS
732                 s2u: Conversion table from Shift_JIS to Unicode
733 
734   Returns:      None.
735  *---------------------------------------------------------------------------*/
736 void FATFSi_GetUnicodeConversionTable(const u8 **u2s, const u16 **s2u);
737 
738 /*---------------------------------------------------------------------------*
739   Name:         FATFSi_SetNdmaParameters
740 
741   Description:  Directly changes the NDMA settings used by the ARM7's FAT drives.
742 
743   Arguments:    ndmaNo: NDMA channel (0-3) for which to change the settings
744                 blockWord: Block transfer word count (MI_NDMA_BWORD_1-MI_NDMA_BWORD_32768)
745                 intervalTimer: Interval (0x0000-0xFFFF)
746                 prescaler: Prescaler (MI_NDMA_INTERVAL_PS_1-MI_NDMA_INTERVAL_PS_64)
747 
748   Returns:      None.
749  *---------------------------------------------------------------------------*/
750 void FATFSi_SetNdmaParameters(u32 ndmaNo, u32 blockWord, u32 intervalTimer, u32 prescaler);
751 
752 /*---------------------------------------------------------------------------*
753   Name:         FATFSi_SetRequestBuffer
754 
755   Description:  Configures a request buffer for changing the next command to be issued into an asynchronous process.
756 
757 
758   Arguments:    buffer: FATFSRequestBuffer structure to use for request management.
759                         It must be aligned to boundaries at integer multiples of 32 bytes.
760 
761                 callback: Callback to invoke when the command has completed
762 
763                 userdata: Arbitrary user-defined value to associate with the request buffer
764 
765   Returns:      None.
766  *---------------------------------------------------------------------------*/
767 void FATFSi_SetRequestBuffer(FATFSRequestBuffer *buffer, void (*callback)(FATFSRequestBuffer *), void *userdata);
768 
769 
770 #ifdef __cplusplus
771 } /* extern "C" */
772 #endif
773 
774 /* NITRO_FATFS_API_H_ */
775 #endif
776