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.
|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.|
- 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
- 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.
- SC2x3 V1.02 - CLIB V1.02
- See also: