Download FreeRTOS
 

Quality RTOS & Embedded Software

LIBRARIES
WHAT'S NEW
Simplifying Authenticated Cloud Connectivity for Any Device.
Designing an energy efficient and cloud-connected IoT solution with CoAP.
Introducing FreeRTOS Kernel version 11.0.0:
FreeRTOS Roadmap and Code Contribution process.
OPC-UA over TSN with FreeRTOS.

Registering the Driver's Components with the Embedded File System
Creating a FreeRTOS-Plus-FAT Media Driver

FreeRTOS-Plus-FAT needs to be aware of the components used by the media driver, including the driver's read and write functions, and the drivers IO manager. The FF_RegisterBlockDevice() function is used for this purpose.

As an example, below is the outline of the prvRegisterDisk() function used by FreeRTOS-Plus-FAT's RAM disk driver. prvRegisterDisk() is called by the RAM disk driver's initialisation function, and demonstrates how FF_RegisterBlockDevice() is used. See the file ff_ramdisk.c in the FreeRTOS-Plus/Source/FreeRTOS-Plus-FAT/portable/common directory for the full version.


static BaseType_t prvRegisterDisk( FF_Disk_t *pxDisk )
{
FF_Error_t xError;
BaseType_t xReturn;

/* Register the read/write access functions and the IO manager with the file
system. pxDisk is also registered as a parameter that will be passed to the
read and write functions when they are called. */

xError = FF_RegisterBlockDevice( pxDisk->pxIOManager,
ramSECTOR_SIZE,
prvWriteRAM,
prvReadRAM,
( void * ) pxDisk );

if( FF_isERR( xError ) != pdFALSE )
{
xReturn = pdFAIL;
}
else
{
/* Record that the disk has been successfully registered. */
pxDisk->xStatus.bIsRegistered = pdTRUE;
xReturn = pdPASS;
}

return xReturn;
}

Registering the components used by the media driver with the FreeRTOS-Plus-FAT embedded file system








Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.