您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ CMU_ClockSelectSet函数代码示例

51自学网 2021-06-01 20:03:03
  C++
这篇教程C++ CMU_ClockSelectSet函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中CMU_ClockSelectSet函数的典型用法代码示例。如果您正苦于以下问题:C++ CMU_ClockSelectSet函数的具体用法?C++ CMU_ClockSelectSet怎么用?C++ CMU_ClockSelectSet使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了CMU_ClockSelectSet函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: rt_hw_driver_init

/***************************************************************************//** * @brief *   Initialize the hardware drivers. * * @details * * @note * ******************************************************************************/void rt_hw_driver_init(void){    CMU_ClockEnable(cmuClock_HFPER, true);    /* Enable GPIO */    CMU_ClockEnable(cmuClock_GPIO, true);    /* Enabling clock to the interface of the low energy modules */    CMU_ClockEnable(cmuClock_CORELE, true);    /* Starting LFXO and waiting until it is stable */    CMU_OscillatorEnable(cmuOsc_LFXO, true, true);	/* Select LFXO for Peripherals A */    CMU_ClockSelectSet(cmuClock_LFA,cmuSelect_LFXO);    /* Select LFXO for specified module (and wait for it to stabilize) */#if (defined(EFM32GG_USING_LEUART0) || defined(EFM32GG_USING_LEUART1))    CMU_ClockSelectSet(cmuClock_LFB, cmuSelect_LFXO);#endif    /* Enable SWO */#if defined(EFM32GG_USING_SWO)    efm_swo_setup();#endif    /* Initialize external interrupt */#ifdef EFM32GG_USING_EINT    eint_init();#endif}
开发者ID:BernardXiong,项目名称:stk3700,代码行数:40,


示例2: CAPLESENSE_setupCMU

/**************************************************************************//** * @brief  Setup the CMU *****************************************************************************/void CAPLESENSE_setupCMU(void){  /* Ensure core frequency has been updated */  SystemCoreClockUpdate();  /* Select clock source for HF clock. */  CMU_ClockSelectSet(cmuClock_HF, cmuSelect_HFRCO);  /* Select clock source for LFA clock. */  CMU_ClockSelectSet(cmuClock_LFA, cmuSelect_LFRCO);  /* Select clock source for LFB clock. */  CMU_ClockSelectSet(cmuClock_LFB, cmuSelect_Disabled);  /* Enable HF peripheral clock. */  CMU_ClockEnable(cmuClock_HFPER, 1);  /* Enable clock for GPIO. */  CMU_ClockEnable(cmuClock_GPIO, 1);  /* Enable clock for ACMP0. */  CMU_ClockEnable(cmuClock_ACMP0, 1);  /* Enable clock for ACMP1. */  CMU_ClockEnable(cmuClock_ACMP1, 1);  /* Enable CORELE clock. */  CMU_ClockEnable(cmuClock_CORELE, 1);  /* Enable clock for LESENSE. */  CMU_ClockEnable(cmuClock_LESENSE, 1);  /* Enable clock divider for LESENSE. */  CMU_ClockDivSet(cmuClock_LESENSE, cmuClkDiv_1);}
开发者ID:glocklueng,项目名称:sash-a300-lab,代码行数:31,


示例3: setupCMU

/**************************************************************************//** * @brief  Setup the CMU *****************************************************************************/void setupCMU(void){  /* Ensure core frequency has been updated */  SystemCoreClockUpdate();  /* Select clock source for HF clock. */  CMU_ClockSelectSet(cmuClock_HF, cmuSelect_HFRCO);  /* Select clock source for LFA clock. */  CMU_ClockSelectSet(cmuClock_LFA, cmuSelect_LFRCO);  /* Enable HF peripheral clock. */  CMU_ClockEnable(cmuClock_HFPER, true);  /* Enable clock for GPIO. */  CMU_ClockEnable(cmuClock_GPIO, true);  /* Enable clock for ACMP0. */  CMU_ClockEnable(cmuClock_ACMP0, true);  /* Enable clock for PRS. */  CMU_ClockEnable(cmuClock_PRS, true);  /* Enable CORELE clock. */  CMU_ClockEnable(cmuClock_CORELE, true);  /* Enable clock for PCNT. */  CMU_ClockEnable(cmuClock_PCNT0, true);  /* Enable clock on RTC. */  CMU_ClockEnable(cmuClock_RTC, true);  /* Enable clock for LESENSE. */  CMU_ClockEnable(cmuClock_LESENSE, true);  /* Set clock divider for LESENSE. */  CMU_ClockDivSet(cmuClock_LESENSE, cmuClkDiv_1);  /* Enable clock for DAC */  CMU_ClockEnable(cmuClock_DAC0, true);}
开发者ID:EnergyMicro,项目名称:EFM32WG_STK3800,代码行数:33,


示例4: clkInit

/** * @brief Initialize the system clock * * @return N/A * */static ALWAYS_INLINE void clkInit(void){#ifdef CONFIG_CMU_HFCLK_HFXO	CMU_HFXOInit(&hfxoInit);	CMU_OscillatorEnable(cmuOsc_HFXO, true, true);	CMU_ClockSelectSet(cmuClock_HF, cmuSelect_HFXO);	CMU_OscillatorEnable(cmuOsc_HFRCO, false, false);	SystemHFXOClockSet(CONFIG_CMU_HFXO_FREQ);#elif (defined CONFIG_CMU_HFCLK_LFXO)	CMU_LFXOInit(&lfxoInit);	CMU_OscillatorEnable(cmuOsc_LFXO, true, true);	CMU_ClockSelectSet(cmuClock_HF, cmuSelect_LFXO);	CMU_OscillatorEnable(cmuOsc_HFRCO, false, false);	SystemLFXOClockSet(CONFIG_CMU_LFXO_FREQ);#elif (defined CONFIG_CMU_HFCLK_HFRCO)	/*	 * This is the default clock, the controller starts with, so nothing to	 * do here.	 */#else#error "Unsupported clock source for HFCLK selected"#endif	/* Enable the High Frequency Peripheral Clock */	CMU_ClockEnable(cmuClock_HFPER, true);#ifdef CONFIG_GPIO_GECKO	CMU_ClockEnable(cmuClock_GPIO, true);#endif}
开发者ID:agatti,项目名称:zephyr,代码行数:36,


示例5: palClockSetup

/**************************************************************************//** * @brief   Setup clocks necessary to drive RTC/RTCC for EXTCOM GPIO pin. * * @return  N/A *****************************************************************************/static void palClockSetup(CMU_Clock_TypeDef clock){  /* Enable LE domain registers */  CMU_ClockEnable(cmuClock_CORELE, true);#if ( defined(PAL_CLOCK_RTC) && defined(PAL_RTC_CLOCK_LFXO) ) /    || ( defined(PAL_CLOCK_RTCC) && defined(PAL_RTCC_CLOCK_LFXO) )  /* LFA with LFXO setup is relatively time consuming. Therefore, check if it     already enabled before calling. */  if ( !(CMU->STATUS & CMU_STATUS_LFXOENS) )  {    CMU_OscillatorEnable(cmuOsc_LFXO, true, true);  }  if ( cmuSelect_LFXO != CMU_ClockSelectGet(clock) )  {    CMU_ClockSelectSet(clock, cmuSelect_LFXO);  }#elif ( defined(PAL_CLOCK_RTC) && defined(PAL_RTC_CLOCK_LFRCO) ) /    || ( defined(PAL_CLOCK_RTCC) && defined(PAL_RTCC_CLOCK_LFRCO) )  /* Enable LF(A|E)CLK in CMU (will also enable LFRCO oscillator if not enabled) */  CMU_ClockSelectSet(clock, cmuSelect_LFRCO);#elif ( defined(PAL_CLOCK_RTC) && defined(PAL_RTC_CLOCK_ULFRCO) ) /    || ( defined(PAL_CLOCK_RTCC) && defined(PAL_RTCC_CLOCK_ULFRCO) )  /* Enable LF(A|E)CLK in CMU (will also enable ULFRCO oscillator if not enabled) */  CMU_ClockSelectSet(clock, cmuSelect_ULFRCO);#else#error No clock source for RTC defined.#endif}
开发者ID:JeffreyThijs94,项目名称:dash7-ap-open-source-stack,代码行数:34,


示例6: LETOUCH_setupCMU

/**************************************************************************//** * @brief  Enable clocks for all the peripherals to be used *****************************************************************************/static void LETOUCH_setupCMU( void ){  /* Ensure core frequency has been updated */  SystemCoreClockUpdate();  /* ACMP */  CMU_ClockEnable(cmuClock_ACMP0, true);  CMU_ClockEnable(cmuClock_ACMP1, true);    /* GPIO */  CMU_ClockEnable(cmuClock_GPIO, true); /* Low energy peripherals *   LESENSE *   LFXO clock must be enabled prior to enabling *   clock for the low energy peripherals */  CMU_ClockSelectSet(cmuClock_LFA, cmuSelect_LFXO);  CMU_ClockEnable(cmuClock_CORELE, true);  CMU_ClockEnable(cmuClock_LESENSE, true);  /* RTC */  CMU_ClockEnable(cmuClock_RTC, true);  /* Disable clock source for LFB clock */  CMU_ClockSelectSet(cmuClock_LFB, cmuSelect_Disabled);}
开发者ID:Blone,项目名称:my-project-hihack,代码行数:29,


示例7: vPortSetupTimerInterrupt

/**************************************************************************//** * @brief vPortSetupTimerInterrupt * Override the default definition of vPortSetupTimerInterrupt() that is weakly * defined in the FreeRTOS Cortex-M3, which set source of system tick interrupt *****************************************************************************/void vPortSetupTimerInterrupt(void){  /* Set our data about timer used as system ticks*/  ulTimerReloadValueForOneTick = SYSTICK_LOAD_VALUE ;  #if (configUSE_TICKLESS_IDLE == 1)  xMaximumPossibleSuppressedTicks = TIMER_CAPACITY / (SYSTICK_LOAD_VALUE);  ulStoppedTimerCompensation      = TIMER_COMPENSATION / (configCPU_CLOCK_HZ / configSYSTICK_CLOCK_HZ);#endif /* (configUSE_TICKLESS_IDLE == 1) */  /* Configure RTC as system tick source */  /* Structure of RTC init */  RTC_Init_TypeDef init;#if (configCRYSTAL_IN_EM2 == 1)  /* LFXO setup */  /* For cut D, use 70% boost */  CMU->CTRL    = (CMU->CTRL & ~_CMU_CTRL_LFXOBOOST_MASK) | CMU_CTRL_LFXOBOOST_70PCENT;  #if defined( EMU_AUXCTRL_REDLFXOBOOST )  EMU->AUXCTRL = (EMU->AUXCTRL & ~_EMU_AUXCTRL_REDLFXOBOOST_MASK) | EMU_AUXCTRL_REDLFXOBOOST;  #endif#else  /* RC oscillator */  CMU_OscillatorEnable(cmuOsc_LFRCO, true, true);#endif  /* Ensure LE modules are accessible */  CMU_ClockEnable(cmuClock_CORELE, true);#if (configCRYSTAL_IN_EM2 == 1)  /* Enable osc as LFACLK in CMU (will also enable oscillator if not enabled) */  CMU_ClockSelectSet(cmuClock_LFA, cmuSelect_LFXO);#else  /* Enable osc as LFACLK in CMU (will also enable oscillator if not enabled) */  CMU_ClockSelectSet(cmuClock_LFA, cmuSelect_LFRCO);#endif  /* Set 2 times divider to reduce energy*/  CMU_ClockDivSet(cmuClock_RTC, cmuClkDiv_2);  /* Enable clock to RTC module */  CMU_ClockEnable(cmuClock_RTC, true);  init.enable   = false;  init.debugRun = false;  init.comp0Top = false;         /* Count to max value before wrapping */  /* Initialization of RTC */  RTC_Init(&init);  /* Disable interrupt generation from RTC0 */  RTC_IntDisable(RTC_IFC_COMP0);  /* Tick interrupt MUST execute at the lowest interrupt priority. */  NVIC_SetPriority(RTC_IRQn, 255);  /* Enable interrupts */  NVIC_ClearPendingIRQ(RTC_IRQn);  NVIC_EnableIRQ(RTC_IRQn);  RTC_CompareSet(0, SYSTICK_LOAD_VALUE);  RTC_IntClear(RTC_IFC_COMP0);  RTC_IntEnable(RTC_IF_COMP0);  RTC_Enable(true);  //RTC_CounterReset();}
开发者ID:AndreMiras,项目名称:EFM32-Library,代码行数:62,


示例8: rtcSetup

/**************************************************************************//** * @brief Enables LFACLK and selects LFXO as clock source for RTC *        Sets up the RTC to generate an interrupt every second. *****************************************************************************/static void rtcSetup(unsigned int frequency){  RTC_Init_TypeDef rtcInit = RTC_INIT_DEFAULT;  /* Enable LE domain registers */  if ( !( CMU->HFCORECLKEN0 & CMU_HFCORECLKEN0_LE) )  {    CMU_ClockEnable(cmuClock_CORELE, true);  }#ifdef PAL_RTC_CLOCK_LFXO  /* LFA with LFXO setup is relatively time consuming. Therefore, check if it     already enabled before calling. */  if ( !(CMU->STATUS & CMU_STATUS_LFXOENS) )  {    CMU_OscillatorEnable(cmuOsc_LFXO, true, true);  }  if ( cmuSelect_LFXO != CMU_ClockSelectGet(cmuClock_LFA) )  {    CMU_ClockSelectSet(cmuClock_LFA, cmuSelect_LFXO);  }#elif defined PAL_RTC_CLOCK_LFRCO  /* Enable LFACLK in CMU (will also enable LFRCO oscillator if not enabled) */  CMU_ClockSelectSet(cmuClock_LFA, cmuSelect_LFRCO);#elif defined PAL_RTC_CLOCK_ULFRCO  /* Enable LFACLK in CMU (will also enable ULFRCO oscillator if not enabled) */  CMU_ClockSelectSet(cmuClock_LFA, cmuSelect_ULFRCO);#else#error No clock source for RTC defined.#endif  /* Set the prescaler. */  CMU_ClockDivSet( cmuClock_RTC, cmuClkDiv_1 );  /* Enable RTC clock */  CMU_ClockEnable(cmuClock_RTC, true);  /* Initialize RTC */  rtcInit.enable   = false;  /* Do not start RTC after initialization is complete. */  rtcInit.debugRun = false;  /* Halt RTC when debugging. */  rtcInit.comp0Top = true;   /* Wrap around on COMP0 match. */  RTC_Init(&rtcInit);  /* Interrupt at given frequency. */  RTC_CompareSet(0, (CMU_ClockFreqGet(cmuClock_RTC) / frequency) - 1 );  /* Enable interrupt */  NVIC_EnableIRQ(RTC_IRQn);  RTC_IntEnable(RTC_IEN_COMP0);  /* Start Counter */  RTC_Enable(true);}
开发者ID:JamesH001,项目名称:SX1231,代码行数:57,


示例9: main

/**************************************************************************//** * @brief  Main function *****************************************************************************/int main(void){  /* Initialize chip */  CHIP_Init();    setupSWO();  /* Enable HFXO */  CMU_OscillatorEnable(cmuOsc_HFXO, true, true);  /* Switch HFCLK to HFXO */  CMU_ClockSelectSet(cmuClock_HF, cmuSelect_HFXO);  /* Turn off HFRCO */  CMU_OscillatorEnable(cmuOsc_HFRCO, false, false);  BSP_LedsInit();  while (1)  {    /* Blink led three times, with a factor 1 million delay */    blink_led(1000000, 3);    /* Turn on LFRCO */    CMU_OscillatorEnable(cmuOsc_LFRCO, true, true);    /* Select LFRCO */    CMU_ClockSelectSet(cmuClock_HF, cmuSelect_LFRCO);    /* Maximum prescaling for smalles frequency (64 Hz) */    CMU_ClockDivSet(cmuClock_CORE, cmuClkDiv_512);    /* Turn off HFXO */    CMU_OscillatorEnable(cmuOsc_HFXO, false, false);    /* Blink led three times, with a factor 1 delay */    blink_led(1, 3);    /* Turn on HFXO */    CMU_OscillatorEnable(cmuOsc_HFXO, true, true);    /* Select HFXO */    CMU_ClockSelectSet(cmuClock_HF, cmuSelect_HFXO);    /* No prescaling for maximum clock frequency (32 MHz) */    CMU_ClockDivSet(cmuClock_CORE, cmuClkDiv_1);    /* Turn off LFRCO */    CMU_OscillatorEnable(cmuOsc_LFRCO, false, false);  }}
开发者ID:AndreMiras,项目名称:EFM32-Library,代码行数:54,


示例10: main

/**************************************************************************//** * @brief main - the entrypoint after reset. *****************************************************************************/int main( void ){  BSP_Init(BSP_INIT_DEFAULT);   /* Initialize DK board register access */  /* If first word of user data page is non-zero, enable eA Profiler trace */  BSP_TraceProfilerSetup();  CMU_ClockSelectSet( cmuClock_HF, cmuSelect_HFXO );  CMU_OscillatorEnable(cmuOsc_LFXO, true, false);  if ( !MSDDMEDIA_Init() )      /* Initialize the media layer of the MSD. */  {    EFM_ASSERT( false );    for( ;; ){}  }  VUD_Init();                   /* Initialize the vendor unique device. */  CDC_Init();                   /* Initialize the communication class device. */  MSDD_Init(gpioPortE, 1);      /* Initialize the Mass Storage Device.  */  USBD_Init(&initstruct);       /* Start USB. */  /*   * When using a debugger it is practical to uncomment the following three   * lines to force host to re-enumerate the device.   */  /* USBD_Disconnect(); */  /* USBTIMER_DelayMs( 1000 ); */  /* USBD_Connect(); */  for (;;)  {    MSDD_Handler();             /* Serve the MSD device. */  }}
开发者ID:AndreMiras,项目名称:EFM32-Library,代码行数:38,


示例11: RTC_Setup

/***************************************************************************//** * @brief *	Enables LFACLK and selects LFXO as clock source for RTC * * @param osc *	Oscillator ******************************************************************************/void RTC_Setup(CMU_Select_TypeDef osc){  RTC_Init_TypeDef init;  rtcInitialized = 1;  /* Ensure LE modules are accessible */  CMU_ClockEnable(cmuClock_CORELE, true);  /* Enable osc as LFACLK in CMU (will also enable oscillator if not enabled) */  CMU_ClockSelectSet(cmuClock_LFA, osc);  /* Use a 32 division prescaler to reduce power consumption. */  CMU_ClockDivSet(cmuClock_RTC, cmuClkDiv_32);  rtcFreq = CMU_ClockFreqGet(cmuClock_RTC);  /* Enable clock to RTC module */  CMU_ClockEnable(cmuClock_RTC, true);  init.enable   = false;  init.debugRun = false;  init.comp0Top = false; /* Count to max before wrapping */  RTC_Init(&init);  /* Disable interrupt generation from RTC0 */  RTC_IntDisable(_RTC_IF_MASK);  /* Enable interrupts */  NVIC_ClearPendingIRQ(RTC_IRQn);  NVIC_EnableIRQ(RTC_IRQn);}
开发者ID:ketrum,项目名称:equine-health-monitor-gdp12,代码行数:39,


示例12: RTC_Setup

/***************************************************************************//** * @brief Enables LFACLK and selects LFRCO as clock source for RTC ******************************************************************************/static void RTC_Setup(void){  RTC_Init_TypeDef init;  rtcInitialized = 1;  /* Ensure LE modules are accessible */  CMU_ClockEnable(cmuClock_CORELE, true);  /* Enable LFRCO as LFACLK in CMU (will also enable oscillator if not enabled) */  CMU_ClockSelectSet(cmuClock_LFA, cmuSelect_LFRCO);  /* Enable clock to RTC module */  CMU_ClockEnable(cmuClock_RTC, true);  init.enable   = false;  init.debugRun = false;  init.comp0Top = false; /* Count to max before wrapping */  RTC_Init(&init);  /* Disable interrupt generation from RTC0 */  RTC_IntDisable(_RTC_IF_MASK);  /* Enable interrupts */  NVIC_ClearPendingIRQ(RTC_IRQn);  NVIC_EnableIRQ(RTC_IRQn);}
开发者ID:ketrum,项目名称:equine-health-monitor-gdp12,代码行数:30,


示例13: LETIMER_setup

void LETIMER_setup(void){    /* Enabling the required clocks */    CMU_ClockSelectSet(cmuClock_LFA, cmuSelect_ULFRCO); //Selecting the ULFRCO as the source clock    CMU_ClockEnable(cmuClock_LETIMER0, true);           //Enable the clock input to LETIMER    /* Set the compare values for COMP0 */    LETIMER_CompareSet(LETIMER0, 0,PERIOD/ULFRCO_COUNT);    /* Configure the LETIMER0 */    LETIMER_Init_TypeDef letimerInit = LETIMER_INIT_DEFAULT;    //    {    //        .enable         = true,                   /* Default: Start counting when init completed. */    //        .debugRun       = false,                  /* Default: Counter shall not keep running during debug halt. */    //        .rtcComp0Enable = false,                  /* Default: Don't start counting on RTC COMP0 match. */    //        .rtcComp1Enable = false,                  /* Default: Don't start counting on RTC COMP1 match. */    //        .comp0Top       = true,                   /* Load COMP0 register into CNT when counter underflows. COMP0 is used as TOP */    //        .bufTop         = false,                  /* Default: Don't load COMP1 into COMP0 when REP0 reaches 0. */    //        .out0Pol        = 0,                      /* Default: Idle value for output 0. */    //        .out1Pol        = 0,                      /* Default: Idle value for output 1. */    //        .ufoa0          = letimerUFOANone,        /* Default : No action on underfow on Output 0*/    //        .ufoa1          = letimerUFOANone,        /* Default : No action on underfow on Output 1*/    //        .repMode        = letimerRepeatFree       /* Default: Count until stopped */    //    };    letimerInit.comp0Top= true,                   /* Default: Start counting when init completed. */    /* Initialize LETIMER with the values above */    LETIMER_Init(LETIMER0, &letimerInit);}
开发者ID:TEAM-PARADIGM-SHIFT,项目名称:author_application,代码行数:30,


示例14: BootComUartInit

/************************************************************************************//**** /brief     Initializes the UART communication interface.** /return    none.******************************************************************************************/static void BootComUartInit(void){  LEUART_Init_TypeDef init = LEUART_INIT_DEFAULT;  /* configure GPIO pins */  CMU_ClockEnable(cmuClock_GPIO, true);  /* to avoid false start, configure output as high */  GPIO_PinModeSet(gpioPortC, 6, gpioModePushPull, 1);  GPIO_PinModeSet(gpioPortC, 7, gpioModeInput, 0);  /* enable CORE LE clock in order to access LE modules */  CMU_ClockEnable(cmuClock_CORELE, true);  /* select LFXO for LEUARTs (and wait for it to stabilize) */  CMU_ClockSelectSet(cmuClock_LFB, cmuSelect_LFXO);  /* do not prescale clock */  CMU_ClockDivSet(cmuClock_LEUART1, cmuClkDiv_1);  /* enable LEUART1 clock */  CMU_ClockEnable(cmuClock_LEUART1, true);  /* configure LEUART */  init.enable = leuartDisable;  LEUART_Init(LEUART1, &init);  LEUART_BaudrateSet(LEUART1, 0, BOOT_COM_UART_BAUDRATE);  /* enable pins at default location */  LEUART1->ROUTE = LEUART_ROUTE_RXPEN | LEUART_ROUTE_TXPEN;  /* clear previous RX interrupts */  LEUART_IntClear(LEUART1, LEUART_IF_RXDATAV);  /* finally enable it */  LEUART_Enable(LEUART1, leuartEnable);} /*** end of BootUartComInit ***/
开发者ID:x893,项目名称:OpenBLT,代码行数:33,


示例15: rtcSetup

/**************************************************************************//** * @brief Enables LFACLK and selects LFXO as clock source for RTC *        Sets up the RTC to generate an interrupt every minute. *****************************************************************************/void rtcSetup(void){  RTC_Init_TypeDef rtcInit = RTC_INIT_DEFAULT;  /* Enable LE domain registers */  CMU_ClockEnable(cmuClock_CORELE, true);  /* Enable LFXO as LFACLK in CMU. This will also start LFXO */  CMU_ClockSelectSet(cmuClock_LFA, cmuSelect_LFXO);  /* Set a clock divisor of 32 to reduce power conumption. */  CMU_ClockDivSet(cmuClock_RTC, cmuClkDiv_32);  /* Enable RTC clock */  CMU_ClockEnable(cmuClock_RTC, true);  /* Initialize RTC */  rtcInit.enable   = false;  /* Do not start RTC after initialization is complete. */  rtcInit.debugRun = false;  /* Halt RTC when debugging. */  rtcInit.comp0Top = true;   /* Wrap around on COMP0 match. */  RTC_Init(&rtcInit);  /* Interrupt every minute */  RTC_CompareSet(0, ((RTC_FREQ / 32) * 60 ) - 1 );  /* Enable interrupt */  NVIC_EnableIRQ(RTC_IRQn);  RTC_IntEnable(RTC_IEN_COMP0);  /* Start Counter */  RTC_Enable(true);}
开发者ID:AndreMiras,项目名称:EFM32-Library,代码行数:36,


示例16: setup_rtc

// This is the timekeeping clockvoid setup_rtc(){	// Ensure LE modules are accessible	CMU_ClockEnable(cmuClock_CORELE, true);	// Enable LFACLK in CMU (will also enable oscillator if not enabled)	CMU_ClockSelectSet(cmuClock_LFA, cmuSelect_LFRCO);	// Use the prescaler to reduce power consumption. 2^15	//CMU_ClockDivSet(cmuClock_RTC, cmuClkDiv_32768);	CMU_ClockDivSet(cmuClock_RTC, cmuClkDiv_512);	//uint32_t rtcFreq = CMU_ClockFreqGet(cmuClock_RTC);	// Enable clock to RTC module	CMU_ClockEnable(cmuClock_RTC, true);	// Set up the Real Time Clock as long-time timekeeping	RTC_Init_TypeDef init = RTC_INIT_DEFAULT;	init.comp0Top = false;	RTC_Init(&init);	// Enabling Interrupt from RTC	NVIC_EnableIRQ(RTC_IRQn);}
开发者ID:Rajusr70,项目名称:makersguide,代码行数:26,


示例17: startRTCTick

/****************************************************************************** * @brief  *   Configures and starts RTC from ULFRCO *****************************************************************************/void startRTCTick(void){  /* Set-up RTC init struct */  RTC_Init_TypeDef rtcInit;  rtcInit.comp0Top = true;  rtcInit.debugRun = false;  rtcInit.enable = true;    /* Enable clock to LF peripherals */  CMU_ClockEnable(cmuClock_CORELE, true);  /* Set ULFRCO as clock source for RTC */  CMU_ClockSelectSet(cmuClock_LFA, cmuSelect_ULFRCO);  /* Turn on clock for RTC */  CMU_ClockEnable(cmuClock_RTC, true);  /* Enable RTC interrupt lines */  NVIC_EnableIRQ(RTC_IRQn);  RTC_IntEnable(RTC_IF_COMP0);  /* Set compare register */  RTC_CompareSet(0, MS_TO_SLEEP);  /* Initialize and start RTC */  RTC_Init(&rtcInit);}
开发者ID:AndreMiras,项目名称:EFM32-Library,代码行数:31,


示例18: rtcSetup

void rtcSetup(){	RTC_Init_TypeDef rtcInit = RTC_INIT_DEFAULT;	/* Enabling clock to LE configuration register */	CMU_ClockEnable(cmuClock_CORELE, true);	/* Selecting crystal oscillator to drive LF clock */	CMU_ClockSelectSet(cmuClock_LFA, cmuSelect_LFXO);	/* 32 clock division to save energy */	CMU_ClockDivSet(cmuClock_RTC, cmuClkDiv_32768);	/* Providing clock to RTC */	CMU_ClockEnable(cmuClock_RTC, true);	/* Initialize RTC */	rtcInit.enable   = false;  /* Do not start RTC after initialization is complete. */	rtcInit.debugRun = false;  /* Halt RTC when debugging. */	rtcInit.comp0Top = true;   /* Wrap around on COMP0 match. */	RTC_Init(&rtcInit);	/* Interrupt every minute */	RTC_CompareSet(0, ((RTC_FREQ / CLOCK_DIVISION) * 10 ) - 1 );	/* Enable interrupt */	NVIC_EnableIRQ(RTC_IRQn);	RTC_IntEnable(RTC_IEN_COMP0);	/* Start Counter */	RTC_Enable(true);}
开发者ID:kairobert,项目名称:forget-me-not,代码行数:32,


示例19: setupCMU

/**************************************************************************//** * @brief  Enable clocks for all the peripherals to be used *****************************************************************************/void setupCMU(void){  /* Ensure core frequency has been updated */  SystemCoreClockUpdate();  /* DAC */  CMU_ClockEnable(cmuClock_DAC0, true);  /* ACMP */  CMU_ClockEnable(cmuClock_ACMP0, true);  CMU_ClockEnable(cmuClock_ACMP1, true);  /* GPIO */  CMU_ClockEnable(cmuClock_GPIO, true);/* Low energy peripherals *   LESENSE *   LFRCO clock must be enables prior to enabling *   clock for the low energy peripherals */  CMU_ClockSelectSet(cmuClock_LFA, cmuSelect_LFRCO);  CMU_ClockEnable(cmuClock_CORELE, true);  CMU_ClockEnable(cmuClock_LESENSE, true);  /* RTC */  CMU_ClockEnable(cmuClock_RTC, true);  /* LCD */  CMU_ClockEnable(cmuClock_LCD, true);  /* PCNT */  CMU_ClockEnable(cmuClock_PCNT0, true);  /* PCNT */  CMU_ClockEnable(cmuClock_PRS, true);}
开发者ID:Blone,项目名称:my-project-hihack,代码行数:38,


示例20: rtimer_arch_init

/*---------------------------------------------------------------------------*/voidrtimer_arch_init(void){  RTC_Init_TypeDef init = RTC_INIT_DEFAULT;  /* Ensure LE modules are accessible */  CMU_ClockEnable(cmuClock_CORELE, true);  /* Enable LFACLK in CMU (will also enable oscillator if not enabled) */  CMU_ClockSelectSet(cmuClock_LFA, cmuSelect_LFXO);  /* Don't use prescaler to have highest precision */  CMU_ClockDivSet(cmuClock_RTC, cmuClkDiv_1);  /* Enable clock to RTC module */  CMU_ClockEnable(cmuClock_RTC, true);  init.enable   = false; /* Start disabled to reset counter */  init.debugRun = false;  init.comp0Top = false; /* Don't Reset Count on comp0 */  RTC_Init(&init);  /* Disable interrupt generation from RTC0 */  RTC_IntDisable(_RTC_IF_MASK);  /* Enable interrupts */  NVIC_ClearPendingIRQ(RTC_IRQn);  NVIC_EnableIRQ(RTC_IRQn);  /* Start RTC counter */  RTC_Enable(true);}
开发者ID:Spike0,项目名称:Contiki_my,代码行数:33,


示例21: rtc_crystal_init

/** * Initialize RTC Based on Crystal Oscillator */void rtc_crystal_init(void){  RTC_Init_TypeDef init;  /* Ensure LE modules are accessible */  CMU_ClockEnable(cmuClock_CORELE, true);  /* Enable LFACLK in CMU (will also enable oscillator if not enabled) */  CMU_ClockSelectSet(cmuClock_LFA, cmuSelect_LFXO);  /* Use the prescaler to reduce power consumption. */  CMU_ClockDivSet(cmuClock_RTC, RTC_PRESCALE);  /* Enable clock to RTC module */  CMU_ClockEnable(cmuClock_RTC, true);  init.enable   = false; /* Start disabled to reset counter */  init.debugRun = false;  init.comp0Top = false; /* Count to max before wrapping */  RTC_Init(&init);  /* Disable interrupt generation from RTC0 */  RTC_IntDisable(_RTC_IF_MASK);  /* Enable interrupts */  NVIC_ClearPendingIRQ(RTC_IRQn);  NVIC_EnableIRQ(RTC_IRQn);  /* Start RTC counter */  RTC_Enable(true);}
开发者ID:Spike0,项目名称:Contiki_my,代码行数:34,


示例22: RTC_Setup

/***************************************************************************//** * @brief Enables LFACLK and selects osc as clock source for RTC ******************************************************************************/void RTC_Setup(CMU_Select_TypeDef osc){  RTC_Init_TypeDef init;  /* Ensure LE modules are accessible */  CMU_ClockEnable(cmuClock_CORELE, true);  /* Enable osc as LFACLK in CMU (will also enable oscillator if not enabled) */  CMU_ClockSelectSet(cmuClock_LFA, osc);  /* No division prescaler to increase accuracy. */  CMU_ClockDivSet(cmuClock_RTC, cmuClkDiv_1);  /* Enable clock to RTC module */  CMU_ClockEnable(cmuClock_RTC, true);  init.enable   = false;  init.debugRun = false;  init.comp0Top = true; /* Count only to top before wrapping */  RTC_Init(&init);    RTC_CompareSet(0, ((LFRCOFREQ * WAKEUP_US) / 1000000));      /* Disable interrupt generation from RTC0, is enabled before each sample-run. */  RTC_IntDisable(_RTC_IF_MASK);    /* Enable interrupts in NVIC */  NVIC_ClearPendingIRQ(RTC_IRQn);  NVIC_EnableIRQ(RTC_IRQn);  }
开发者ID:AndreMiras,项目名称:EFM32-Library,代码行数:33,


示例23: os_idle_demon

void os_idle_demon(void){  RTC_Init_TypeDef init;  unsigned int sleep;  /* The idle demon is a system thread, running when no other thread is      */  /* ready to run.                                                           */  /* Enable system clock for RTC */  /* LFXO setup */  /* Use 70% boost */  CMU->CTRL = (CMU->CTRL & ~_CMU_CTRL_LFXOBOOST_MASK) | CMU_CTRL_LFXOBOOST_70PCENT;  /* Ensure LE modules are accessible */  CMU_ClockEnable(cmuClock_CORELE, true);  /* Enable osc as LFACLK in CMU (will also enable oscillator if not enabled) */  CMU_ClockSelectSet(cmuClock_LFA, cmuSelect_LFXO);  /* Use a 32 division prescaler to reduce power consumption. */  CMU_ClockDivSet(cmuClock_RTC, cmuClkDiv_32);  /* Enable clock to RTC module */  CMU_ClockEnable(cmuClock_RTC, true);  init.enable   = false;  init.debugRun = false;  init.comp0Top = false; /* Count to max value before wrapping */  RTC_Init(&init);  /* Disable interrupt generation from RTC0 */  RTC_IntDisable(_RTC_IF_MASK);  /* Enable interrupts */  NVIC_ClearPendingIRQ(RTC_IRQn);  NVIC_EnableIRQ(RTC_IRQn);  for (;;)  {    /* os_suspend stops scheduler and returns time to next event in OS_TICK units */    sleep = os_suspend();    if (sleep)    {      RTC_CompareSet(0, sleep - 1);      RTC_IntClear(RTC_IFC_COMP0);      RTC_IntEnable(RTC_IF_COMP0);      RTC_CounterReset();      /* Enter EM2 low power mode - could be replaced with EM1 if required */      EMU_EnterEM2(true);      /* get information how long we were in sleep */      sleep = RTC_CounterGet();      RTC_Enable(false);    };    /* resume scheduler providing information how long MCU was sleeping */    os_resume(sleep);  }}
开发者ID:EnergyMicro,项目名称:EFM32_Gxxx_STK,代码行数:59,


示例24: initClocks

/* Initialize clock settings */void initClocks(void) {  /* Configure for 48MHz HFXO operation of core clock */  CMU_ClockSelectSet(cmuClock_HF, cmuSelect_HFXO);   /* Enable SysTick interrupt, used by GUI software timer */  if (SysTick_Config(CMU_ClockFreqGet(cmuClock_CORE) / 1000)) while (1);}
开发者ID:AndreMiras,项目名称:EFM32-Library,代码行数:9,


示例25: initOscillators

void initOscillators(void){	  CMU_ClockSelectSet(cmuClock_LFB, cmuSelect_CORELEDIV2);  // select HFCORECLK/2 as clock source to LFB	  CMU_ClockEnable(cmuClock_CORELE, true);                  // enable the Low Energy Peripheral Interface clock	  CMU_ClockEnable(cmuClock_HFPER, true);	  CMU_ClockEnable(cmuClock_GPIO, true);                    // enable GPIO peripheral clock}
开发者ID:DanielKalicki,项目名称:ModularElectronics,代码行数:8,


示例26: main

/**************************************************************************//** * @brief  Main function of clock example. * *****************************************************************************/int main(void){    EMSTATUS status;  bool redraw;  ClockMode_t prevClockMode = CLOCK_MODE_DIGITAL;    /* Chip errata */  CHIP_Init();  /* Use the 21 MHz band in order to decrease time spent awake.     Note that 21 MHz is the highest HFRCO band on ZG. */  CMU_ClockSelectSet( cmuClock_HF, cmuSelect_HFRCO  );  CMU_HFRCOBandSet( cmuHFRCOBand_21MHz );  /* Setup GPIO for pushbuttons. */  gpioSetup();  /* Initialize display module */      status = DISPLAY_Init();  if (DISPLAY_EMSTATUS_OK != status)    while (true)      ;  /* Initialize the DMD module for the DISPLAY device driver. */  status = DMD_init(0);  if (DMD_OK != status)    while (true)      ;  status = GLIB_contextInit(&gc);  if (GLIB_OK != status)    while (true)      ;    /* Set PCNT to generate interrupt every second */  pcntInit();    /* Pre-compte positions for the analog graphics */  analogClockInitGraphics();  /* Enter infinite loop that switches between analog and digitcal clock   * modes, toggled by pressing the button PB0. */  while (true)  {        redraw = (prevClockMode != clockMode);    prevClockMode = clockMode;    if (CLOCK_MODE_ANALOG == clockMode)    {      analogClockShow(redraw);    }    else    {      digitalClockShow(redraw);    }    /* Sleep between each frame update */    EMU_EnterEM2(false);  }}
开发者ID:AndreMiras,项目名称:EFM32-Library,代码行数:62,


示例27: main

int main(int argc, char **argv){/* * Initalize chip. */  CHIP_Init();/*  * Use XT oscillator, disable internal RC osc. */  CMU_ClockSelectSet(cmuClock_HF, cmuSelect_HFXO);  CMU_OscillatorEnable(cmuOsc_HFRCO, false, false);  SystemCoreClockUpdate();#if PORTCFG_CON_USART == 0  // Allow deep sleep. Doesn't work well with uart console currently.  SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;#endif#if PORTCFG_CONOUT_ITM == 1#ifdef _DBG  if (DBG_Connected()) {    CMU_ClockEnable(cmuClock_GPIO, true);    DBG_SWOEnable(0);    /* Enable trace in core debug, taken from Energy Aware Commander */    CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk;    ITM->LAR  = 0xC5ACCE55;    ITM->TER  = 0x0;    ITM->TCR  = 0x0;    TPI->SPPR = 2;    TPI->ACPR = 0xf;    ITM->TPR  = 0x0;    DWT->CTRL = 0x400003FE;    ITM->TCR  = 0x0001000D;    TPI->FFCR = 0x00000100;    ITM->TER  = 0x1;  }#endif#endif#if PORTCFG_CON_USART == 1  // Configure usart pins.  CMU_ClockEnable(cmuClock_GPIO, true);  GPIO_PinModeSet(gpioPortC, 0, gpioModePushPull, 1);  GPIO_PinModeSet(gpioPortC, 1, gpioModeInput, 0);#endif  testStart();  return 0;}
开发者ID:AriZuu,项目名称:blink-test,代码行数:57,


示例28: main

/**************************************************************************//** * @brief  Main function *****************************************************************************/int main(void){  uint16_t *frameBuffer;  bool     redraw;  /* Configure for 48MHz HFXO operation of core clock */  CMU_ClockSelectSet(cmuClock_HF, cmuSelect_HFXO);  /* Setup SysTick Timer for 1 msec interrupts  */  if (SysTick_Config(CMU_ClockFreqGet(cmuClock_CORE) / 1000))  {    while (1) ;  }  /* Initialize EBI banks (Board Controller, external PSRAM, ..) */  BSP_Init(BSP_INIT_DEFAULT);  /* If first word of user data page is non-zero, enable eA Profiler trace */  BSP_TraceProfilerSetup();  /* Indicate we are waiting for AEM button state enable EFM32GG */  BSP_LedsSet(0x8001);  while (BSP_RegisterRead(&BC_REGISTER->UIF_AEM) != BC_UIF_AEM_EFM)  {    /* Show a short "strobe light" on DK LEDs, indicating wait */    BSP_LedsSet(0x8001);    Delay(200);    BSP_LedsSet(0x4002);    Delay(50);  }  /* Set frame buffer start address */  frameBuffer = (uint16_t *) EBI_BankAddress(EBI_BANK2);  /* Loop demo forever */  while (1)  {    redraw = TFT_DirectInit(&tftInit);    if (redraw)    {      /* Inidicate that we are in active drawing mode */      BSP_LedsSet(0x0000);      /* Update frame buffer */      TFT_DrawScreen(frameBuffer);      /* Wait slightly before next update */      Delay(100);    }    else    {      /* Sleep - no need to update display */      BSP_LedsSet(0x8001);      Delay(200);    }  }}
开发者ID:AndreMiras,项目名称:EFM32-Library,代码行数:60,


示例29: initRTC

/**************************************************************************//** * @brief Initialize Real Time Counter *****************************************************************************/void initRTC(){  /* Starting LFXO and waiting until it is stable */  CMU_OscillatorEnable(cmuOsc_LFXO, true, true);  /* Routing the LFXO clock to the RTC */  CMU_ClockSelectSet(cmuClock_LFA, cmuSelect_LFXO);  CMU_ClockEnable(cmuClock_RTC, true);  /* Enabling clock to the interface of the low energy modules */  CMU_ClockEnable(cmuClock_CORELE, true);  const RTC_Init_TypeDef rtcInit =  {    .enable   = true,    .debugRun = false,    .comp0Top = true,  };  RTC_Init(&rtcInit);  /* Set comapre value for compare register 0 */  RTC_CompareSet(0, RTC_COUNT_BETWEEN_WAKEUP);  /* Enable interrupt for compare register 0 */  RTC_IntEnable(RTC_IFC_COMP0);  /* Enabling Interrupt from RTC */  NVIC_EnableIRQ(RTC_IRQn);  RTC_Enable(false);}/**************************************************************************//** * @brief Initialize General Purpuse Input/Output *****************************************************************************/void initGPIO(){  /* Enable clock for GPIO module */  CMU_ClockEnable(cmuClock_GPIO, true);  /* Configure pin PB9/PD8 (Push Button 1) and PB10/PB11 (Push Button 2) as an input,   * so that we can read their values. */  GPIO_PinModeSet(PB0_PORT, PB0_PIN, gpioModeInput, 1);  GPIO_PinModeSet(PB1_PORT, PB1_PIN, gpioModeInput, 1);  /* Enable GPIO_ODD and GPIO_EVEN interrupts in NVIC */  NVIC_EnableIRQ(GPIO_ODD_IRQn);  NVIC_EnableIRQ(GPIO_EVEN_IRQn);  /* Configure interrupts on falling edge for pins B9/D8 (Push Button 1),   * B10/B11 (Push Button 2) and D3 */  GPIO_IntConfig(PB0_PORT, PB0_PIN, true, true, true);  GPIO_IntConfig(PB1_PORT, PB1_PIN, true, true, true);}
开发者ID:AndreMiras,项目名称:EFM32-Library,代码行数:58,



注:本文中的CMU_ClockSelectSet函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ CMWEXCEPTION函数代码示例
C++ CMU_ClockFreqGet函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。