• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ CHIP_Init函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: main

/**************************************************************************//**
 * @brief  Main function
 *****************************************************************************/
int main(void)
{
  bool vboost = false;

  /* Chip revision alignment and errata fixes */
  CHIP_Init();

  /* Initialize DVK board register access */
  BSP_Init(BSP_INIT_DEFAULT);

  /* If first word of user data page is non-zero, enable eA Profiler trace */
  BSP_TraceProfilerSetup();

  /* Initialize board specific registers */
  VDDCHECK_Init();

  /* Check if voltage is below 3V, if so use voltage boost */
  if (VDDCHECK_LowVoltage(2.9))
    vboost = true;

  /* Disable Voltage Comparator */
  VDDCHECK_Disable();

  /* Run Energy Mode with LCD demo, see lcdtest.c */
  SegmentLCD_Init(vboost);
  /* Display a message if vboost is enabled */
  if ( vboost )
  {
    SegmentLCD_Write("vboost");
    RTCDRV_Delay(5000, false);
  }
  Test();

  return 0;
}
开发者ID:havardh,项目名称:bitless,代码行数:38,代码来源:emlcd.c


示例2: main

/**************************************************************************//**
 * @brief  Main function
 *****************************************************************************/
int main(void)
{
  /* Chip errata */
  CHIP_Init();
  
  /* Select clock source  */
  initClocks();
  
  /* Initialize EBI configuration for external RAM and display controller */
  BSP_Init(BSP_INIT_DK_EBI);
  
  /* Initialize emWin Library. Will call initDisplayController to initialize Direct Drive. */
  GUI_Init();
  
  
  /* Initialization done, enter drawing loop. 
   * More emWin examples can be viewed by copy pasting into this file and 
   * uncommenting the following line calling MainTask() instead of drawingLoop()
   * emWin examples can be found under reptile/emwin/examples
   */
  
  drawingLoop();
  
  //MainTask();
  
  return 0;
}
开发者ID:AndreMiras,项目名称:EFM32-Library,代码行数:30,代码来源:multibuf.c


示例3: main

/**************************************************************************//**
 * @brief  Main function
 *****************************************************************************/
int main(void)
{
	CHIP_Init();

	enter_DefaultMode_from_RESET();

	setup_utilities(USART1);

	delay(100);

	I2C_Init_TypeDef i2cInit = I2C_INIT_DEFAULT;
	I2C_Init(I2C0, &i2cInit);

	// Offset zero is Device ID
	uint16_t value = i2c_read_register(0);

	// Set an LED on the Starter Kit if success
	if (value == DEVICE_ID)
	{
		set_led(1,1);
	}

	// Infinite loop
	while (1) {
  }
}
开发者ID:Rajusr70,项目名称:makersguide,代码行数:29,代码来源:main_device_id.c


示例4: silabs_efm32wg_init

/**
 * @brief Perform basic hardware initialization
 *
 * Initialize the interrupt controller device drivers.
 * Also initialize the timer device driver, if required.
 *
 * @return 0
 */
static int silabs_efm32wg_init(struct device *arg)
{
	ARG_UNUSED(arg);

	int oldLevel; /* old interrupt lock level */

	/* disable interrupts */
	oldLevel = irq_lock();

	/* handle chip errata */
	CHIP_Init();

	_ClearFaults();

	/* Initialize system clock according to CONFIG_CMU settings */
	clkInit();

	/*
	 * install default handler that simply resets the CPU
	 * if configured in the kernel, NOP otherwise
	 */
	NMI_INIT();

	/* restore interrupt state */
	irq_unlock(oldLevel);
	return 0;
}
开发者ID:agatti,项目名称:zephyr,代码行数:35,代码来源:soc.c


示例5: main

/**************************************************************************//**
 * @brief  Main function
 *****************************************************************************/
int main(void)
{
  /* Chip errata */
  CHIP_Init();

  /* If first word of user data page is non-zero, enable eA Profiler trace */
  BSP_TraceProfilerSetup();

  /* Ensure core frequency has been updated */
  SystemCoreClockUpdate();

  /* Init LCD with no voltage boost */
  SegmentLCD_Init(oldBoost);

  /* Setup RTC to generate an interrupt every minute */
  rtcSetup();

  /* Setup GPIO with interrupts to serve the pushbuttons */
  gpioSetup();

  /* Main function loop */
  clockLoop();

  return 0;
}
开发者ID:AndreMiras,项目名称:EFM32-Library,代码行数:28,代码来源:clock.c


