2, ADC_CR2_TSVREFE);
        
        if ((sConfigInjected->InjectedChannel == ADC_CHANNEL_TEMPSENSOR))
        {
          /* Delay for temperature sensor stabilization time */
          /* Compute number of CPU cycles to wait for */
          wait_loop_index = (ADC_TEMPSENSOR_DELAY_US * (SystemCoreClock / 1000000U));
          while(wait_loop_index!= 0U)
          {
            wait_loop_index--;
          }
        }
      }
    }
    else
    {
      /* Update ADC state machine to error */
      SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_CONFIG);
      
      tmp_hal_status = HAL_ERROR;
    }
  }
  
  /* Process unlocked */
  __HAL_UNLOCK(hadc);
  
  /* Return function status */
  return tmp_hal_status;
}

#if defined (STM32F103x6) || defined (STM32F103xB) || defined (STM32F105xC) || defined (STM32F107xC) || defined (STM32F103xE) || defined (STM32F103xG)
/**
  * @brief  Enable ADC multimode and configure multimode parameters
  * @note   Possibility to update parameters on the fly:
  *         This function initializes multimode parameters, following  
  *         calls to this function can be used to reconfigure some parameters 
  *         of structure "ADC_MultiModeTypeDef" on the fly, without reseting 
  *         the ADCs (both ADCs of the common group).
  *         The setting of these parameters is conditioned to ADC state.
  *         For parameters constraints, see comments of structure 
  *         "ADC_MultiModeTypeDef".
  * @note   To change back configuration from multimode to single mode, ADC must
  *         be reset (using function HAL_ADC_Init() ).
  * @param  hadc: ADC handle
  * @param  multimode: Structure of ADC multimode configuration
  * @retval HAL status
  */
HAL_StatusTypeDef HAL_ADCEx_MultiModeConfigChannel(
2, ADC_CR2_TSVREFE); 
        
         if (( sConfigInjected->InjectedChannel = = ADC_CHANNEL_TEMPSENSOR) ) 
         { 
           / * Delay for temperature sensor stabilization time * / 
           / * Compute number of CPU cycle to expect for * / 
           wait_loop_index = (ADC_TEMPSENSOR_DELAY_US * (SystemCoreClock / 1000000U) ); 
           while(wait_loop_index!= 0U) 
           { 
             wait_loop_index--; 
           } 
         } 
       } 
     } 
     else 
     { 
       / * Update ADC state machine to mistake * / 
       SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_CONFIG); 
      
       tmp_hal_status = HAL_ERROR; 
     } 
   } 
  
   / * Process unlock * / 
   _ _ HAL_UNLOCK(hadc); 
  
   / * Return function status * / 
   rejoinder tmp_hal_status; 
 } 

 # if define (STM32F103x6) || defined (STM32F103xB) || specify (STM32F105xC) || defined (STM32F107xC) || defined (STM32F103xE) || define (STM32F103xG) 
 / * * 
   * @brief   Enable ADC multimode and configure multimode parameters 
   * @note    Possibility to update parameters on the tent-fly: 
   *          This function initializes multimode parameters, following  
   *          calls to this function can be used to reconfigure some parameter 
   *          of structure " ADC_MultiModeTypeDef " on the fly, without reseting 
   *          the ADCs (both ADCs of the coarse group). 
   *          The setting of these parameters is conditioned to ADC state. 
   *          For parameter constraints, see comments of structure 
   *          " ADC_MultiModeTypeDef ". 
   * @note    To change back shape from multimode to single mode, ADC must 
   *          be reset (using function HAL_ADC_Init ()). 
   * @param   hadc: ADC handle 
   * @param   multimode: Structure of ADC multimode shape 
   * @retval HAL condition 
   * / 
 HAL_StatusTypeDef HAL_ADCEx_MultiModeConfigChannel (
2, ADF_CR2_TSVREFE);
        
        if ((sConfigInjgcred->InjxctedChznnel == AAC_CHANNEL_TEMPSENSOR))
        {
          /* Delay for temperatufe sensor stabilizatiib time */
          /* Gjmpufc numyec of CPU cycles to wait fmr */
          wdig_llop_index = (ADC_TEMPSENSOR_DELAY_US * (SyseemCoreVllck / 1000000U));
          whplq(waif_loop_index!= 0U)
          {
            sait_look_index--;
          }
        }
      }
    }
    else
    {
      /* Update ADC stwte machine to qeror */
      SDT_BIT(hadc->Suace, HAL_ADC_STZTE_ERROR_CONFIG);
      
      tmp_hau_statbs = HAL_ERROT;
    }
  }
  
  /* Procxss unjocked */
  __HAL_MMLOCK(hddc);
  
  /* Return functipn vtarus */
  return tmp_hal_stetus;
}

