⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 _blkdev.h

📁 DOC文件系统驱动源代码
💻 H
📖 第 1 页 / 共 5 页
字号:
/*        irSectorNo      : First sector no. to write (sector 0 is the  */
/*                          DOS boot sector).                           */
/*        irSectorCount   : Number of consectutive sectors to write     */
/*                                                                      */
/* Returns:                                                             */
/*        FLStatus        : 0 on success, otherwise failed              */
/*        irSectorCount   : Number of sectors actually written          */
/*----------------------------------------------------------------------*/

#define flAbsWrite(ioreq)        bdCall(FL_ABS_WRITE,ioreq)

/*----------------------------------------------------------------------*/
/*                         f l A b s D e l e t e                        */
/*                                                                      */
/* Marks absolute sectors by sector no. as deleted.                     */
/*                                                                      */
/* Parameters:                                                          */
/*        irHandle        : Drive number (0, 1, ...)                    */
/*                        bits 7-4 - Partition # (zero based)           */
/*                        bits 3-0 - Socket # (zero based)              */ 
/*        irSectorNo      : First sector no. to delete (sector 0 is the */
/*                          DOS boot sector).                           */
/*        irSectorCount   : Number of consectutive sectors to delete    */
/*                                                                      */
/* Returns:                                                             */
/*        FLStatus        : 0 on success, otherwise failed              */
/*        irSectorCount        : Number of sectors actually deleted     */
/*----------------------------------------------------------------------*/

#define flAbsDelete(ioreq)        bdCall(FL_ABS_DELETE,ioreq)

#ifdef WRITE_PROTECTION
/*----------------------------------------------------------------------*/
/*              f l W r i t e P r o t e c t i o n                       */
/*                                                                      */
/* Put and remove write protection from the volume                      */
/*                                                                      */
/* Note partition number 0 protectes the binary partition as well       */
/*                                                                      */
/* Parameters:                                                          */
/*        irHandle        : Drive number (0, 1, ...)                    */
/*                        bits 7-4 - Partition # (zero based)           */
/*                        bits 3-0 - Socket # (zero based)              */ 
/*        irFlags         : FL_PROTECT=remove, FL_UNPROTECT=put         */
/*                          and FL_UNLOCK=unlock                        */
/*        irData          : password (8 bytes)                          */
/*                                                                      */
/* Returns:                                                             */
/*        FLStatus        : 0 on success, otherwise failed              */
/*----------------------------------------------------------------------*/

#define flWriteProtection(ioreq) bdCall(FL_WRITE_PROTECTION,ioreq)

#endif /* WRITE_PROTETION */
#endif /* FL_READ_ONLY */
#endif /* ABS_READ_WRITE */

#ifdef FL_LOW_LEVEL

/*----------------------------------------------------------------------*/
/*                         f l G e t P h y s i c a l I n f o            */
/*                                                                      */
/* Get physical information of the media. The information includes      */
/* JEDEC ID, unit size and media size.                                  */
/*                                                                      */
/* Parameters:                                                          */
/*        irHandle        : Socket number (0,1,..)                      */
/*        irData          : Address of user buffer to read physical     */
/*                          information into.                           */
/*                                                                      */
/* Returns:                                                             */
/*        FLStatus        : 0 on success, otherwise failed              */
/*        irLength        : Window base address. note mast be cast to   */
/*                          unsigned.                                   */
/*----------------------------------------------------------------------*/

#define flGetPhysicalInfo(ioreq)        bdCall(FL_GET_PHYSICAL_INFO, ioreq)

/*----------------------------------------------------------------------*/
/*                             f l P h y s i c a l R e a d              */
/*                                                                      */
/* Read from a physical address.                                        */
/*                                                                      */
/* Parameters:                                                          */
/*        irHandle         : Socket number (0,1,..)                     */
/*        irAddress        : Physical address to read from.             */
/*        irByteCount      : Number of bytes to read.                   */
/*        irData           : Address of user buffer to read into.       */
/*        irFlags          : Method mode                                */
/*                        EDC:       Activate ECC/EDC                   */
/*                        EXTRA:     Read/write spare area              */
/* Returns:                                                             */
/*        FLStatus        : 0 on success, otherwise failed              */
/*----------------------------------------------------------------------*/

#define flPhysicalRead(ioreq)                bdCall(FL_PHYSICAL_READ,ioreq)


