/* Master command code used for stamping for sensor sync..  */
int32_t lsm6dsl_sh_cmd_sens_sync_set(stmdev_ctx_t *ctx, uint8_t val)
/* Master command code used for stamping for sensor sync..  */
int32_t lsm6dsl_sh_cmd_sens_sync_set(stmdev_ctx_t *ctx, uint8_t val)
{
  lsm6dsl_master_cmd_code_t master_cmd_code;
  int32_t ret;
  ret = lsm6dsl_read_reg(ctx, LSM6DSL_MASTER_CMD_CODE,
                         (uint8_t*)&master_cmd_code, 1);
  if(ret == 0){
    master_cmd_code.master_cmd_code = val;
    ret = lsm6dsl_write_reg(ctx, LSM6DSL_MASTER_CMD_CODE,
                            (uint8_t*)&master_cmd_code, 1);
  }
  return ret;
}