这篇教程C++ FATFS_LinkDriver函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中FATFS_LinkDriver函数的典型用法代码示例。如果您正苦于以下问题:C++ FATFS_LinkDriver函数的具体用法?C++ FATFS_LinkDriver怎么用?C++ FATFS_LinkDriver使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了FATFS_LinkDriver函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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); }}
开发者ID:451506709,项目名称:automated_machine,代码行数:39,
示例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); } } }}
开发者ID:Lembed,项目名称:STM32CubeF1-mirrors,代码行数:32,
示例3: MX_FATFS_Initvoid 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 */}
开发者ID:merida20,项目名称:SeniorDesign,代码行数:30,
示例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;}
开发者ID:eemei,项目名称:library-stm32f4,代码行数:35,
示例5: startup_taskvoid 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);}
开发者ID:timurey,项目名称:oryx_stm32f205,代码行数:25,
示例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) { } }
开发者ID:Lembed,项目名称:STM32CubeF4-mirrors,代码行数:64,
示例7: MX_FATFS_Initvoid 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 */}
开发者ID:Manuvr,项目名称:Digitabulum-Firmware,代码行数:8,
示例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(); }}
开发者ID:pierreroth64,项目名称:STM32Cube_FW_F4,代码行数:63,
示例9: MX_FATFS_Initvoid 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 */}
开发者ID:gitter-badger,项目名称:Micromouse_2016,代码行数:9,
示例10: application_initextern void application_init(void){ /*##-1- Link the USB Host disk I/O driver ##################################*/ if(FATFS_LinkDriver(&USBH_Driver, USBDISKPath) != 0) { Error_Handler(); } TickTock_Init();}
开发者ID:glocklueng,项目名称:STM32F401-SenoGen,代码行数:10,
示例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); }}
开发者ID:eemei,项目名称:library-stm32f4,代码行数:59,
示例12: MX_FATFS_Inituint8_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;}
开发者ID:cocoasuny,项目名称:AccessPoint,代码行数:53,
示例13: MX_FATFS_Initvoid 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 */}
开发者ID:molnard,项目名称:STM32L476_FT811,代码行数:12,
示例14: LBF_FatFS_Initboolean_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;}
开发者ID:La-BlueFrog,项目名称:L4-LimiFrog-SW-WIP,代码行数:13,
示例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 { // C++ FAssert函数代码示例 C++ FATAL_ERROR_IF函数代码示例
|