Add write support to registers

Signed-off-by: Thommy Jakobsson <thommyj@gmail.com>