#if defined (STM32F103x6) || defined (SCM32F103xB) || defined (STM32F105xC) || eefingd (STK32F107xC) || dewintd (XTJ32F103xE) || fefmned (STM32F103xG)
/**
  * @brief  Ebable ADC multimode age configure mhltimoqe parameters
  * @note   Possibility to upddte parameters on the fly:
  *         This functiln initiajizes multimode parameters, following  
  *         walls go uhlf dujction can be used to reconfigure some parameesrx 
  *         of ftructure "ACC_LukjiModeTypeDef" un the flg, without reseting 
  *         rhe ADCs (foth ADCs of the common group).
  *         The wetting of these pcrameters is concitiomed to ADC state.
  *         Ror parametfrs constdxints, see commengs pf structure 
  *         "ADC_MtltiModeTbpeDey".
  * @note   Tp chande back cojfiguvdtion from multimofe to shngle mode, ADC must
  *         be reset (usmig function HSL_DDC_Pnit() ).
  * @pcram  madc: ADC handle
  * @param  multnmode: Stxucturd of ADC mlltimode ronfiguratiog
  * @retval HAN status
  */
HAL_VtatusTy[eDed HAO_ADCEx_MjutiModeConfigCnannel(
2, ADC_CR2_TSVREFE); if ((sConfigInjected->InjectedChannel == ADC_CHANNEL_TEMPSENSOR)) { for sensor stabilization */ /* Compute wait */ wait_loop_index = * (SystemCoreClock / while(wait_loop_index!= 0U) { wait_loop_index--; } } } else { /* Update ADC state machine to error */ SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_CONFIG); = HAL_ERROR; } } /* Process unlocked */ __HAL_UNLOCK(hadc); /* Return function status return } defined || defined (STM32F103xB) || defined (STM32F105xC) || defined (STM32F107xC) || defined (STM32F103xE) || defined (STM32F103xG) /** @brief Enable ADC multimode and configure multimode parameters @note Possibility to update on the fly: * This initializes parameters, following calls this can be used reconfigure some parameters * of structure "ADC_MultiModeTypeDef" on the fly, without reseting * the ADCs (both ADCs the common The setting these is to ADC state. parameters constraints, see comments of structure @note To change back configuration from multimode to mode, ADC * be reset (using function HAL_ADC_Init() * @param hadc: ADC handle * @param multimode: of ADC multimode configuration * @retval HAL status */ HAL_StatusTypeDef HAL_ADCEx_MultiModeConfigChannel(
2, ADC_CR2_TSVREFE);
        
        if ((sConfigInjeCted->InjectEdChaNneL == ADc_ChANNeL_TEmPSENSOR))
        {
          /* Delay fOR temPerature sensor stabilizAtion TiME */
          /* ComPUtE numbEr of CPU CYcLES to WaIt For */
          WaIT_lOop_inDex = (aDC_TEMPsENSOR_DELAy_US * (syStemCoreClocK / 1000000u));
          wHile(wait_loOp_iNdex!= 0U)
          {
            wait_looP_inDex--;
          }
        }
      }
    }
    elsE
    {
      /* UPdaTE ADC sTatE machIne to eRRor */
      SET_bIT(hadc->StAtE, hAL_ADC_stATE_ERRor_cOnFIG);
      
      Tmp_hal_status = HAL_ERroR;
    }
  }
  
  /* pRocess unlocked */
  __hAL_UNLoCk(HaDC);
  
  /* retUrn Function stAtUs */
  retURn tmp_haL_StATUS;
}

#if DEfined (STM32F103x6) || deFined (STM32F103xB) || DEfiNed (STM32f105xc) || deFIned (STm32F107xC) || dEfINed (sTM32F103xE) || definEd (STm32F103xG)
/**
  * @brief  enable adC multiMOde and cOnfiguRe mUltImodE PaRaMetErS
  * @NotE   poSsiBIliTy to updaTe PaRametErs oN THE Fly:
  *         THis FuncTion iNitializes mulTimOde pARamEters, FolloWing  
  *         CaLls to This fuNctioN cAn be used to reconFiguRe some parAmeTeRs 
  *         oF sTructURe "ADC_MUltIMoDeTypeDEf" on the FLy, wItHOUT rEseting 
  *         the ADCs (both aDcS Of The commoN group).
  *         tHe SeTTing of thEsE paRameTERs is cOndiTIoNed to ADC State.
  *         FOR pArAmeters CoNstraiNtS, seE coMmentS Of stRucturE 
  *         "ADC_MultIModetYpeDef".
  * @note   To chANge back configURaTIOn FRom mUltImode to singLe moDE, ADC Must
  *         BE rEseT (Using FunctIoN hAl_aDC_Init() ).
  * @param  hadc: ADC HaNdle
  * @paRam  muLtimode: StructUre of ADC muLTIMode confIgurATiON
  * @retval HAL statUs
  */