示例6: main

/**************************************************************************//**
 * @brief  Main function
 *****************************************************************************/
int main(void)
{
    TEMPSENS_Temp_TypeDef temp;

    /* Chip revision alignment and errata fixes */
    CHIP_Init();

    /* Initialize LCD controller without boost */
    SegmentLCD_Init(false);

    I2C_Tempsens_Init();

    /* Main loop - just read temperature and update LCD */
    while (1)
    {
        if (TEMPSENS_TemperatureGet(I2C0,
                                    TEMPSENS_DVK_ADDR,
                                    &temp) < 0)
        {
            SegmentLCD_Write("ERROR");
            /* Enter EM2, no wakeup scheduled */
            EMU_EnterEM2(true);
        }

        /* Update LCD display */
        temperatureUpdateLCD(&temp);

        /* Read every 2 seconds which is more than it takes worstcase to */
        /* finish measurement inside sensor. */
        RTCDRV_Trigger(2000, NULL);
        EMU_EnterEM2(true);
    }
}
开发者ID:Blone,项目名称:my-project-hihack,代码行数:36,代码来源:i2c_tempsens_main.c


示例7: main

/**************************************************************************//**
 * @brief  Main function
 * Main is called from __iar_program_start, see assembly startup file
 *****************************************************************************/
int main(void)
{  
  /* Initialize chip */
  CHIP_Init();
  
  /* Enable clock for GPIO module */
  CMU_ClockEnable(cmuClock_GPIO, true);

  /* Configure PD with alternate drive strength of 20mA */
  GPIO_DriveModeSet(gpioPortD, gpioDriveModeHigh);
  
  /* Configure PC12 as input with filter*/
  GPIO_PinModeSet(gpioPortC, 12, gpioModeInput, 0);
  
  /* Configure PD8 as push pull output */
  GPIO_PinModeSet(gpioPortD, 8, gpioModePushPullDrive, 0);
  
  while(1)
  {
    /* If PC12 is high, drive high PD8, else drive low */
    if(GPIO_PinInGet(gpioPortC, 12)) 
      GPIO_PinOutSet(gpioPortD, 8);   /* Drive high PD8 */ 
    else 
      GPIO_PinOutClear(gpioPortD, 8); /* Drive low PD8 */
  }
  
 
}
开发者ID:AndreMiras,项目名称:EFM32-Library,代码行数:32,代码来源:main_gpio_conf_dvk.c


示例8: main

/**************************************************************************//**
 * @brief  Main function
 *****************************************************************************/
int main(void)
{
  /* Initialize chip */
  CHIP_Init();
  
  /* Enable Low energy clocking module clock. */
  CMU_ClockEnable(cmuClock_CORELE, true);

  /* Disable LFA and LFB clock domains to save power */
  CMU->LFCLKSEL = 0;
  
  /* Starting LFRCO and waiting until it is stable */
  CMU_OscillatorEnable(cmuOsc_LFRCO, true, true);

  /* Enable access to BURTC registers */
  RMU_ResetControl(rmuResetBU, false);

  /* Setting up burtc */
  setupBurtc();
  
  while (1)
  {
    /* Enter EM2. */
    EMU_EnterEM2(false);
  }
}
开发者ID:AndreMiras,项目名称:EFM32-Library,代码行数:29,代码来源:main_burtc.c


示例9: main

int main()
{
	CHIP_Init();
	TRACE_SWOSetup();
	ANTHRMSensor * hrm = ANTHRMSensor::getInstance();
	AlarmManager * alm = AlarmManager::getInstance();

	//USARTManager::getInstance()->getPort(USARTManagerPortLEUART0)->setSignalFrameHook(&frameHandler);
	//USARTManager::getInstance()->getPort(USARTManagerPortLEUART0)->setRxHook(&rxHook);

	bool OK = false; 
	
	SensorMessage * msg;
	HeartRateMessage * hrm_msg;
	uint16_t size;
		

	while(1)
	{
		alm->lowPowerDelay(900, sleepModeEM2);
		
		if(OK) {
			hrm->sampleSensorData();
			msg = (SensorMessage *) hrm->readSensorData(&size);
			hrm_msg = (HeartRateMessage *) msg->sensorMsgArray;
			printf("measured heart rate: %d bpm \n", hrm_msg->bpm);
		}
		else {
		  OK = hrm->initializeNetwork(true);			
		}
			
	}
}
开发者ID:ketrum,项目名称:equine-health-monitor-gdp12,代码行数:33,代码来源:main.cpp


