コード例 #1
0
ファイル: usb_lld.c プロジェクト: DTFUHF/TauLabs
static void otg_core_reset(USBDriver *usbp) {
  stm32_otg_t *otgp = usbp->otg;

  halPolledDelay(32);

  /* Core reset and delay of at least 3 PHY cycles.*/
  otgp->GRSTCTL = GRSTCTL_CSRST;
  while ((otgp->GRSTCTL & GRSTCTL_CSRST) != 0)
    ;

  halPolledDelay(12);

  /* Wait AHB idle condition.*/
  while ((otgp->GRSTCTL & GRSTCTL_AHBIDL) == 0)
    ;
}
コード例 #2
0
ファイル: usb_lld.c プロジェクト: DTFUHF/TauLabs
static void otg_txfifo_flush(USBDriver *usbp, uint32_t fifo) {
  stm32_otg_t *otgp = usbp->otg;

  otgp->GRSTCTL = GRSTCTL_TXFNUM(fifo) | GRSTCTL_TXFFLSH;
  while ((otgp->GRSTCTL & GRSTCTL_TXFFLSH) != 0)
    ;
  /* Wait for 3 PHY Clocks.*/
  halPolledDelay(12);
}
コード例 #3
0
/**
 * @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));
}
コード例 #4
0
ファイル: board.c プロジェクト: CInsights/stm32
void mac_phy_reset(void){
  palSetPad(GPIOD, GPIOD_EPHY_NRST);
  halPolledDelay(BOARD_PHY_HARD_RESET_DELAY);
  /* PHY soft reset procedure.*/
  mii_write(&ETHD1, MII_BMCR, BMCR_RESET);
  while (mii_read(&ETHD1, MII_BMCR) & BMCR_RESET)
    ;
  mii_write(&ETHD1, PHYCTRL2, mii_read(&ETHD1, PHYCTRL2) | RMII_RCLKSEL);
}
コード例 #5
0
static void otg_core_reset(USBDriver *usbp) {
  stm32_otg_t *otgp = usbp->otg;

  //FIXME: Makes things work for me, otherwise hangs on following loop.
  chThdSleepMilliseconds(1);

  /* Core reset and delay of at least 3 PHY cycles.*/
  otgp->GRSTCTL = GRSTCTL_CSRST;
  while ((otgp->GRSTCTL & GRSTCTL_CSRST) != 0)
    ;
  halPolledDelay(12);
  /* Wait AHB idle condition.*/
  while ((otgp->GRSTCTL & GRSTCTL_AHBIDL) == 0)
    ;
}
コード例 #6
0
ファイル: codec_CS43L22.c プロジェクト: ADTL/ARMWork
void codec_hw_reset(void)
{
	palClearPad(GPIOD, GPIOD_RESET);
	halPolledDelay(MS2RTT(10));
	palSetPad(GPIOD, GPIOD_RESET);
}