IPC@CHIP® RTOS-PPC – API Documentation

Header image

Main page


int fossil_register_external_port ( int  port,
FossilExternalPortCallbacks callbacks 
)

This function registers an external port, i.e. a serial port which is handled by an external driver program. The driver program must provide several callback functions, which are called when another program accesses the assigned port number. This mechanism can be used to integrate additional real serial ports (additional UART hardware) or virtual serial ports, which are for example forwarded via USB, into the RTOS.

CAUTION: These callback functions are called in supervisor mode, so be careful when coding the handler functions.

Parameters:
port port number index: Designated port number, -1 if an arbitrary port number is to be assigned
callbacks Pointer to structure holding pointers to the several callback functions. For details see FossilExternalPortCallbacks.
Returns:
On success, port number assigned to the external port driver
-1, if the designated port number is not free or belongs to one the the RTOS' standard serial ports
-2, if the maximum number of external port drivers has already been registered.
-3, if either the argument callbacks or callbacks->unsupported_interrupt is NULL
Compatibility:
This API works slightly different than the SC1x, SC2x and SC1x3 C-Library. The FossilExternalPortCallbacks data structure has changed. Some of the old callback functions are missing and some new functions have been added.
Since:
SC2x3 V1.02 - CLIB V1.02
See also:
fossil_unregister_external_port()





Top of page | Main page

Copyright © 2017 Beck IPC GmbH
Generated on Thu Jan 26 16:21:36 2017 by Doxygen 1.6.1