serial: add skeleton functions
serial: move common headers to serial.c