Since i2c_1 i2c_write_regs is cpu specific reg endianess must be swapped there Change reg from little endian to big endian