Prusa MINI Firmware overview
ff_gen_drv.h File Reference

Header for ff_gen_drv.c module. More...

#include "diskio.h"
#include "ff.h"
#include "stdint.h"

Go to the source code of this file.

Classes

struct  Diskio_drvTypeDef
 Disk IO Driver structure definition. More...
 
struct  Disk_drvTypeDef
 Global Disk IO Drivers structure definition. More...
 

Functions

uint8_t FATFS_LinkDriver (const Diskio_drvTypeDef *drv, char *path)
 Links a compatible diskio driver and increments the number of active linked drivers. More...
 
uint8_t FATFS_UnLinkDriver (char *path)
 Unlinks a diskio driver and decrements the number of active linked drivers. More...
 
uint8_t FATFS_LinkDriverEx (const Diskio_drvTypeDef *drv, char *path, BYTE lun)
 
uint8_t FATFS_UnLinkDriverEx (char *path, BYTE lun)
 
uint8_t FATFS_GetAttachedDriversNbr (void)
 Gets number of linked drivers to the FatFs module. More...
 

Detailed Description

Header for ff_gen_drv.c module.

Author
MCD Application Team
Version
V2.0.2
Date
10-November-2017
Attention

© Copyright (c) 2017 STMicroelectronics International N.V. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted, provided that the following conditions are met:

  1. Redistribution of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of STMicroelectronics nor the names of other contributors to this software may be used to endorse or promote products derived from this software without specific written permission.
  4. This software, including modifications and/or derivative works of this software, must execute solely and exclusively on microcontroller or microprocessor devices manufactured by or for STMicroelectronics.
  5. Redistribution and use of this software other than as permitted under this license is void and will automatically terminate your rights under this license.

THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Function Documentation

◆ FATFS_LinkDriver()

uint8_t FATFS_LinkDriver ( const Diskio_drvTypeDef drv,
char *  path 
)

Links a compatible diskio driver and increments the number of active linked drivers.

Note
The number of linked drivers (volumes) is up to 10 due to FatFs limits
Parameters
drvpointer to the disk IO Driver structure
pathpointer to the logical drive path
Return values
Returns0 in case of success, otherwise 1.
99 {
100  return FATFS_LinkDriverEx(drv, path, 0);
101 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FATFS_UnLinkDriver()

uint8_t FATFS_UnLinkDriver ( char *  path)

Unlinks a diskio driver and decrements the number of active linked drivers.

Parameters
pathpointer to the logical drive path
Return values
Returns0 in case of success, otherwise 1.
137 {
138  return FATFS_UnLinkDriverEx(path, 0);
139 }
Here is the call graph for this function:

◆ FATFS_LinkDriverEx()

uint8_t FATFS_LinkDriverEx ( const Diskio_drvTypeDef drv,
char *  path,
BYTE  lun 
)

◆ FATFS_UnLinkDriverEx()

uint8_t FATFS_UnLinkDriverEx ( char *  path,
BYTE  lun 
)

◆ FATFS_GetAttachedDriversNbr()

uint8_t FATFS_GetAttachedDriversNbr ( void  )

Gets number of linked drivers to the FatFs module.

Parameters
None
Return values
Numberof attached drivers.
147 {
148  return disk.nbr;
149 }
FATFS_LinkDriverEx
uint8_t FATFS_LinkDriverEx(const Diskio_drvTypeDef *drv, char *path, uint8_t lun)
Links a compatible diskio driver/lun id and increments the number of active linked drivers.
Definition: ff_gen_drv.c:69
FATFS_UnLinkDriverEx
uint8_t FATFS_UnLinkDriverEx(char *path, uint8_t lun)
Unlinks a diskio driver and decrements the number of active linked drivers.
Definition: ff_gen_drv.c:110
disk
Disk_drvTypeDef disk
Definition: ff_gen_drv.c:54
Disk_drvTypeDef::nbr
volatile uint8_t nbr
Definition: ff_gen_drv.h:89