Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Anchor10465261046526 Using the IDE/CF Driver Anchor10465271046527To use the IDE/CF driver, five files, in addition to the generic file system files, must be included in the build: Anchor10465281046528

  • fs_dev_ide.c

...

  • fs_dev_ide.h

...

...

  • fs_dev_ide_bsp.c (located in the user application or BSP).

Anchor10465311046531The file fs_dev_ide.h must also be #included in any application or header files that directly reference the driver (for example, by registering the device driver). The following directories must be on the project include path: Anchor10465321046532

  • \Micrium\Software\uC-FS\Drivers\IDE

...

...

A single IDE/CF volume is opened as shown in

...

Listing - Opening a IDE/CF device volume. The file system initialization (FS_Init()) function must have been previously called.

...

ROM/RAM characteristics and performance benchmarks of the IDE driver can be found in section 9-1-1 “Driver Characterization” on page 113 Driver Characterization.anchor

Code Block

...

1047384
HTML Table
summary
classCode_Listing
Table Row (tr)
Table Cell (td)
Anchor
1047384
language

...

{

{
    FS_ERR
err;
       err;
    
    FS_DevDrvAdd((FS_DEV_API *)&FSDev_IDE,
/* (1) */
              (1)    
                 (FS_ERR     *)&err);
if

    if ((err != FS_ERR_NONE) && (err != FS_ERR_DEV_DRV_ALREADY_ADDED))
{ return
 {
        return (DEF_FAIL);
} /* (2) */

    }
                                                        (2)        
    FSDev_Open((CPU_CHAR *)
“ide
"ide:0:
”, /* (a) */ (void *) 0, /* (b) */ (FS_ERR *)&err); switch (err) { case FS_ERR_NONE: break; case FS_ERR_DEV: case
",                       (a) 
               (void     *) 0,                             (b) 
               (FS_ERR   *)&err); 

    switch (err) {
        case FS_ERR_NONE:
             break;
        	
        case FS_ERR_DEV:
        case FS_ERR_DEV_IO:
case

        case FS_ERR_DEV_TIMEOUT:
case

        case FS_ERR_DEV_NOT_PRESENT:
return

             return (DEF_FAIL);
default: return

        default:
             return (DEF_FAIL);
} /* (3) */

    }        
                                                       (3)        
    FSVol_Open((CPU_CHAR         *)
“ide
"ide:0:
”, /* (a) */ (CPU_CHAR *)“ide:0:”, /* (b) */
",              (a) 
               (CPU_CHAR         *)"ide:0:",              (b)  
               (FS_PARTITION_NBR  ) 0,
/* (c) */ (FS_ERR
                    (c) 
               (FS_ERR           *)&err);
switch
 
    
    switch (err)
{ case
 {
        case FS_ERR_NONE:
break; case

             break;
        	
        case FS_ERR_DEV:
case

        case FS_ERR_DEV_IO:
case

        case FS_ERR_DEV_TIMEOUT:
case

        case FS_ERR_DEV_NOT_PRESENT:
case

        case FS_ERR_PARTITION_NOT_FOUND:
/* (4) */ return
                (4)   
             return (DEF_FAIL);
default: return

        default:
             return (DEF_FAIL);
} return

    }        
	    
    return (DEF_OK);

}
cpp
titleListing - Opening a IDE/CF device volume
linenumberstrue
CPU_BOOLEAN  App_FS_AddIDE (void)
Anchor
10473851047385
Anchor
10473861047386
Anchor
10473871047387
Anchor
10473881047388
Anchor
10473891047389
Anchor
10473901047390
Anchor
10473911047391
Anchor
10473921047392
Anchor
10473931047393
Anchor
10473941047394
Anchor
10473951047395
Anchor
10473961047396
Table Row (tr)
Table Cell (td)
rowspan49
Anchor
10474011047401
Anchor
10474021047402
Anchor
10474031047403
Anchor
10474041047404
Anchor
10474051047405
Anchor
10474061047406
Anchor
10474071047407
Anchor
10474081047408
Anchor
10474091047409
Anchor
10474101047410
Anchor
10474111047411
Anchor
10474121047412
Anchor
10474131047413
Anchor
10474141047414
Anchor
10474151047415
Anchor
10474161047416
Anchor
10474171047417
Anchor
10474181047418
Anchor
10474191047419
Anchor
10474201047420
Anchor
10474211047421
Anchor
10474221047422
Anchor
10474231047423
Anchor
10474241047424
Anchor
10474251047425
Anchor
10474261047426
Anchor
10474271047427
Anchor
10474281047428
Anchor
10474291047429
Anchor
10474301047430
Anchor
10474311047431
Anchor
10474321047432
Anchor
10474331047433
Anchor
10474341047434
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)

...


...

Panel

(1) Register the IDE/CF device driver.

...

(2) FSDev_Open() opens/initializes a file system device. The parameters are the device name (1a) and a pointer to a device driver-specific configuration structure (1b). The device name (1a) is composed of a device driver name (“ide”), a single colon, an ASCII-formatted integer (the unit number) and another colon. Since the IDE/CF driver requires no configuration, the configuration structure (1b) should be passed a NULL pointer.

...

Since IDE/CF are often removable media, it is possible for the device to not be present when FSDev_Open() is called. The device will still be added to the file system and a volume opened on the (not yet present) device. When the volume is later accessed, the file system will attempt to refresh the device information and detect a file system (see

...

Using Devices for more information).

...

(3) FSVol_Open() opens/mounts a volume. The parameters are the volume name (2a), the device name (2b) and the partition that will be opened (2c). There is no restriction on the volume name (2a); however, it is typical to give the volume the same name as the underlying device. If the default partition is to be opened, or if the device is not partition, then the partition number (2c) should be zero.

...

(4) High level format can be applied to the volume if FS_ERR_PARTITION_NOT_FOUND is returned by the call to FSVol_Open() function.

...



If the IDE initialization succeeds, the file system will produce the trace output as shown in Figure 18-1 in Figure - IDE detection trace output (if a sufficiently high trace level is configured). See section E-9 “Trace Configuration” on page 507 See Trace Configuration about configuring the trace level.anchor

Panel

...

borderWidth

...

0

...

titleFigure - IDE detection trace output

Image Added