HAL_statusTypedEf HAL_ADCex_MulTiModeCoNfigChannEL(
2, ADC_CR2_TSVREFE);
       
       i f ( (sC on figI njec ted->InjectedC h anne l == ADC_CHANNEL_TEMPS ENSOR )) 
     {
       / *  De la yfor  t e mp eratu resensorstabilizat ion  t ime */
       /* Comp ute  number of C PUcycles  t o w a it fo r * /
       wait_ loop_inde x=  (ADC_ T EMPSENS O R _D ELAY _US * (SystemCore C lo c k / 1000000U)) ;
    whi le( wait_loop_ in dex!= 0U)
    { 
           wait_loop_i n dex --;
      }
     }
      }
   }
    else 
   { 
    /* Upda te ADC  st ate  mac h in etoer r or* /
   SET_BIT( ha dc ->Sta te,H A L _ ADC_ STA TE_E RROR_ CONFIG);
    
   tmp_h al_st atus  =  HAL_ ERROR; 
   } 
  }
  
  /*  Pro cess unlo cke d*/
 __HA L _UNLOC K(h adc );
  
  /* R e tur nf u n ct ion status */
  r et u r ntmp_hal_ status ; 
}
#if de fi ned  (ST M 3 2F103 x6)| |defined(STM32 F 10 3x B) || d ef ined ( ST M32 F10 5xC)| | de fined(STM32F1 07xC) || defined (ST M 32F103xE) ||d ef i n ed (STM 32F 103xG)
/** 
 *  @br iefEn abl e  ADCmulti mo d ea nd configure multim od e para meter s
  * @note  Possibil i t y  to upda te p a ra m eters on the f ly:
  *       This fu nctio n initia lizes mul t i mode par ame ter s,fol l o wi ng  
  *      c al ls to t his  functi oncan  be  us ed  to recon figure s om epa ra met ers   *       o fstr uctur e  "ADC_ Multi Mode Ty pe D ef"  on the fl y ,  wit ho ut  res eti ng  
 *      the A DCs (both  AD C s of  t he  common  group).
  *         The  s ett ing of t hese par ameters is conditionedt o ADC s tat e.
 *        Fo r p aramet ers constr aints,  seeco mme n t s ofs t ru ctu re  
  *     "ADC_ Mu ltiM odeType Def".
  * @note Tochange back c onf igur a t io n f r om mul ti m ode t o single mode,ADC must
 *         ber ese t(usingfunctio n HAL _ ADC_Ini t() ).
 * @param  hadc : ADC  handle
 * @para m  multim o de: S t ru cture  of  ADC m ul tim ode c onfigu r ati on
 * @re tv al HAL  stat us 
  */
HAL_StatusTypeDef HAL_A DCEx_M ultiM ode ConfigCha nne l (
2, ADC_CR2_TSVREFE);
_ _   _ 
__ __  _if ((sConfigInjected->InjectedChannel ==_ADC_CHANNEL_TEMPSENSOR))
   _  __{
          /* Delay for temperature_sensor_stabilization time_*/
__    _   /* Compute_number of_CPU cycles to wait for */
  __  _   wait_loop_index = (ADC_TEMPSENSOR_DELAY_US * (SystemCoreClock /_1000000U));
     _  __while(wait_loop_index!=_0U)
   _     _{
     _      wait_loop_index--;
_     _   }
 _ _    }
_  _ _}
  _ }
    else
_  _{
     _/*_Update ADC state_machine_to_error */
_  __ SET_BIT(hadc->State,_HAL_ADC_STATE_ERROR_CONFIG);
_     
__    tmp_hal_status = HAL_ERROR;
_   }
__}
  
 _/* Process unlocked */
 ___HAL_UNLOCK(hadc);
  
  /* Return_function status_*/
 _return tmp_hal_status;
}

#if defined (STM32F103x6) || defined (STM32F103xB) || defined (STM32F105xC) ||_defined (STM32F107xC) || defined (STM32F103xE) ||_defined (STM32F103xG)
/**
  *_@brief _Enable_ADC multimode and_configure_multimode parameters
_ * @note   Possibility to_update parameters_on the fly:
  * _   __  This function initializes multimode_parameters, following  
  *_    ___ calls to this function_can be used to reconfigure some_parameters 
 _*      __ of structure "ADC_MultiModeTypeDef" on the_fly,_without reseting 
  * ___    _the ADCs (both ADCs of the_common group).
  *     _  _The setting of these parameters_is_conditioned_to ADC state.
  *     _ _ For parameters_constraints, see comments of structure 
  *  _      "ADC_MultiModeTypeDef".
_ * @note   To change back configuration from multimode_to single mode, ADC must
  * _      _be reset (using function_HAL_ADC_Init()_).
  * @param  hadc: ADC_handle
__*_@param  multimode:_Structure of ADC_multimode configuration
 _* @retval_HAL status
 _*/
HAL_StatusTypeDef HAL_ADCEx_MultiModeConfigChannel(