reworked the uart lib to have events on lines