add W/R subfunctions for flash programming