示例10: main

/**************************************************************************//**
 * @brief Main function
 *****************************************************************************/
int main(void)
{  
  /* Chip revision alignment and errata fixes */
  CHIP_Init();
  
  /* Set system frequency to 1 MHz */
  CMU_HFRCOBandSet(cmuHFRCOBand_1MHz);
  
  /* Initialize LCD */
  SegmentLCD_Init(false); 

  /* Initialize TIMER0 */
  initTimer();
  
  /* Enable Sleep-om-Exit */
  SCB->SCR |= SCB_SCR_SLEEPONEXIT_Msk;
  
  /* Initialize interrupt count */
  interruptCount = 0;
  
  /* Enter EM1 until all TIMER0 interrupts are done
   * Notice that we only enter sleep once, as the MCU will fall asleep
   * immediately when the ISR is done without returning to main as long as
   * SLEEPONEXIT is set */
  EMU_EnterEM1();
  
  /* Signal that program is done */
  SegmentLCD_Write("DONE");
  while(1);
}
开发者ID:AndreMiras,项目名称:EFM32-Library,代码行数:33,代码来源:sleep_on_exit.c


示例11: main

/**************************************************************************//**
 * @brief
 *   Main function is a CMSIS RTOS thread in itself
 *
 * @note
 *   This example uses threads, memory pool and message queue to demonstrate the
 *   usage of these CMSIS RTOS features. In this simple example, the same
 *   functionality could more easily be achieved by doing everything in the main
 *   loop.
 *****************************************************************************/
int main(void)
{
  int count = 0;

  /* Chip errata */
  CHIP_Init();

  /* Initialize CMSIS RTOS structures */
  /* create memory pool */
  mpool = osPoolCreate(osPool(mpool));
  /* create msg queue */
  msgBox = osMessageCreate(osMessageQ(msgBox), NULL);
  /* create thread 1 */
  osThreadCreate(osThread(PrintLcdThread), NULL);

  /* Infinite loop */
  while (1)
  {
    count = (count + 1) & 0xF;

    /* Send message to PrintLcdThread */
    /* Allocate memory for the message */
    lcdText_t *mptr = osPoolAlloc(mpool);
    /* Set the message content */
    (*mptr)[0] = count >= 10 ? '1' : '0';
    (*mptr)[1] = count % 10 + '0';
    (*mptr)[2] = '\0';
    /* Send message */
    osMessagePut(msgBox, (uint32_t) mptr, osWaitForever);

    /* Wait now for half a second */
    osDelay(500);
  }
}
开发者ID:EnergyMicro,项目名称:EFM32_Gxxx_STK,代码行数:44,代码来源:rtx_tickless.c


示例12: main

/**************************************************************************//**
 * @brief  Main function
 *****************************************************************************/
int main(void)
{
  /* Chip revision alignment and errata fixes */
  CHIP_Init();

  /* Initialize DK board register access */
  BSP_Init(BSP_INIT_DEFAULT);

  /* If first word of user data page is non-zero, enable eA Profiler trace */
  BSP_TraceProfilerSetup();

  /* Setup SysTick Timer for 1 msec interrupts  */
  if (SysTick_Config(CMU_ClockFreqGet(cmuClock_CORE) / 1000))
  {
    while (1) ;
  }

  /* Blink forever */
  while (1)
  {
    /* Blink user leds on DVK board */
    BSP_LedsSet(0x00ff);
    Delay(200);

    /* Blink user leds on DVK board */
    BSP_LedsSet(0xff00);
    Delay(200);
  }
}
开发者ID:AndreMiras,项目名称:EFM32-Library,代码行数:32,代码来源:blink.c


示例13: main

/**************************************************************************//**
 * @brief  Main function
 *****************************************************************************/
