Careful, this function overwrites all other values in Ctrl register 4. So you still have to read the reg values before the write on line 469.