/* Enables offset cancellation in single measurement mode. The OFF_CANC bit must be set to 1 when enabling offset cancellation in single measurement mode this means a call function "set_rst_mode(SENS_OFF_CANC_EVERY_ODR)" is need..  */
int32_t iis2mdc_set_rst_sensor_single_set(stmdev_ctx_t *ctx, uint8_t val)
/* Enables offset cancellation in single measurement mode. The OFF_CANC bit must be set to 1 when enabling offset cancellation in single measurement mode this means a call function "set_rst_mode(SENS_OFF_CANC_EVERY_ODR)" is need..  */
int32_t iis2mdc_set_rst_sensor_single_set(stmdev_ctx_t *ctx, uint8_t val)
{
  iis2mdc_cfg_reg_b_t reg;
  int32_t ret;
  ret = iis2mdc_read_reg(ctx, IIS2MDC_CFG_REG_B, (uint8_t *) &reg, 1);
  if (ret == 0) {
    reg.off_canc_one_shot = val;
    ret = iis2mdc_write_reg(ctx, IIS2MDC_CFG_REG_B, (uint8_t *) &reg, 1);
  }
  return ret;
}