01.06.2013 Views

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Top of list<br />

Index page<br />

send queue.<br />

This function reports the number of bytes currently in the UART transmit hardware. By adding this<br />

function's return value to the software transmit buffer byte count reported by the GetDriverInfo API, you<br />

can determine the total number of transmit data bytes still pending output.<br />

The maximum count returned here will be 2 bytes, accounting for the UART's transmit shift register (1<br />

byte) and transmit holding register (1 byte).<br />

Interrupt 0x14 service 0xA1: Install a Fossil User Callback Function<br />

Parameters<br />

AH<br />

DX<br />

ES:DI<br />

The user callback function will be called when a Fossil serial port event occurs.<br />

0xA1<br />

Comments<br />

Port number: 0 for EXT, 1 for COM<br />

Pointer to the User Callback function<br />

This call installs an user callback function for the specified serial port. The callback function must be<br />

very short! Long Fossil callback functions can lead to character loss.<br />

To use the Fossil callback functions, you have to switch the serial port into the IRQ Mode (see<br />

CHIP.INI). In DMA mode the callback functions will not work!<br />

The callback function must conform to this prototype:<br />

fossil_event_t far *(huge my_fossil_callback)(<br />

fossil_event_t far *e ) ;<br />

The fossil_event_t structure e passed in contains the event which has occurred. Following events<br />

are possible:<br />

#define FE_DATA_AVAIL 0x01 // New Data Received<br />

#define FE_READY_FOR_SEND 0x02 // (currently not supported)<br />

#define FE_ERROR_DETECTED 0x10 // (currently not supported)<br />

Newly received data_length bytes can be found at location referenced by data pointer in structure e.<br />

The callback function can also return a fossil_event_t structure. The returned structure contains an<br />

action event which the Fossil serial port driver will respond to as follows:<br />

#define FE_IGNORE_DATA 0x01 // Do not copy the received data<br />

// into the receive queue.<br />

#define FE_DATA_TO_SEND 0x02 // (currently not supported)<br />

If the callback does not return any event, the return value must be a null pointer (=0L).<br />

Page 341 / 400

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!