Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages   Examples  

Keysadds


Data Structures

struct  _KEYSDCB

Defines

#define CHAR_CHECK_TIME   100
#define CHAR_REPEAT_TIME   800
#define A   1
#define B   2
#define C   3
#define D   4
#define E   5

Typedefs

typedef _KEYSDCB KEYSDCB

Functions

char getK (void)
char getKey (void)

Variables

NUTDEVICE devKeys0

Detailed Description

This module is designed for managing keys contecetd to procesor port. This driver is a stream device. Driver contains thread, which scans port with defined freuqency and when port status != 0xff put this port status to buffer. You can read from this device using stream functions.

Define Documentation

#define A   1
 

Constant defines that keys is connected to PORTA. Use it as a device address in InitNutDevice function.

#define B   2
 

Constant defines that keys is connected to PORTB. Use it as a device address in InitNutDevice function.

#define C   3
 

Constant defines that keys is connected to PORTC. Use it as a device address in InitNutDevice function.

#define CHAR_CHECK_TIME   100
 

Defines key scan delay

#define CHAR_REPEAT_TIME   800
 

Defines key repeat time.

#define D   4
 

Constant defines that keys is connected to PORTD. Use it as a device address in InitNutDevice function.

#define E   5
 

Constant defines that keys is connected to PORTE. Use it as a device address in InitNutDevice function.


Typedef Documentation

typedef struct _KEYSDCB KEYSDCB
 

Device control block for keys driver. Required for NUT device driver.


Function Documentation

char getK void   
 

Read key from buffer Key - it's the port value scaned by driver thread. Methods block user thread if key buffor is empty.

Returns:
key from buffor.
Examples:
adds/app/keys.

char getKey void   
 

Read key from buffer Key - it's the port value scaned by driver thread. Methods don't block user thread if key buffer is empty.

Returns:
key from buffer if buffer isn't empty -1 when buffor is empty.
Examples:
adds/app/keys.


Variable Documentation

NUTDEVICE devKeys0
 

Driver control structure.


Generated on Thu Jan 30 22:30:56 2003 for EduNet by doxygen1.2.18