dm: core: Add a function to read into a unsigned int