int main(void)
{
  /* Chip errata */
  CHIP_Init();

  /* If first word of user data page is non-zero, enable eA Profiler trace */
  BSP_TraceProfilerSetup();

  /* Initialize SLEEP driver, no calbacks are used */
  SLEEP_Init(NULL, NULL);
#if (configSLEEP_MODE < 3)
  /* do not let to sleep deeper than define */
  SLEEP_SleepBlockBegin((SLEEP_EnergyMode_t)(configSLEEP_MODE+1));
#endif

  /* Initialize the LCD driver */
  SegmentLCD_Init(false);

  /* Create standard binary semaphore */
  vSemaphoreCreateBinary(sem);

  /* Create two task to show numbers from 0 to 15 */
  xTaskCreate(Count, (const signed char *) "Count", STACK_SIZE_FOR_TASK, NULL, TASK_PRIORITY, NULL);
  xTaskCreate(LcdPrint, (const signed char *) "LcdPrint", STACK_SIZE_FOR_TASK, NULL, TASK_PRIORITY, NULL);

  /* Start FreeRTOS Scheduler */
  vTaskStartScheduler();

  return 0;
}
开发者ID:AndreMiras,项目名称:EFM32-Library,代码行数:33,代码来源:main.c


示例14: main

/******************************************************************************
 * @brief  
 *   Main function
 *****************************************************************************/
int main(void)
{
  /* Initialize chip - handle erratas */
  CHIP_Init();

  /* Setup RTC for periodic wake-ups */
  startRTCTick();

  /* Start LFXO. Do not wait until it is stable */
  CMU_OscillatorEnable(cmuOsc_LFXO, true, false);

  /* Wait in EM2 until LFXO is ready */
  while (!(CMU->STATUS & CMU_STATUS_LFXORDY))
  {
    EMU_EnterEM2(false);
  }
  /* Stop the RTC */
  stopRTCTick();

  while (1)
  {
    /* Go to sleep */
    EMU_EnterEM1();
  }
}
开发者ID:AndreMiras,项目名称:EFM32-Library,代码行数:29,代码来源:lfxo_startup.c


示例15: main

/**************************************************************************//**
 * @brief  Main function
 *****************************************************************************/
int main(void)
{
	// Chip errata
	CHIP_Init();

	setup_utilities();

	CMU_ClockEnable(cmuClock_GPIO, true);

	// Set up the user interface buttons
	GPIO_PinModeSet(BUTTON_PORT, SET_BUTTON_PIN, gpioModeInput,  0);

	while (1)
	{
		if (get_button())
		{
			set_led(0, 1);
			delay(DELAY_VALUE);
			set_led(1, 1);
		}
		else
		{
			set_led(0, 0);
			set_led(1, 0);
		}
	}
}
开发者ID:Rajusr70,项目名称:makersguide,代码行数:30,代码来源:main_button.c


示例16: main

/**************************************************************************//**
 * @brief  Main function
 *****************************************************************************/
int main(void)
{
  /* Chip errata */
  CHIP_Init();

  enter_DefaultMode_from_RESET();


  Imu_Initialize();
  //Imu_Initialize_OneShot();
  Mag_Initialize_OneShot();
  Cli_Initialize_Cli();
  Time_Initilize_TimeStamp();
  Sch_Initilize_Scheduler();
  /* Infinite loop */
  Sch_Run_Scheduler();




  while(1)
  {
	  //Temporary while loop
	  //Imu_TestFunction();
	  //Imu_Read();
	  Imu_WriteStreamFifo();
  }

}
开发者ID:jacquestkirk,项目名称:WeatherBalloon,代码行数:32,代码来源:main.c


示例17: main

int main()
{
	
	// Chip errata
	CHIP_Init();
	
	// ensure core frequency has been updated
	SystemCoreClockUpdate();
	
	// start clocks
	initClocks();
		
	// init LEDs
	LED_Init();
	
	// init scheduler
	SCHEDULER_Init();
	
	// enable timers
	enableTimers();
	
	// enable interrupts
	enableInterrupts();
	
	// init tasks
	SCHEDULER_TaskInit(&radio_task, radio_task_entrypoint);
	
	// run
	SCHEDULER_Run();
	
}
开发者ID:phuonglab,项目名称:CM3-Scheduler,代码行数:31,代码来源:main.c


示例18: main

/**************************************************************************//**
 * @brief  Main function
 *****************************************************************************/
