/* Software reset. Restore the default values in user registers.  */
int32_t lsm6dsl_reset_set(stmdev_ctx_t *ctx, uint8_t val)
/* Software reset. Restore the default values in user registers.  */
int32_t lsm6dsl_reset_set(stmdev_ctx_t *ctx, uint8_t val)
{
  lsm6dsl_ctrl3_c_t ctrl3_c;
  int32_t ret;
  ret = lsm6dsl_read_reg(ctx, LSM6DSL_CTRL3_C, (uint8_t*)&ctrl3_c, 1);
  if(ret == 0){
    ctrl3_c.sw_reset = val;
    ret = lsm6dsl_write_reg(ctx, LSM6DSL_CTRL3_C, (uint8_t*)&ctrl3_c, 1);
  }
  return ret;
}