FF_RegisterBlkDevice()
From FullFAT
Registers a block device driver, as specified by the FF_WRITE_BLOCKS and FF_READ_BLOCKS driver model description.
Contents |
Prototype
FF_ERROR FF_RegisterBlkDevice(FF_IOMAN *pIoman, FF_T_UINT16 BlkSize, FF_WRITE_BLOCKS fnWriteBlocks, FF_READ_BLOCKS fnReadBlocks, void *pParam);
Parameters
pIoman
Pointer to an FF_IOMAN object, as returned from the FF_CreateIOMAN() function.
BlkSize
The blocksize of the device driver being registered. This should match that of the FF_IOMAN object given. I.e. the BlkSize given to FF_CreateIOMAN() should be the same.
fnWriteBlocks
A pointer to a block write function, as defined by the FF_WRITE_BLOCKS specification.
fnReadBlocks
A pointer to a block read function, as defined by the FF_READ_BLOCKS specification.
pParam
A pointer (or item of size (sizeof(void *)) casted to void *) to anything that the provided Read and Write functions may require, if any.
When FullFAT calls the FF_WRITE_BLOCKS or FF_READ_BLOCKS functions this pointer or value is passed as a parameter.
Return Value
Returns FF_ERR_NONE on success.
All errors are negative, and can be passed to the FF_GetErrMessage() function to get a meaningful string describing the error.
Possible Error Codes
- FF_ERR_NULL_POINTER - pIoman parameter was NULL.
- FF_ERR_IOMAN_DEV_INVALID_BLKSIZE - BlkSize was not a multiple of 512 or a multiple of the FF_IOMAN BlkSize.
- FF_ERR_IOMAN_DEV_ALREADY_REGD - Cannot register a device twice. See FF_UnregisterBlkDevice().
See Also
- FF_CreateIOMAN()
- FF_DestroyIOMAN()
- FF_RegisterBlkDevice()
- FF_UnregisterBlkDevice()
- FF_MountPartition()
- FF_UnmountPartition()
Back to API