int main(void)
{
  /* Chip errata */
  CHIP_Init();
  /* If first word of user data page is non-zero, enable eA Profiler trace */
  BSP_TraceProfilerSetup();

  /* Initialize LED driver */
  BSP_LedsInit();
  /* Setting state of leds*/
  BSP_LedSet(0);
  BSP_LedSet(1);

  /* Initialize SLEEP driver, no calbacks are used */
  SLEEP_Init(NULL, NULL);
#if (configSLEEP_MODE < 3)
  /* do not let to sleep deeper than define */
  SLEEP_SleepBlockBegin((SLEEP_EnergyMode_t)(configSLEEP_MODE+1));
#endif

  /* Parameters value for taks*/
  static TaskParams_t parametersToTask1 = { pdMS_TO_TICKS(1000), 0 };
  static TaskParams_t parametersToTask2 = { pdMS_TO_TICKS(500), 1 };

  /*Create two task for blinking leds*/
  xTaskCreate( LedBlink, (const char *) "LedBlink1", STACK_SIZE_FOR_TASK, &parametersToTask1, TASK_PRIORITY, NULL);
  xTaskCreate( LedBlink, (const char *) "LedBlink2", STACK_SIZE_FOR_TASK, &parametersToTask2, TASK_PRIORITY, NULL);

  /*Start FreeRTOS Scheduler*/
  vTaskStartScheduler();

  return 0;
}
开发者ID:SiliconLabs,项目名称:Gecko_SDK,代码行数:36,代码来源:main.c


示例19: main

/******************************************************************************
 * @brief  Main function
 * Main is called from _program_start, see assembly startup file
 *****************************************************************************/
int main(void)
{

  /* Initialize chip */
  //eADesigner_Init();
  /* Initialize chip */
  CHIP_Init();

  /* Initalizing */
  init();

  GPIO_PortOutSetVal(gpioPortD, 1<<3, 1<<3);
  GPIO_PortOutSetVal(gpioPortF, 1<<6, 1<<6);
  GPIO_PortOutSetVal(gpioPortB, 1<<12, 1<<12);
  GPIO_PortOutSetVal(LED_PORT, 1<<LED_PIN, 1<<LED_PIN);
  while(1){
	  /* Data transmission to slave */
	  /* ************************** */
	  /* Setting up RX interrupt for master */
	  SPI1_setupRXInt(receiveBuffer, BUFFERSIZE);
	  GPIO_PortOutSetVal(LED_PORT, 0<<LED_PIN, 1<<LED_PIN);
	  /* Transmitting data */
	  USART1_sendBuffer(transmitBuffer, BUFFERSIZE);
	  GPIO_PortOutSetVal(LED_PORT, 1<<LED_PIN, 1<<LED_PIN);
  }

}
开发者ID:onlyoneknife,项目名称:cubesat,代码行数:31,代码来源:EFM32GG280F1024_SPI.c


示例20: main

/******************************************************************************
 * @brief  Main function
 * The main file starts a timer and uses PRS to trigger an ADC conversion.
 * It waits in EM1 until the ADC conversion is complete, then prints the
 * result on the lcd.
 *****************************************************************************/
int main(void)
{
  /* Initialize chip */
  CHIP_Init();
  
  SegmentLCD_Init(false);

  /* Enable clocks required */
  CMU_ClockEnable(cmuClock_ADC0, true);
  CMU_ClockEnable(cmuClock_PRS, true);
  CMU_ClockEnable(cmuClock_TIMER0, true);

  /* Select TIMER0 as source and TIMER0OF (Timer0 overflow) as signal (rising edge) */
  PRS_SourceSignalSet(0, PRS_CH_CTRL_SOURCESEL_TIMER0, PRS_CH_CTRL_SIGSEL_TIMER0OF, prsEdgePos);

  ADCConfig();
  TimerConfig();

  /* Stay in this loop forever */
  while (1)
  {
    /* Enter EM1 and wait for timer triggered adc conversion */
    EMU_EnterEM1();

    /* Write result to LCD */
    SegmentLCD_Number(adcResult);

    /* Do other stuff */
    int i;
    for (i = 0; i < 10000; i++) ;
  }
}
开发者ID:AndreMiras,项目名称:EFM32-Library,代码行数:38,代码来源:main_adc_timer_prs.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ CHK函数代码示例发布时间:2022-05-30
下一篇:
C++ CHF_BOX函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap