User manual

134
CHAPI serial line controller’s methods
CHAPI serial line controller’s methods described in class chapi_serial_device_interface, so all
CHAPI serial line controllers’ classes must be derived from the class
chapi_serial_device_interface.
chapi_serial_line_interface * line[_MAX_SERIAL_LINE_NUMBER_];
Array of CHAPI serial line pointers, instances of CHAPI serial lines.
virtual int rx_done(unsigned int len, unsigned char line_id) = 0;
Callback function, serial line must call serial line controller’s callback function rx_done(...) to
notify controller about received data. So CHAPI serial line controller understand that
CHAPI serial line has received data and must call CHAPI serial line’s method
get_rx_char(…) to obtain received data. Simple wrapper is implemented in class
chapi_serial_line_interface for calling rx_done(…) function.
len - number of received data
line_id - line number
Return:
0 - No errors
virtual int tx_done(unsigned int len, unsigned char line_id) = 0;
Callback function, serial line must call serial line controller’s callback function tx_done(...) to
notify controller about completion of send operation (initiated by calling CHAPI serial line’s
method do_tx(…)). Simple wrapper is implemented in class chapi_serial_line_interface for
calling this function.
len - number of sent data
line_id - line number
Return:
0 - No errors
virtual int get_tx_char(unsigned char & from_buf, unsigned char line_id) = 0;
Callback function, serial line must call serial line controller’s callback function get_tx_char(...)
to get data for transmission from serial line controller’s TX buffer, CHAPI serial line