/* Set the IIS2MDC magnetometer sensor output data rate.  */
int32_t IIS2MDC_MAG_SetOutputDataRate(IIS2MDC_Object_t *pObj, float Odr)
/* Set the IIS2MDC magnetometer sensor output data rate.  */
int32_t IIS2MDC_MAG_SetOutputDataRate(IIS2MDC_Object_t *pObj, float Odr)
{
  iis2mdc_odr_t new_odr;
  new_odr = (Odr <= 10.000f) ? IIS2MDC_ODR_10Hz
            : (Odr <= 20.000f) ? IIS2MDC_ODR_20Hz
            : (Odr <= 50.000f) ? IIS2MDC_ODR_50Hz
            :                    IIS2MDC_ODR_100Hz;
  if (iis2mdc_data_rate_set(&(pObj->Ctx), new_odr) != IIS2MDC_OK)
  {
    return IIS2MDC_ERROR;
  }
  return IIS2MDC_OK;
}