added read and write GPIO functions