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

📄 dio.h

📁 DSP/BIOS Driver Developer Kit 1.11 The DSP/BIOS Driver Developer Kit (DDK) provides a selection of
💻 H
字号:
/*
 *  Copyright 2003 by Texas Instruments Incorporated.
 *  All rights reserved. Property of Texas Instruments Incorporated.
 *  Restricted rights to use, duplicate or disclose this code are
 *  granted through contract.
 *  
 */
/* "@(#) DDK 1.11.00.00 11-04-03 (ddk-b13)" */
/*
 *  ======== dio.h ========
 *
 */

#ifndef DIO_
#define DIO_

#include <std.h>

#include <dev.h>
#include <sem.h>

#include <iom.h>

#ifdef __cplusplus
extern "C" {
#endif

/*
 * Function table to be use with dynamically created TSK
 */
extern DEV_Fxns DIO_tskDynamicFxns;

/*
 * Function table to be use with statically created TSK
 */
extern DEV_Fxns DIO_tskStaticFxns;

/*
 * Function table to be use with dynamically created callback thread
 */
extern DEV_Fxns DIO_cbDynamicFxns;

/*
 * Function table to be use with statically created callback thread
 */
extern DEV_Fxns DIO_cbStaticFxns;

/*
 *  ======== DIO_Params ========
 */
typedef struct DIO_Params {
    String      name;           /* name of mini driver */
    Ptr         chanParams;     /* optional mini driver create argument */
} DIO_Params;

/*
 * ======== DIO_Obj ========
 * In TSK version, there will contain a complete and ready semaphore.
 * In callback version, there will be a DEV_Callback object which
 * contains a function and two arguments
 */
typedef struct DIO_Obj {        
    IOM_Fxns    *fxns;                  /* mini-driver function table */
    Ptr         chanp;                  /* mini-driver handle */

    union context {
        struct sems {
            SEM_Handle  complete;       /* tasks wait for I/O here */
            SEM_Handle  ready;          /* used by DIO_ready */
        } sems; 
        DEV_Callback    cb;             /* use by callback version */
    } context;
} DIO_Obj;

typedef DIO_Obj *DIO_Handle;            /* device object handle */

extern Void DIO_init(Void);
extern Int  DIO_ctrl(DEV_Handle device, Uns cmd, Arg arg);
extern Int  DIO_cbIdle(DEV_Handle device, Bool flush);
extern Int  DIO_cbIssue(DEV_Handle device);
extern Bool DIO_cbReady(DEV_Handle device, SEM_Handle sem);
extern Int  DIO_cbReclaim(DEV_Handle device);
extern Void DIO_cbCallback(Ptr devp, DEV_Frame *frame);
extern Int  DIO_tskIdle(DEV_Handle device, Bool flush);
extern Int  DIO_tskIssue(DEV_Handle device);
extern Bool DIO_tskReady(DEV_Handle device, SEM_Handle sem);
extern Int  DIO_tskReclaim(DEV_Handle device);
extern Void DIO_tskCallback(Ptr devp, DEV_Frame *frame);

#ifdef __cplusplus
}
#endif /* extern "C" */

#endif /* DIO_ */

⌨️ 快捷键说明

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