本文整理汇总了C++中FATFS_LinkDriver函数的典型用法代码示例。如果您正苦于以下问题:C++ FATFS_LinkDriver函数的具体用法?C++ FATFS_LinkDriver怎么用?C++ FATFS_LinkDriver使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FATFS_LinkDriver函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: k_StorageInit
/**
* @brief Storage drives initialization
* @param None
* @retval None
*/
void k_StorageInit(void)
{
/* Link the USB Host disk I/O driver */
FATFS_LinkDriver(&USBH_Driver, USBDISK_Drive);
/* Link the micro SD disk I/O driver */
FATFS_LinkDriver(&SD_Driver, mSDDISK_Drive);
/* Create USB background task */
osThreadDef(STORAGE_Thread, StorageThread, osPriorityBelowNormal, 0, 2 * configMINIMAL_STACK_SIZE);
osThreadCreate (osThread(STORAGE_Thread), NULL);
/* Create Storage Message Queue */
osMessageQDef(osqueue, 10, uint16_t);
StorageEvent = osMessageCreate (osMessageQ(osqueue), NULL);
/* Init Host Library */
USBH_Init(&hUSB_Host, USBH_UserProcess, 0);
/* Add Supported Class */
USBH_RegisterClass(&hUSB_Host, USBH_MSC_CLASS);
/* Start Host Process */
USBH_Start(&hUSB_Host);
/* Enable SD Interrupt mode */
BSP_SD_Init();
BSP_SD_ITConfig();
if(BSP_SD_IsDetected())
{
osMessagePut ( StorageEvent, MSDDISK_CONNECTION_EVENT, 0);
}
}
示例2: SDCard_Config
/**
* @brief SD Card Configuration.
* @param None
* @retval None
*/
static void SDCard_Config(void)
{
uint32_t counter = 0;
if(FATFS_LinkDriver(&SD_Driver, SD_Path) == 0)
{
/* Initialize the SD mounted on adafruit 1.8" TFT shield */
if(BSP_SD_Init() != MSD_OK)
{
TFT_DisplayErrorMessage(BSP_SD_INIT_FAILED);
}
/* Check the mounted device */
if(f_mount(&SD_FatFs, (TCHAR const*)"/", 0) != FR_OK)
{
TFT_DisplayErrorMessage(FATFS_NOT_MOUNTED);
}
else
{
/* Initialize the Directory Files pointers (heap) */
for (counter = 0; counter < MAX_BMP_FILES; counter++)
{
pDirectoryFiles[counter] = malloc(11);
}
}
}
}
示例3: MX_FATFS_Init
void MX_FATFS_Init(void)
{
/*## FatFS: Link the SD driver ###########################*/
retSD = FATFS_LinkDriver(&SD_Driver, SD_Path);
/* USER CODE BEGIN Init */
/* additional user code for init */
if(!retSD)
{
if(f_mount(&SDFatFS, (TCHAR const*)SD_Path, 0) != FR_OK)
strToUART("mount failure\n");
else
{
strToUART("mount success\n");
if(f_open(&hello, "hello.txt", FA_READ) == FR_OK)
{
strToUART("opened hello.txt\n");
volatile char * str;
//int readcount;
TCHAR * buffer[10];
str = f_gets((char*)buffer, hello.fsize, &hello);
strToUART(str);
f_close(&hello);
}
else strToUART("could not open hello.txt\n");
}
}
/* USER CODE END Init */
}
示例4: SD_StorageInit
/**
* @brief Initializes the SD Storage.
* @param None
* @retval Status
*/
uint8_t SD_StorageInit(void)
{
/*Initializes the SD card device*/
BSP_SD_Init();
/* Check if the SD card is plugged in the slot */
if(BSP_SD_IsDetected() == SD_PRESENT )
{
/* Link the SD Card disk I/O driver */
if(FATFS_LinkDriver(&SD_Driver, SD_Path) == 0)
{
if((f_mount(&SD_FatFs, (TCHAR const*)SD_Path, 0) != FR_OK))
{
/* FatFs Initialization Error */
LCD_ErrLog("Cannot Initialize FatFs! \n");
return 1;
}
else
{
LCD_DbgLog ("INFO : FatFs Initialized! \n");
}
}
}
else
{
LCD_ErrLog("SD card NOT plugged \n");
return 1;
}
return 0;
}
示例5: startup_task
void startup_task (void *pvParameters)
{
(void) pvParameters;
MX_GPIO_Init();
/* Init Device Library */
USBD_Init(&hUsbDeviceFS, &VCP_Desc, 0);
/* Add Supported Class */
USBD_RegisterClass(&hUsbDeviceFS, &USBD_CDC);
/* Add CDC Interface Class */
USBD_CDC_RegisterInterface(&hUsbDeviceFS, &USBD_Interface_fops_FS);
/* Start Device Process */
USBD_Start(&hUsbDeviceFS);
xdev_out(putchar);
MX_SDIO_SD_Init();
FATFS_LinkDriver(&SD_Driver, SD_Path);
fsInit();
vTaskDelete(NULL);
}
示例6: main
/**
* @brief Main program
* @param None
* @retval None
*/
int main(void)
{
/* STM32F4xx HAL library initialization:
- Configure the Flash prefetch, instruction and Data caches
- Configure the Systick to generate an interrupt each 1 msec
- Set NVIC Group Priority to 4
- Global MSP (MCU Support Package) initialization
*/
HAL_Init();
/* Configure the system clock to 180 MHz */
SystemClock_Config();
/*Initialize the IO module*/
BSP_IO_Init ();
/* Configure LED1 and LED3 */
BSP_LED_Init(LED1);
BSP_LED_Init(LED3);
/*##-1- Link the USB Host disk I/O driver ##################################*/
if(FATFS_LinkDriver(&USBH_Driver, USBDISKPath) == 0)
{
/*##-2- Init Host Library ################################################*/
USBH_Init(&hUSB_Host, USBH_UserProcess, 0);
/*##-3- Add Supported Class ##############################################*/
USBH_RegisterClass(&hUSB_Host, USBH_MSC_CLASS);
/*##-4- Start Host Process ###############################################*/
USBH_Start(&hUSB_Host);
/*##-5- Run Application (Blocking mode) ##################################*/
while (1)
{
/* USB Host Background task */
USBH_Process(&hUSB_Host);
/* Mass Storage Application State Machine */
switch(Appli_state)
{
case APPLICATION_START:
MSC_Application();
Appli_state = APPLICATION_IDLE;
break;
case APPLICATION_IDLE:
default:
break;
}
}
}
/* Infinite loop */
while (1)
{
}
}
示例7: MX_FATFS_Init
void MX_FATFS_Init() {
/*## FatFS: Link the SD driver ###########################*/
retSD = FATFS_LinkDriver(&SD_Driver, SD_Path);
/* USER CODE BEGIN Init */
/* additional user code for init */
/* USER CODE END Init */
}
示例8: main
/**
* @brief Main program
* @param None
* @retval None
*/
int main(void)
{
/* STM32F4xx HAL library initialization:
- Configure the Flash prefetch, instruction and Data caches
- Configure the Systick to generate an interrupt each 1 msec
- Set NVIC Group Priority to 4
- Global MSP (MCU Support Package) initialization
*/
HAL_Init();
/* Configure the system clock to 168 MHz */
SystemClock_Config();
/* Configure LED1 and LED3 */
BSP_LED_Init(LED1);
BSP_LED_Init(LED3);
/*##-1- LCD Initialization #################################################*/
/* Initialize the LCD */
BSP_LCD_Init();
/* Enable the LCD */
BSP_LCD_DisplayOn();
/* Clear the LCD Background layer */
BSP_LCD_Clear(LCD_COLOR_WHITE);
/*##-2- Touch screen initialization ########################################*/
Touchscreen_Calibration();
BSP_TS_Init(BSP_LCD_GetXSize(), BSP_LCD_GetYSize());
/*##-3- Link the SD Card disk I/O driver ###################################*/
if(FATFS_LinkDriver(&SD_Driver, SDPath) != 0)
{
/* FatFs Initialization Error */
Error_Handler();
}
/* Create a FAT file system (format) on the logical drive */
f_mkfs((TCHAR const*)SDPath, 0, 0);
/*##-4- Register the file system object to the FatFs module ################*/
if(f_mount(&SDFatFs, (TCHAR const*)SDPath, 0) != FR_OK)
{
/* FatFs Initialization Error */
Error_Handler();
}
/*##-5- Draw the menu ######################################################*/
Draw_Menu();
/* Infinite loop */
while (1)
{
/*##-6- Configure the touch screen and Get the position ####################*/
GetPosition();
}
}
示例9: MX_FATFS_Init
void MX_FATFS_Init(void)
{
/*## FatFS: Link the USER driver ###########################*/
retUSER = FATFS_LinkDriver(&USER_Driver, USER_Path);
/* USER CODE BEGIN Init */
/* additional user code for init */
/* USER CODE END Init */
}
示例10: application_init
extern void application_init(void)
{
/*##-1- Link the USB Host disk I/O driver ##################################*/
if(FATFS_LinkDriver(&USBH_Driver, USBDISKPath) != 0)
{
Error_Handler();
}
TickTock_Init();
}
示例11: main
/**
* @brief Main program
* @param None
* @retval None
*/
int main(void)
{
/* STM32F4xx HAL library initialization:
- Configure the Flash prefetch, instruction and Data caches
- Configure the Systick to generate an interrupt each 1 msec
- Set NVIC Group Priority to 4
- Global MSP (MCU Support Package) initialization
*/
HAL_Init();
/* Configure the system clock to 168 MHz */
SystemClock_Config();
/* Configure LED3 and LED4 */
BSP_LED_Init(LED3);
BSP_LED_Init(LED4);
/* Configure USER Button */
BSP_PB_Init(BUTTON_KEY, BUTTON_MODE_GPIO);
/* Initialize LCD driver */
LCD_Config();
/* Link the USB Host disk I/O driver */
USBDISK_Driver_Num = FATFS_LinkDriver(&USBH_Driver, "");
/* Init Host Library */
if (USBH_Init(&hUSB_Host, USBH_UserProcess, 0) != USBH_OK)
{
/* USB Initialization Error */
Error_Handler();
}
/* Add Supported Class */
USBH_RegisterClass(&hUSB_Host, USBH_MSC_CLASS);
/* Start Host Process */
if (USBH_Start(&hUSB_Host) != USBH_OK)
{
/* USB Initialization Error */
Error_Handler();
}
/* Infinite loop */
while (1)
{
if (Appli_state == APPLICATION_START)
{
MSC_Application();
}
Toggle_Leds();
USBH_Process(&hUSB_Host);
}
}
示例12: MX_FATFS_Init
uint8_t MX_FATFS_Init(void)
{
uint8_t retSD = true; /* Return value for SD */
MX_SDIO_SD_Init();
/*## FatFS: Link the SD driver ###########################*/
retSD = FATFS_LinkDriver(&SD_Driver, SDPath);
if(retSD != 0)
{
printf("FatFs Link Driver Err\r\n");
retSD = false;
}
else
{
retSD = true;
}
store_manage_init();
//
// /*##-1- Register the file system object to the FatFs module ##############*/
// if(f_mount(&SDFatFs, (TCHAR const*)SDPath, 0) != FR_OK)
// {
// #ifdef Debug_FatFs_Driver
// /* FatFs Initialization Error */
// printf("f_mount Err in fatfs_shell\r\n");
// #endif
// retSD = false;
// /*##-2- Create a FAT file system (format) on the logical drive #########*/
// /* WARNING: Formatting the uSD card will delete all content on the device */
// if(f_mkfs((TCHAR const*)SDPath, 0, 0) != FR_OK)
// {
// /* FatFs Format Error */
// #ifdef Debug_FatFs_Driver
// printf("FatFs Format Err in fatfs_shell\r\n");
// #endif
// retSD = false;
// }
// #ifdef Debug_FatFs_Driver
// else
// {
// printf("FatFs Format OK\r\n");
// }
// #endif
// }
// #ifdef Debug_FatFs_Driver
// else
// {
// printf("Register FS OK\r\n");
// }
// #endif
return retSD;
}
示例13: MX_FATFS_Init
void MX_FATFS_Init(void)
{
/*## FatFS: Link the USER driver ###########################*/
retUSER = FATFS_LinkDriver(&USER_Driver, USER_Path);
/* USER CODE BEGIN Init */
/* additional user code for init */
HAL_Error_Handler(f_mount(&mynewdiskFatFs, USER_Path, 0));
printf("drive number:%d path:%s successfully mounted\r\n",retUSER,USER_Path);
MX_FATFS_Speedtest();
/* USER CODE END Init */
}
示例14: LBF_FatFS_Init
boolean_t LBF_FatFS_Init (void)
{
boolean_t Success = TRUE;
Success &= (FATFS_LinkDriver(&DataFlash_DISK_Driver, DataFlash_DISK_Path) == 0);
if (Success)
{
Success &= (f_mount(&DataFlash_DISK_FatFs, (TCHAR const*)DataFlash_DISK_Path, 0) == FR_OK);
}
return Success;
}
示例15: FDrive_Init
//------------------------------------------------------------------------------------------------------------------------------------------------------
void FDrive_Init(void)
{
if(FATFS_LinkDriver(&USBH_Driver, USBDISKPath) == FR_OK)
{
USBH_StatusTypeDef res = USBH_Init(&handleUSBH, USBH_UserProcess, 0);
res = USBH_RegisterClass(&handleUSBH, USBH_MSC_CLASS);
res = USBH_Start(&handleUSBH);
}
else
{
// —юда попадаем, если usbh driver не удалось инициализировать
}
}