/**
 * @brief   Enables the ADC voltage regulator.
 *
 * @param[in] adcp      pointer to the @p ADCDriver object
 */
static void adc_lld_vreg_on(ADCDriver *adcp) {

  adcp->adcm->CR = 0;   /* RM 12.4.3.*/
  adcp->adcm->CR = ADC_CR_ADVREGEN_0;
#if STM32_ADC_DUAL_MODE
  adcp->adcs->CR = ADC_CR_ADVREGEN_0;
#endif
  halPolledDelay(US2RTT(10));
}
Example #2
0
// This function is, in this form, only for debugging. Later, it may
// be used when the RPM is controlled by a PID.
extern void bldcSetRPM (uint32_t rpm) {
  uint32_t uspc;  // us pr Commutations

  uspc = (1000000*60 / (rpm*bldc.stateCount));
  bldc.stateChangeInterval = US2RTT(uspc);
}