T-Kernel Specification (1.B0.02)
T-Kernel Specification (1.B0.02)
T-Kernel Specification (1.B0.02)
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
5.3. DEVICE MANAGEMENT FUNCTIONS 245<br />
See the screen driver specification for details.<br />
5.3.6 Device Event Notification<br />
A device driver sends events occurring in devices to the event notification message buffer (TDN EVENT)<br />
as device event notification. The system default event notification message buffer is designated at the<br />
time of device registration, but can be changed later. The system default event notification message<br />
buffer is defined in TDEvtMbfSz in system configuration information.<br />
The following event types are defined.<br />
typedef enum tdevttyp {<br />
TDE_unknown = 0, /* undefined */<br />
TDE_MOUNT = 0x01, /* media mounted */<br />
TDE_EJECT = 0x02, /* media ejected */<br />
TDE_ILLMOUNT = 0x03, /* media illegally mounted */<br />
TDE_ILLEJECT = 0x04, /* media illegally ejected */<br />
TDE_REMOUNT = 0x05, /* media remounted */<br />
TDE_CARDBATLOW = 0x06, /* card battery alarm */<br />
TDE_CARDBATFAIL = 0x07, /* card battery failure */<br />
TDE_REQEJECT = 0x08, /* media eject request */<br />
TDE_PDBUT = 0x11, /* PD button state change */<br />
TDE_PDMOVE = 0x12, /* PD move */<br />
TDE_PDSTATE = 0x13, /* PD state change */<br />
TDE_PDEXT = 0x14, /* PD extended event */<br />
TDE_KEYDOWN = 0x21, /* key down */<br />
TDE_KEYUP = 0x22, /* key up */<br />
TDE_KEYMETA = 0x23, /* meta key state change */<br />
TDE_POWEROFF = 0x31, /* power switch off */<br />
TDE_POWERLOW = 0x32, /* low power alarm */<br />
TDE_POWERFAIL = 0x33, /* power failure */<br />
TDE_POWERSUS = 0x34, /* auto suspend */<br />
TDE_POWERUPTM = 0x35, /* clock update */<br />
TDE_CKPWON = 0x41 /* auto power on notification */<br />
} TDEvtTyp;<br />
Device events are notified in the following format. The contents of event notification and size differ with<br />
each event type.<br />
typedef struct t_devevt {<br />
TDEvtTyp evttyp; /* event type */<br />
/* Information specific to each event type is appended here. */<br />
} T_DEVEVT;<br />
The format of device event notification with device ID is as follows.<br />
typedef struct t_devevt_id {<br />
TDEvtTyp evttyp; /* event type */<br />
ID devid; /* device ID */<br />
/* Information specific to each event type is appended here. */<br />
} T_DEVEVT_ID;<br />
Copyright c○ 2002, 2003 by T-Engine Forum<br />
T-<strong>Kernel</strong> <strong>1.B0.02</strong>