Add control register enum
Default state machine enums to integer type
Use postincrement operator for loops and fix a few cases where AUTOWIRE is choking on enums