added ability to read registers, and added nice define mappings