Dallas Semiconductor DS80C400 C Libraries Home Page

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

rom400_useriopoll.h File Reference


Detailed Description

User IO Poll registration routines for the DS80C400 ROM.

This library contains functions to register User IO Poll routines. User IO Poll routines are called at least every 4 milliseconds by the system task scheduler. These allow programs to put their applications to sleep while waiting for input, and register a polling routine that will be called to check for that input. The sleeping process can then be signalled to wake up from the polling routine.

For detailed information on the DS80C400 please see the High-Speed Microcontroller User's Guide: DS80C400 Supplement.

The functions in this library are multi-process safe--that is, if you call the same method from two different processes at the same time, the parameters to the function are preserved, and the function should execute correctly.

Go to the source code of this file.

Defines

#define ROM400_USERIOPOLL_VERSION   1

Functions

unsigned char useriopoll_isinstalled (void)
 Checks to see if the User IO Poll library has already been initialized.
void useriopoll_init (unsigned char num_routines)
 Initializes the User IO Poll library.
unsigned char useriopoll_registerpollroutine (void *funct, unsigned char number)
 Registers an IO Poll routine.
unsigned char useriopoll_removepollroutine (unsigned char number)
 Removes a registered IO Poll routine.
void * useriopoll_getpollroutine (unsigned char number)
 Gets the address of a registered IO Poll routine.
unsigned char useriopoll_getlistsize (void)
 Returns the number of polling routines allowed.
unsigned int useriopoll_version (void)
 Returns the version number of this User IO Poll library.


Define Documentation

#define ROM400_USERIOPOLL_VERSION   1
 

Version number associated with this header file. Should be the same as the version number returned by the useriopoll_version function.

See also:
useriopoll_version


Function Documentation

unsigned char useriopoll_getlistsize void   ) 
 

Returns the number of polling routines allowed.

Returns the size of the internal array that holds the registered polling routines. This is the same as the number of entries that this library was initialized for. This number can be considered the bounds of valid indexes for the useriopoll_getpollroutine, useriopoll_removepollroutine, and useriopoll_registerpollroutine functions.

Returns:
Size of the list of polling routines.
See also:
useriopoll_init

useriopoll_registerpollroutine

useriopoll_getpollroutine

useriopoll_removepollroutine

void* useriopoll_getpollroutine unsigned char  number  ) 
 

Gets the address of a registered IO Poll routine.

Gets the address of an entry in the list of registered IO Poll routines. If no entry exists in the list at this location, this function returns NULL.

Parameters:
number location in the list of polling routines to clear
Returns:
address of the registered IO Poll routine, or NULL if no routine exists at that position in the list
See also:
useriopoll_init

useriopoll_registerpollroutine

useriopoll_removepollroutine

void useriopoll_init unsigned char  num_routines  ) 
 

Initializes the User IO Poll library.

Initializes memory space required by the User IO Poll library. The argument should be the maximum number of IO Poll routines that will be needed by the library. Internally, this is represented by an array of function pointers. Every 4 milliseconds (or more often), all the function pointers in the array are invoked (if they have been set). Therefore, it is in an application's best interest to make this number the lowest possible to reduce overhead.

The functions registered as IO Poll routines should not destroy any registers aside from the following: psw, acc, dptr0. All other registers should be preserved.

Parameters:
num_routines number of IO Poll routines that can be registered
See also:
useriopoll_isinstalled

useriopoll_registerpollroutine

unsigned char useriopoll_isinstalled void   ) 
 

Checks to see if the User IO Poll library has already been initialized.

Checks to see if the useriopoll_init function has already been called. This function allows libraries to determine if they need to initialize this library or not.

Returns:
0 if the library has not been initialized, 1 if it has
See also:
useriopoll_init

unsigned char useriopoll_registerpollroutine void *  funct,
unsigned char  number
 

Registers an IO Poll routine.

Registers the given IO Poll routine to be called by the task scheduler. The function will be installed in the list of functions at the position defined by number, even if a function already exists at that location.

Parameters:
funct function pointer of the IO Poll routine
number location in the list of polling routines to place this function
Returns:
0 if the operation was successful, 1 if number was out of bounds
See also:
useriopoll_init

useriopoll_removepollroutine

useriopoll_getpollroutine

unsigned char useriopoll_removepollroutine unsigned char  number  ) 
 

Removes a registered IO Poll routine.

Removes an entry in the list of registered IO Poll routines. If no entry exists in the list at this location, this function has no effect.

Parameters:
number location in the list of polling routines to clear
Returns:
0 if the operation was successful, 1 if number was out of bounds
See also:
useriopoll_init

useriopoll_registerpollroutine

useriopoll_getpollroutine

unsigned int useriopoll_version void   ) 
 

Returns the version number of this User IO Poll library.

Returns:
Version number of this User IO Poll library.


Copyright 2005 Dallas Semiconductor, Inc.. Documentation generated by Doxygen.