add peripheral code