📄 abl_api.h
字号:
/*********************************************************************** * $Workfile: abl_api.h $ * $Revision: 1.0 $ * $Author: WellsK $ * $Date: Jun 09 2003 12:00:04 $ * * Project: Standard API * * Description: * This file implements non hardware specific IO system mechanism * * Revision History: * $Log: //smaicnt2/pvcs/VM/sharpmcu/archives/sharpmcu/software/abl/include/abl_api.h-arc $ *
* Rev 1.0 Jun 09 2003 12:00:04 WellsK
* Initial revision.
* *********************************************************************** * SHARP MICROELECTRONICS OF THE AMERICAS MAKES NO REPRESENTATION * OR WARRANTIES WITH RESPECT TO THE PERFORMANCE OF THIS SOFTWARE, * AND SPECIFICALLY DISCLAIMS ANY RESPONSIBILITY FOR ANY DAMAGES, * SPECIAL OR CONSEQUENTIAL, CONNECTED WITH THE USE OF THIS SOFTWARE. * * SHARP MICROELECTRONICS OF THE AMERICAS PROVIDES THIS SOFTWARE SOLELY * FOR THE PURPOSE OF SOFTWARE DEVELOPMENT INCORPORATING THE USE OF A * SHARP MICROCONTROLLER OR SYSTEM-ON-CHIP PRODUCT. USE OF THIS SOURCE * FILE IMPLIES ACCEPTANCE OF THESE CONDITIONS. * * COPYRIGHT (C) 2001 SHARP MICROELECTRONICS OF THE AMERICAS, INC. * CAMAS, WA **********************************************************************/#ifndef ABL_API_H#define ABL_API_H#include "abl_types.h"/* System API data structure */typedef struct API_S{ /* Open the device */ PFI open; /* Close the device */ PFI close; /* Read data from the device */ PFI read; /* Wrote data to the device */ PFI write; /* Device control and configuration */ PFI ioctl; } API_T, *PAPI_T;/* Api system device lookup table */typedef struct API_TABLE_S{ /* Device driver callbacks */ API_T driver; /* Device Id */ INT_32 id; /* Driver device id */ INT_32 devid; /* File descriptor */ INT_32 fd; /* Driver state */ INT_32 opened;} API_TABLE_T, *PAPI_TABLE_T;/* Max number of devices in the subsystem */#define MAX_API_TABLE (20)#if defined (__cplusplus)extern "C" {#endif /*__cplusplus *//* * Public APIs used to access device drivers that are registered * with the API sub system. */EXTERN void abl_api_init (void* cfg);EXTERN INT_32 abl_open (INT_32 devid, INT_32 arg);EXTERN INT_32 abl_close (INT_32 fd);EXTERN INT_32 abl_read (INT_32 fd, CHAR* buffer, INT_32 max_bytes);EXTERN INT_32 abl_write (INT_32 fd, CHAR* buffer, INT_32 n_bytes);EXTERN INT_32 abl_ioctl (INT_32 fd, INT_32 cmd, INT_32 arg);EXTERN INT_32 abl_api_register (INT_32 devid, void* open, void* close, void* read, void* write, void* ioctl);#if defined (__cplusplus)}#endif /*__cplusplus */#endif /* ABL_API_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -