📄 tmfat32device.h
字号:
/* -------------------------------------------------------------------------- */
/* (C) Copyright 2000,2002, 2003 Koninklijke Philips Electronics N.V., */
/* All rights reserved */
/* */
/* This source code and any compilation or derivative thereof is the */
/* proprietary information of Konlinklijke Philips Electronics N.V. and is */
/* Confidential in nature. */
/* Under no circumstances is this software to be exposed to or placed under an*/
/* Open Source License of any type without the expressed written permission of*/
/* Koninklijke Philips Electronics N.V. */
/* -------------------------------------------------------------------------- */
/* FILE NAME: tmFat32Device.h */
/* */
/* DESCRIPTION: This is the API for tmFat32 device driver API */
/* */
/* DOCUMENT REF: tbd */
/* */
/* NOTES: tbd */
/* */
/* -------------------------------------------------------------------------- */
#ifndef _TMFAT32_DEVICE_H_
#define _TMFAT32_DEVICE_H_
/* -------------------------------------------------------------------------- */
/* Define extern c for C++ prototypes */
/* -------------------------------------------------------------------------- */
#if defined(__cplusplus)
extern "C"{
#endif
/* -------------------------------------------------------------------------- */
/* Types and defines: */
/* -------------------------------------------------------------------------- */
/*
* Useful information about any tmFat32 device
*/
typedef struct tmFat32_Dev
{
tmFat32_DeviceType_t type; // Device type
Bool removable; // If True it's removable.
UInt32 numUnits; // Number of physical units
UInt32 unit; // This unit number
UInt64 lbaMax; // Devices's max logical block address
UInt32 bytesPerSector; // Bytes per sector
UInt32 devInstance; // Address of the instance used by the tmdlXXX
// device driver (if applicable) for this volume.
// E.g., for tmdlIde it could be used to manage
// power for IDE devices.
Bool syncIO; // Use synchronous I/O with this unit. Some
// devices, such as IDE with tmdlIde can do
// I/O operations synchronously or asynchronously.
// Synchronous I/O is slightly faster and uses
// fewer OS resources but it blocks until I/O
// is complete.
ptmFat32_Instance_t vol; // Instance of mounted volume
tmFat32_NotifyEvent eventNotify; // If not Null call whenever an event
// occurs
UInt32 eventMask; // Mask for tmFat32_NotifyEvent.
char serial[TM_FAT32_MAX_SERIAL_NAME+1]; // Device serial number
// The above is the minimal set used by all devices. Do not change these.
// Device-specific additions follow these.
} tmFat32_Dev_t, *ptmFat32_Dev_t;
// Device driver functions
typedef tmErrorCode_t (*tmFat32_DeviceDriver_Init) ( ptmFat32_Dev_t p );
typedef tmErrorCode_t (*tmFat32_DeviceDriver_Term) ( ptmFat32_Dev_t p );
typedef tmErrorCode_t (*tmFat32_DeviceDriver_Read)
( ptmFat32_Dev_t p, // I: Pointer to tmFat32_Dev_t structure
UInt64 sector, // I: Starting sector number
UInt32 count, // I: Number of sectors
UInt8 * buffer); // O: Pointer to buffer to receive data
typedef tmErrorCode_t (*tmFat32_DeviceDriver_Write)
( ptmFat32_Dev_t p, // I: Pointer to tmFat32_Dev_t structure
UInt64 sector, // I: Starting sector number
UInt32 count, // I: Number of sectors
UInt8 * buffer); // I: Pointer to buffer containing data
/*
* Useful information about any tmFat32 device
*/
typedef struct tmFat32_DeviceDriver
{
ptmFat32_Dev_t Info; // Pointer to device specific information
tmFat32_DeviceDriver_Init Init; // Initialize
tmFat32_DeviceDriver_Term Term; // Terminate
tmFat32_DeviceDriver_Read Read; // Read sectors
tmFat32_DeviceDriver_Write Write; // Write sectors
} tmFat32_DeviceDriver_t, *ptmFat32_DeviceDriver_t;
// Device driver installation functions
typedef ptmFat32_DeviceDriver_t (*tmFat32_DeviceDriver_Install ) ( UInt32 unit );
typedef void (*tmFat32_DeviceDriver_Uninstall) ( ptmFat32_DeviceDriver_t p );
typedef void (*tmFat32_DeviceDriver_GetInfo) ( ptmFat32_Dev_t p );
// tmFat32 device list
typedef struct tmFat32_Devices
{
tmFat32_DeviceType_t type; // Device type
tmFat32_DeviceDriver_Install install; // Install function
tmFat32_DeviceDriver_Uninstall uninstall; // Uninstall function
} tmFat32_Devices_t, *ptmFat32_Devices_t;
/* -------------------------------------------------------------------------- */
/* End of extern c for C++ prototypes */
/* -------------------------------------------------------------------------- */
#if defined(__cplusplus)
}
#endif
#endif /* !defined(_TMFAT32_DEVICE_H_) */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -