Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

driver.h: Driver interface
[platform independant portions of code]


Data Structures

union  _DriverVariable
struct  _DriverParam
struct  _DriverItem
struct  _Driver
struct  _DriverContext

Defines

#define DRIVER_ITEM_MAX_LENGTH   (64)

Typedefs

typedef _DriverItemDriverItem
typedef _DriverDriver
typedef ErrorCode(* DriverInitFunction )(Driver drv)
typedef ErrorCode(* DriverFinalFunction )(Driver drv)
typedef enum _DriverParamType DriverParamType
typedef _DriverVariable DriverVariable
typedef _DriverParamDriverParam
typedef DriverVariable(* DriverItemHandlerFunction )(Driver driver, DriverVariable vars[])
typedef _DriverContextDriverContext

Enumerations

enum  _DriverParamType {
  DriverParamVoid, DriverParamCharacter, DriverParamString, DriverParamStringUtf,
  DriverParamInteger64, DriverParamInteger32, DriverParamInteger16, DriverParamInteger8,
  DriverParamUnsignedInteger64, DriverParamUnsignedInteger32, DriverParamUnsignedInteger16, DriverParamUnsignedInteger8,
  DriverParamBoolean, DriverParamPointer
}

Functions

ErrorCode driverCreate (Driver *driver)
ErrorCode driverCreateFromObject (Driver *driver, Object object)
ErrorCode driverSetRoot (Driver driver, String loc, DriverItem root)
ErrorCode driverSetMetaData (Driver driver, String key, String value)
ErrorCode driverGetMessageQueue (Driver driver, MessageQueue *queue)
ErrorCode driverReserveIrq (Driver drv, uint32 irq)
ErrorCode driverReservePort (Driver drv, uint32 port)
ErrorCode driverReserveMemory (Driver drv, uint32 port)
ErrorCode driverReserveIrqRange (Driver drv, uint32 lowest, uint32 highest)
ErrorCode driverReservePortRange (Driver drv, uint32 lowest, uint32 highest)
ErrorCode driverReserveMemoryRange (Driver drv, uint32 lowest, uint32 highest)
ErrorCode driverDestroy (Driver *driver)
ErrorCode driverItemCreateFunction (DriverItem *dItem, String name, DriverParamType returnType, uint32 numParams, DriverParam params[], DriverItemHandlerFunction func)
ErrorCode driverItemCreateParameter (DriverItem *dItem, String name, DriverParamType type, DriverItemHandlerFunction getHandler, DriverItemHandlerFunction setHandler)
ErrorCode driverItemCreateNamespace (DriverItem *dItem, String name)
ErrorCode driverItemAdd (DriverItem root, DriverItem child)
ErrorCode driverParamCreate (DriverParam *param, String name, DriverParamType type)
ErrorCode driverParamDestroy (DriverParam *param)
ErrorCode driverManagerInit (void)
ErrorCode driverManagerFinal (void)
ErrorCode driverManagerAdd (Driver driver)
ErrorCode driverManagerRemove (Driver driver)
ErrorCode driverManagerShowTree (void)
ErrorCode driverContextCreate (DriverContext *dc, String url)
ErrorCode driverContextExecute (DriverContext dc, String url)
ErrorCode driverContextTraverse (DriverContext *to, DriverContext from, String url)
ErrorCode driverContextDestroy (DriverContext *dc)

Detailed Description

This file defines the interface for creating and using drivers

This specification must be general enough to allow easy use of the drivers both from a programmers perspective, and from a user's perspective (from the command prompt). Not only should the user have full control over every aspect of the driver, but it should be clean and easy to do so, like the following command lines:

 echo < device.serial(0)                    <- read point from function call
 cp myFile device.printer(1)                <- write point from function call
 device.video.setResolution(320,240,32)     <- function call (noAccess)
 echo < device.video.getWidth()             <- function call (noAccess)
 

Define Documentation

#define DRIVER_ITEM_MAX_LENGTH   (64)
 

The maximum length that a DriverItem's name can be (including null character)

Definition at line 44 of file driver.h.


Typedef Documentation

typedef struct _Driver* Driver
 

Definition at line 47 of file driver.h.

typedef struct _DriverContext * DriverContext
 

typedef ErrorCode(* DriverFinalFunction)(Driver drv)
 

Definition at line 52 of file driver.h.

typedef ErrorCode(* DriverInitFunction)(Driver drv)
 

Definition at line 51 of file driver.h.

typedef struct _DriverItem* DriverItem
 

Definition at line 46 of file driver.h.

typedef DriverVariable(* DriverItemHandlerFunction)(Driver driver, DriverVariable vars[])
 

Definition at line 88 of file driver.h.

typedef struct _DriverParam * DriverParam
 

typedef enum _DriverParamType DriverParamType
 

typedef union _DriverVariable DriverVariable
 


Enumeration Type Documentation

enum _DriverParamType
 

Enumerator:
DriverParamVoid 
DriverParamCharacter 
DriverParamString 
DriverParamStringUtf 
DriverParamInteger64 
DriverParamInteger32 
DriverParamInteger16 
DriverParamInteger8 
DriverParamUnsignedInteger64 
DriverParamUnsignedInteger32 
DriverParamUnsignedInteger16 
DriverParamUnsignedInteger8 
DriverParamBoolean 
DriverParamPointer 

Definition at line 54 of file driver.h.


Function Documentation

ErrorCode driverContextCreate DriverContext dc,
String  url
 

TODO: move to driverContext.[c,h]

ErrorCode driverContextDestroy DriverContext dc  ) 
 

ErrorCode driverContextExecute DriverContext  dc,
String  url
 

TODO: devise method of passing params in (other then just string?) and out (pointer to ret?)

ErrorCode driverContextTraverse DriverContext to,
DriverContext  from,
String  url
 

ErrorCode driverCreate Driver driver  ) 
 

ErrorCode driverCreateFromObject Driver driver,
Object  object
 

ErrorCode driverDestroy Driver driver  ) 
 

ErrorCode driverGetMessageQueue Driver  driver,
MessageQueue queue
 

ErrorCode driverItemAdd DriverItem  root,
DriverItem  child
 

ErrorCode driverItemCreateFunction DriverItem dItem,
String  name,
DriverParamType  returnType,
uint32  numParams,
DriverParam  params[],
DriverItemHandlerFunction  func
 

TODO: move to driverItem.[h,c]

ErrorCode driverItemCreateNamespace DriverItem dItem,
String  name
 

ErrorCode driverItemCreateParameter DriverItem dItem,
String  name,
DriverParamType  type,
DriverItemHandlerFunction  getHandler,
DriverItemHandlerFunction  setHandler
 

ErrorCode driverManagerAdd Driver  driver  ) 
 

ErrorCode driverManagerFinal void   ) 
 

ErrorCode driverManagerInit void   ) 
 

TODO: move to driverManager.[c,h]

ErrorCode driverManagerRemove Driver  driver  ) 
 

ErrorCode driverManagerShowTree void   ) 
 

Debug function...

ErrorCode driverParamCreate DriverParam param,
String  name,
DriverParamType  type
 

TODO: mode to driverParam.[h,c]

ErrorCode driverParamDestroy DriverParam param  ) 
 

ErrorCode driverReserveIrq Driver  drv,
uint32  irq
 

ErrorCode driverReserveIrqRange Driver  drv,
uint32  lowest,
uint32  highest
 

ErrorCode driverReserveMemory Driver  drv,
uint32  port
 

ErrorCode driverReserveMemoryRange Driver  drv,
uint32  lowest,
uint32  highest
 

ErrorCode driverReservePort Driver  drv,
uint32  port
 

ErrorCode driverReservePortRange Driver  drv,
uint32  lowest,
uint32  highest
 

ErrorCode driverSetMetaData Driver  driver,
String  key,
String  value
 

ErrorCode driverSetRoot Driver  driver,
String  loc,
DriverItem  root
 


Generated on Wed Mar 22 20:36:34 2006 for ndk by  doxygen 1.4.4