Added serial interrupt handlers, write and read functions