本文整理汇总了C++中FATFS_LinkDriver函数的典型用法代码示例。如果您正苦于以下问题:C++ FATFS_LinkDriver函数的具体用法?C++ FATFS_LinkDriver怎么用?C++ FATFS_LinkDriver使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FATFS_LinkDriver函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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,代码来源:k_storage.c
示例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,代码来源:main.c
示例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 */
}
开发者ID:merida20,项目名称:SeniorDesign,代码行数:30,代码来源:fatfs.c
示例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,代码来源:audio_explorer.c
示例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);
}
开发者ID:timurey,项目名称:oryx_stm32f205,代码行数:25,代码来源:main.c
示例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,代码来源:main.c
示例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 */
}
开发者ID:Manuvr,项目名称:Digitabulum-Firmware,代码行数:8,代码来源:fatfs.c
示例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,代码来源:main.c
示例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 */
}
开发者ID:gitter-badger,项目名称:Micromouse_2016,代码行数:9,代码来源:fatfs.c
示例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();
}
开发者ID:glocklueng,项目名称:STM32F401-SenoGen,代码行数:10,代码来源:application.c
示例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,代码来源:main.c
示例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;
}
开发者ID:cocoasuny,项目名称:AccessPoint,代码行数:53,代码来源:fatfs.c
示例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 */
}
开发者ID:molnard,项目名称:STM32L476_FT811,代码行数:12,代码来源:fatfs.c
示例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;
}
开发者ID:La-BlueFrog,项目名称:L4-LimiFrog-SW-WIP,代码行数:13,代码来源:LBF_FatFS_Init.c
示例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 не удалось инициализировать
}
}
开发者ID:Sasha7b9,项目名称:Osci,代码行数:14,代码来源:FlashDrive.c
示例16: 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
{
LOG_ERROR("Can not %s", __FUNCTION__);
}
}
开发者ID:Sasha7b9,项目名称:Osci,代码行数:14,代码来源:FlashDrive.c
示例17: SD_Init
void SD_Init(void){
FRESULT res; /* FatFs function common result code */
uint32_t byteswritten; /* File write/read counts */
uint8_t wtext[] = "This is STM32 working with FatFs"; /* File write buffer */
if(FATFS_LinkDriver(&SD_Driver, SDPath) == 0)
{
if(f_mount(&SDFatFs,(TCHAR const*)SDPath, 0) != FR_OK)
{
Error_Handler();
}
else
{
if(f_open(&MyFile, "STM32.TXT", FA_CREATE_ALWAYS | FA_WRITE) != FR_OK)
{
Error_Handler();
}
else
{
f_puts("First string in my file\n", &MyFile);
/*
res = f_write(&MyFile, wtext, sizeof(wtext), (void *)&byteswritten);
if((byteswritten == 0) || (res != FR_OK))
{
Error_Handler();
}
else
{
*/
f_close(&MyFile);
BSP_LED_On(LED0);
BSP_LED_Toggle(LED0);
HAL_Delay(100);
BSP_LED_Toggle(LED0);
HAL_Delay(100);
BSP_LED_Toggle(LED0);
HAL_Delay(100);
BSP_LED_Toggle(LED0);
HAL_Delay(100);
BSP_LED_Toggle(LED0);
HAL_Delay(100);
BSP_LED_Toggle(LED0);
HAL_Delay(100);
BSP_LED_Toggle(LED0);
// }
}
}
}
FATFS_UnLinkDriver(SDPath);
}
开发者ID:photon0414,项目名称:Balance_Car_STM32,代码行数:50,代码来源:function.c
示例18: SD_init
void SD_init() {
char SDPath[4]; /* SD card logical drive path */
if (FATFS_LinkDriver(&SD_Driver, SDPath) == 0)
{
if (f_mount(&SDFatFs, (TCHAR const*)SDPath, 0) == FR_OK)
{
} else {
Error_Handler();
}
} else {
Error_Handler();
}
}
开发者ID:fluorumlabs,项目名称:stm32f7discovery_midi_synth,代码行数:14,代码来源:main.c
示例19: kStorage_Init
/**
* @brief Storage drives initialization
* @param None
* @retval None
*/
STORAGE_RETURN kStorage_Init(void)
{
/* Link the micro SD disk I/O driver */
if(FATFS_LinkDriver(&SD_Driver, mSDDISK_Drive)!=0)
{
return KSTORAGE_ERROR_LINK;
}
/* Register the file system object to the FatFs module */
if(f_mount(&mSDDISK_FatFs, (TCHAR const*)mSDDISK_Drive, 0) != FR_OK)
{
/* FatFs Initialization Error */
return KSTORAGE_ERROR_MOUNT;
}
return KSTORAGE_NOERROR;
}
开发者ID:GreyCardinalRus,项目名称:stm32-cube,代码行数:20,代码来源:k_storage.c
示例20: 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 the BSP */
BSP_Config();
/* Initialize the LwIP stack */
lwip_init();
/* Configure the Network interface */
Netif_Config();
/* Initialize the TFTP server */
tftpd_init();
/* Notify user about the network interface config */
User_notification(&gnetif);
/* Link the SD Card disk I/O driver */
FATFS_LinkDriver(&SD_Driver, SD_Path);
/* Infinite loop */
while (1)
{
/* Read a received packet from the Ethernet buffers and send it
to the lwIP for handling */
ethernetif_input(&gnetif);
/* Handle timeouts */
sys_check_timeouts();
#ifdef USE_DHCP
/* handle periodic timers for LwIP */
DHCP_Periodic_Handle(&gnetif);
#endif
}
}
开发者ID:Joe-Merten,项目名称:Stm32-Tools-Evaluation,代码行数:52,代码来源:main.c
注:本文中的FATFS_LinkDriver函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论