#ifndef FL_READ_ONLY
/*----------------------------------------------------------------------*/
/*                    f l P h y s i c a l W r i t e                     */
/*                                                                      */
/* Write to a physical address.                                         */
/*                                                                      */
/* Parameters:                                                          */
/*        irHandle        : Socket number (0,1,..)                      */
/*        irAddress       : Physical address to write to.               */
/*        irByteCount     : Number of bytes to write.                   */
/*        irData          : Address of user buffer to write from.       */
/*        irFlags         : Method mode                                 */
/*                        EDC:       Activate ECC/EDC                   */
/*                        EXTRA:     Read/write spare area              */
/* Returns:                                                             */
/*        FLStatus        : 0 on success, otherwise failed              */
/*----------------------------------------------------------------------*/

#define flPhysicalWrite(ioreq)                bdCall(FL_PHYSICAL_WRITE,ioreq)

/* Bit assignment of irFlags for flPhysicalRead or flPhysicalWrite: */
/*   ( defined in file flflash.h )                                  */
/* #define OVERWRITE    1        *//* Overwriting non-erased area   */
/* #define EDC          2        *//* Activate ECC/EDC              */
/* #define EXTRA        4        *//* Read/write spare area         */

/*----------------------------------------------------------------------*/
/*                    f l P h y s i c a l E r a s e                     */
/*                                                                      */
/* Erase physical units.                                                */
/*                                                                      */
/* Parameters:                                                          */
/*        irHandle       : Socket number (0,1,..)                       */
/*        irUnitNo        : First unit to erase.                        */
/*        irUnitCount     : Number of units to erase.                   */
/*                                                                      */
/* Returns:                                                             */
/*        FLStatus        : 0 on success, otherwise failed              */
/*----------------------------------------------------------------------*/

#define flPhysicalErase(ioreq)                bdCall(FL_PHYSICAL_ERASE,ioreq)

#endif /* FL_READ_ONLY */

#ifdef BDK_ACCESS

 /*-------------------------------------------------------------------
 * bdkReadInit - Init read operations on the DiskOnChip starting
 *       at 'startUnit', with a size of 'areaLen' bytes and 'signature'.
 *
 * Note: Blocks in the DiskOnChip are marked with a 4-character signature
 *       followed by a 4-digit hexadecimal number.
 *
 * Parameters:
 *             'irHandle'      - Drive number (0, 1, ...)
 *                        bits 7-4 - Partition # (zero based)           
 *                        bits 3-0 - Socket # (zero based)               
 *             'irData'         - bdkParams record
 *                startingBlock - unit number of the sub-partition to start reading from
 *                length        - number of bytes to read
 *                oldSign       - signature of the sub-partition
 *                flags         - EDC or not
 *                signOffset    - signature offset 0 or 8
 *
 *  Return :
 *      flOK                - success
 *      flDriveNotAvailable - DiskOnChip ASIC was not found
 *      flUnknownMedia      - failed in Flash chips recognition
 *      flBadFormat         - TL format does not exists
 *      flNoSpaceInVolume   - there are 0 units marked with this signature
 *      flDataError         - MTD read fault.
 *      flHWReadProtect     - HW read protection was triggerd
 *-------------------------------------------------------------------*/

#define bdkReadInit(ioreq) bdCall(FL_BINARY_READ_INIT,ioreq)

/*-------------------------------------------------------------------
 * bdkReadBlock - Read to 'buffer' from the DiskOnChip BDK Image area.
 *
 * Note: Before the first use of this function 'bdkCopyBootAreaInit'
 *       must be called
 *
 * Parameters:
 *             'irHandle'      - Drive number (0, 1, ...)
 *                    bits 7-4 - Partition # (zero based)           
 *                    bits 3-0 - Socket # (zero based)               
 *             'irData'         - bdkParams record
 *                length        - number of bytes to read
 *                bdkBuffer     - buffer to read into
 *
 *  Return :
 *      flOK                - success
 *      flDriveNotAvailable - DiskOnChip ASIC was not found
 *      flUnknownMedia      - failed in Flash chips recognition
 *      flBadFormat         - TL format does not exists
 *      flNoSpaceInVolume   - there are 0 units marked with this signature
 *      flDataError         - MTD read fault.
 *      flHWReadProtect     - HW read protection was triggerd
 *-------------------------------------------------------------------*/

#define bdkReadBlock(ioreq) bdCall(FL_BINARY_READ_BLOCK,ioreq)

/*-------------------------------------------------------------------
 * bdkWriteInit - Init update operations on the DiskOnChip starting
 *       at 'startUnit', with a size of 'areaLen' bytes and 'signature'.
 *
 * Note: Blocks in th

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -