It could go into the utils library perhaps?  I found it useful when porting the arduino style init to pure C.