#include <file_config.h>
U32 DeviceCtrl (
U32 code, /* Device control code */
void *p); /* Pointer to parameters */
Description
The function DeviceCtrl sends a control code directly to
device driver, causing the corresponding device to perform the
corresponding operation.
The parameter code specifies the control code for the
driver. The parameter p is a generic pointer. It is used to
pass additional parameters to the driver when needed.
The following control codes are currently supported:
Control code
Function
DC_CHKMEDIA
Checks the Media Detect and Write Protect status
of a removable media. For example, SD/MMC Memory Card, USB Flash
dongle.
DC_FORMAT
Low level formats the device. This is only needed
for NAND device low level FTL formatting.
DC_SERIAL
Reads device serial number. This command is valid
for MMC or SD card.
DC_GETCID
Reads memory card CID register. This command is
valid for MMC or SD card.
The function is part of the FAT
Driver. The prototype is defined in the file
File_Config.h. Developers must customize the function.
Return Value
For control codeDC_CHKMEDIA the DeviceCtrl
function returns:
M_INSERTED
Media is inserted in the socket.
M_PROTECTED
Media is read-only. Lock slider on SD Card is in position
'Locked'.
M_NOCHKMEDIA
Media Check function is not supported.
For control codeDC_FORMAT the DeviceCtrl
function returns:
__TRUE
Low level formatting successful.
__FALSE
Low level formatting failed.
For control codeDC_SERIAL the DeviceCtrl
function returns:
Zero
Serial number is not available on this device.
Non-zero
Serial number read successful.
For control codeDC_GETCID the DeviceCtrl
function returns:
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers of your data.