當前位置: 首頁>>代碼示例>>C++>>正文


C++ BSP_Config函數代碼示例

本文整理匯總了C++中BSP_Config函數的典型用法代碼示例。如果您正苦於以下問題:C++ BSP_Config函數的具體用法?C++ BSP_Config怎麽用?C++ BSP_Config使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了BSP_Config函數的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: StartThread

/**
  * @brief  Start thread
  * @param  argument: not used
  * @retval None
  */
static void StartThread(void const * argument)
{
  /* Initialize LCD and LEDs */
  BSP_Config();
  
  /* Create tcp_ip stack thread */
  tcpip_init(NULL, NULL);
  
  /* Initilaize the LwIP stack */
  Netif_Config();
  
  /* Notify user about the netwoek interface config */
  User_notification(&gnetif);

  /* Start SSL Server task */
  osThreadDef(Server, ssl_server, osPriorityAboveNormal, 0, configMINIMAL_STACK_SIZE * 20);
  osThreadCreate (osThread(Server), NULL);

#ifdef USE_DHCP
  /* Start DHCPClient */
  osThreadDef(DHCP, DHCP_thread, osPriorityBelowNormal, 0, configMINIMAL_STACK_SIZE * 2);
  osThreadCreate (osThread(DHCP), &gnetif);
#endif
  
  /* Start toogleLed4 task : Toggle LED4  every 250ms */
  osThreadDef(LED4, ToggleLed4, osPriorityLow, 0, configMINIMAL_STACK_SIZE);
  osThreadCreate (osThread(LED4), NULL);
  
  for( ;; )
  {
    /* Delete the Start Thread */ 
    osThreadTerminate(NULL);
  }
}
開發者ID:acrepina,項目名稱:STM32F7_serverWEB,代碼行數:39,代碼來源:main.c

示例2: main

/* Private functions ---------------------------------------------------------*/
int main(void) {

	/* STM32F4xx HAL library initialization:
		 - Configure the Flash prefetch, instruction and Data caches
		 - Configure the Systick to generate an interrupt each 1 msec
		 - Set NVIC Group Priority to 4
		 - Global MSP (MCU Support Package) initialization
	*/
	HAL_Init();
	SystemClock_Config(); //Configure the System clock to have a frequency of 168 MHz
	BSP_Config(); //Configure the BSP (Board Support Package)
	lwip_init(); //Initilaize the LwIP stack
	Netif_Config(); //Configurates the network interface
	concentrator_init();
	User_notification(&gnetif); //Notify the User about the nework interface config status
	
	/* Compute the value of ARR regiter to generate signal frequency at 17.57 Khz */
	uhTimerPeriod = (uint32_t) ((SystemCoreClock / 17570 ) - 1);
	/* Compute CCR1 value to generate a duty cycle at 50% at the beggining */
	aCCValue_Buffer = (uint32_t)(((uint32_t) uhADCxConvertedValuePercent * (uhTimerPeriod - 1)) / 100);

	TIM_Config(); //TIM3, TIM4, TIM8 Peripheral Configuration
	ADC_Config(); //Configure the ADC3 peripheral

	while (1) {
		/* Read a received packet from the Ethernet buffers and send it 
		to the lwIP for handling */
		ethernetif_input(&gnetif);
		sys_check_timeouts(); //Handle timeouts
	}

}
開發者ID:mrtnzlml-archive,項目名稱:Real-time-WS,代碼行數:33,代碼來源:main.c

示例3: main

/**
  * @brief  Main program.
  * @param  None
  * @retval None
  */ 
int main(void)
{  
  /* STM32F0xx HAL library initialization:
       - Configure the Flash prefetch
       - Systick timer is configured by default as source of time base, but user 
         can eventually implement his proper time base source (a general purpose 
         timer for example or other time source), keeping in mind that Time base 
         duration should be kept 1ms since PPP_TIMEOUT_VALUEs are defined and 
         handled in milliseconds basis.
       - Low Level Initialization
     */
  HAL_Init();  
  
  /* Configure the system clock = 48 MHz */
  SystemClock_Config();
  
  /* Initialize LCD and LEDs */
  BSP_Config();
  
  /* Init the STemWin GUI Library */
  GUI_Init();
  /* Activate the use of memory device feature */
  WM_SetCreateFlags(WM_CF_MEMDEV);
    
  MainTask();
  
  /* Infinite loop */
  for(;;);
}
開發者ID:NjordCZ,項目名稱:stm32cubef0,代碼行數:34,代碼來源:main.c

示例4: StartThread

/**
  * @brief  Main task
  * @param  pvParameters not used
  * @retval None
  */
static void StartThread(void const * argument)
{
  /* Initialize LCD and LEDs */
  BSP_Config();
  
  /* Create tcp_ip stack thread */
  tcpip_init(NULL, NULL);
  
  /* Initilaize the LwIP stack */
  Netif_Config();
  
  /* Initialize tcp echo server */
  tcpecho_init();

  /* Initialize udp echo server */
  udpecho_init();
  
  /* Notify user about the netwoek interface config */
  User_notification(&gnetif);
  
   /* Start toogleLed4 task : Toggle LED4  every 250ms */
  osThreadDef(LED4, ToggleLed4, osPriorityLow, 0, configMINIMAL_STACK_SIZE);
  osThreadCreate (osThread(LED4), NULL);

  for( ;; )
  {
    /* Delete the Init Thread*/ 
    osThreadTerminate(NULL);
  }
}
開發者ID:pierreroth64,項目名稱:STM32Cube_FW_F4,代碼行數:35,代碼來源:main.c

示例5: main

/**
  * @brief  Main program.
  * @param  None
  * @retval None
  */
int main(void)
{  
  /* STM32F4xx HAL library initialization:
       - Configure the Flash prefetch, instruction and Data caches
       - Configure the Systick to generate an interrupt each 1 msec
       - Set NVIC Group Priority to 4
       - Global MSP (MCU Support Package) initialization
     */
  HAL_Init();  
  
  /* Configure the system clock to have a system clock = 168 Mhz */
  SystemClock_Config();
  
  /* Initialize LCD and LEDs */
  BSP_Config();
  
  /* Initialize RTC and Backup */
  RTC_Init();
  
  /* Init the STemWin GUI Library */
  GUI_Init();
  GUI_Initialized = 1;
  
  /* Activate the use of memory device feature */
  WM_SetCreateFlags(WM_CF_MEMDEV);

  /* Do the calibration if needed */
  CALIBRATION_Check();
  
  /* Start Demo */
  GUIDEMO_Main();
  
  /* Infinite loop */
  for(;;);
}
開發者ID:chsigi,項目名稱:blindschleiche,代碼行數:40,代碼來源:main.c

示例6: main

/**
  * @brief  Main program
  * @param  None
  * @retval None
  */
int main(void)
{
  /* STM32F4xx HAL library initialization:
       - Configure the Flash prefetch, instruction and Data caches
       - Configure the Systick to generate an interrupt each 1 msec
       - Set NVIC Group Priority to 4
       - Global MSP (MCU Support Package) initialization
     */
  HAL_Init();

  /* Configure the system clock to 168 MHz */
  SystemClock_Config();

  /* Configure the BSP */
  BSP_Config();

  /* Initialize the LwIP stack */
  lwip_init();

  /* Configure the Network interface */
  Netif_Config();

  /* Initialize the TFTP server */
  tftpd_init();

  /* Notify user about the network interface config */
  User_notification(&gnetif);

  /* Link the SD Card disk I/O driver */
  FATFS_LinkDriver(&SD_Driver, SD_Path);

  /* Infinite loop */
  while (1)
  {
    /* Read a received packet from the Ethernet buffers and send it
    to the lwIP for handling */
    ethernetif_input(&gnetif);

    /* Handle timeouts */
    sys_check_timeouts();

#ifdef USE_DHCP
    /* handle periodic timers for LwIP */
    DHCP_Periodic_Handle(&gnetif);
#endif
  }
}
開發者ID:Joe-Merten,項目名稱:Stm32-Tools-Evaluation,代碼行數:52,代碼來源:main.c

示例7: main

/**
  * @brief  Main program
  * @param  None
  * @retval None
  */
int main(void)
{
    /* Enable the CPU Cache */
    CPU_CACHE_Enable();

    /* STM32F7xx HAL library initialization:
         - Configure the Flash ART accelerator on ITCM interface
         - Configure the Systick to generate an interrupt each 1 msec
         - Set NVIC Group Priority to 4
         - Global MSP (MCU Support Package) initialization
       */
    HAL_Init();

    /* Configure the system clock to 200 MHz */
    SystemClock_Config();

    /* Configure the BSP */
    BSP_Config();

    /* Initialize the LwIP stack */
    lwip_init();

    /* Configure the Network interface */
    Netif_Config();

    /* Http webserver Init */
    httpd_init();

    /* Notify user about the network interface config */
    User_notification(&gnetif);

    /* Infinite loop */
    while (1)
    {
        /* Read a received packet from the Ethernet buffers and send it
           to the lwIP for handling */
        ethernetif_input(&gnetif);

        /* Handle timeouts */
        sys_check_timeouts();

#ifdef USE_DHCP
        /* handle periodic timers for DHCP */
        DHCP_Periodic_Handle(&gnetif);
#endif
    }
}
開發者ID:vlsi1217,項目名稱:STM32F7Cube,代碼行數:52,代碼來源:main.c

示例8: main

/**
  * @brief  Main program
  * @param  None
  * @retval None
  */
int main(void)
{
  /* STM32F4xx HAL library initialization:
       - Configure the Flash prefetch, instruction and Data caches
       - Configure the Systick to generate an interrupt each 1 msec
       - Set NVIC Group Priority to 4
       - Global MSP (MCU Support Package) initialization
     */
  HAL_Init();  
  
  /* Configure the system clock to 180 MHz */
  SystemClock_Config();
  
  /* Configure the BSP */
  BSP_Config();
    
  /* Initilaize the LwIP stack */
  lwip_init();
  
  /* Configure the Network interface */
  Netif_Config();
  
  /* tcp echo server Init */
  udp_echoserver_init();
  
  /* Notify user about the netwoek interface config */
  User_notification(&gnetif);
  
  /* Infinite loop */
  while (1)
  {  
    /* Read a received packet from the Ethernet buffers and send it 
       to the lwIP for handling */
    ethernetif_input(&gnetif);

    /* Handle timeouts */
    sys_check_timeouts();
  }
}
開發者ID:eemei,項目名稱:library-stm32f4,代碼行數:44,代碼來源:main.c

示例9: StartThread

/**
  * @brief  Start Thread
  * @param  argument not used
  * @retval None
  */
static void StartThread(void const * argument)
{
    /* Initialize LCD and LEDs */
    BSP_Config();

    /* Create tcp_ip stack thread */
    tcpip_init(NULL, NULL);

    /* Initialize the LwIP stack */
    Netif_Config();

    /* Initialize webserver demo */
    http_server_socket_init();

    /* Notify user about the network interface config */
    User_notification(&gnetif);

#ifdef USE_DHCP
    /* Start DHCPClient */
#if defined(__GNUC__)
    osThreadDef(DHCP, DHCP_thread, osPriorityBelowNormal, 0, configMINIMAL_STACK_SIZE * 5);
#else
    osThreadDef(DHCP, DHCP_thread, osPriorityBelowNormal, 0, configMINIMAL_STACK_SIZE * 2);
#endif

    osThreadCreate (osThread(DHCP), &gnetif);
#endif

    /* Start toogleLed4 task : Toggle LED4  every 250ms */
    osThreadDef(LED4, ToggleLed4, osPriorityLow, 0, configMINIMAL_STACK_SIZE);
    osThreadCreate (osThread(LED4), NULL);

    for( ;; )
    {
        /* Delete the Init Thread */
        osThreadTerminate(NULL);
    }
}
開發者ID:RadMie,項目名稱:STM32F7DiscoveryBase,代碼行數:43,代碼來源:main.c

示例10: main

/**
  * @brief  Main program
  * @param  None
  * @retval None
  */
int main(void)
{
  /* Configure Key Button */      
  BSP_PB_Init(BUTTON_KEY, BUTTON_MODE_GPIO);  
  
  /* Test if Key push-button is not pressed */
  if (BSP_PB_GetState(BUTTON_KEY) != 0x00)
  { /* Key push-button not pressed: jump to user application */
    
    /* Check if valid stack address (RAM address) then jump to user application */
    if (((*(__IO uint32_t*)USER_FLASH_FIRST_PAGE_ADDRESS) & 0x2FFE0000 ) == 0x20000000)
    {
      /* Jump to user application */
      JumpAddress = *(__IO uint32_t*) (USER_FLASH_FIRST_PAGE_ADDRESS + 4);
      Jump_To_Application = (pFunction) JumpAddress;
      /* Initialize user application's Stack Pointer */
      __set_MSP(*(__IO uint32_t*) USER_FLASH_FIRST_PAGE_ADDRESS);
      Jump_To_Application();
      /* do nothing */
      while(1);
    }
    else
    {/* Otherwise, do nothing */
      /* LED3 (RED) ON to indicate bad software (when not valid stack address) */
      BSP_LED_Init(LED3);
      BSP_LED_On(LED3);
      /* do nothing */
      while(1);
    }
  }
  /* Enter in IAP mode */
  else
  {
    /* STM32F4xx HAL library initialization:
       - Configure the Flash prefetch, instruction and Data caches
       - Configure the Systick to generate an interrupt each 1 msec
       - Set NVIC Group Priority to 4
       - Global MSP (MCU Support Package) initialization
     */
    HAL_Init();  
    
    /* Configure the system clock to 168 MHz */
    SystemClock_Config();
    
    /* Configure the BSP */
    BSP_Config();
    
    /* Initialize the LwIP stack */
    lwip_init();
    
    /* Configure the Network interface */
    Netif_Config();
    
#ifdef USE_IAP_HTTP
    /* Initialize the webserver module */
    IAP_httpd_init();
#endif
    
#ifdef USE_IAP_TFTP    
    /* Initialize the TFTP server */
    IAP_tftpd_init();
#endif  
    
    /* Notify user about the network interface config */
    User_notification(&gnetif);
    
    /* Infinite loop */
    while (1)
    {
    /* Read a received packet from the Ethernet buffers and send it 
       to the lwIP for handling */
    ethernetif_input(&gnetif);

    /* Handle timeouts */
    sys_check_timeouts();

#ifdef USE_DHCP
    /* handle periodic timers for LwIP */
    DHCP_Periodic_Handle(&gnetif);
#endif 
    }
  }
}
開發者ID:pierreroth64,項目名稱:STM32Cube_FW_F4,代碼行數:88,代碼來源:main.c

示例11: main

/**
  * @brief  Main program.
  * @param  None
  * @retval None
  */
int main(void)
{  
  /* STM32F4xx HAL library initialization:
       - Configure the Flash prefetch, instruction and Data caches
       - Configure the Systick to generate an interrupt each 1 msec
       - Set NVIC Group Priority to 4
       - Global MSP (MCU Support Package) initialization
     */
  HAL_Init();  
  
  /* Configure the system clock to 180 Mhz */
  SystemClock_Config();
  
  /* Initialize LCD and LEDs */
  BSP_Config();
  
  /***********************************************************/
  
  /* Compute the prescaler value to have TIM3 counter clock equal to 10 KHz */
  uwPrescalerValue = (uint32_t) ((SystemCoreClock /2) / 10000) - 1;
  
  /* Set TIMx instance */
  TimHandle.Instance = TIM3;
   
  /* Initialize TIM3 peripheral as follows:
       + Period = 500 - 1
       + Prescaler = ((SystemCoreClock/2)/10000) - 1
       + ClockDivision = 0
       + Counter direction = Up
  */
  TimHandle.Init.Period = 500 - 1;
  TimHandle.Init.Prescaler = uwPrescalerValue;
  TimHandle.Init.ClockDivision = 0;
  TimHandle.Init.CounterMode = TIM_COUNTERMODE_UP;
  if(HAL_TIM_Base_Init(&TimHandle) != HAL_OK)
  {
    while(1) 
    {
    }
  }
  
  /*##-2- Start the TIM Base generation in interrupt mode ####################*/
  /* Start Channel1 */
  if(HAL_TIM_Base_Start_IT(&TimHandle) != HAL_OK)
  {
    while(1) 
    {
    }
  }
  
  /***********************************************************/

  
  /* Initialize RTC and Backup */
  RTC_Init();
  
  /* Init the STemWin GUI Library */
  GUI_Init();
  GUI_Initialized = 1;
  
  /* Activate the use of memory device feature */
  WM_SetCreateFlags(WM_CF_MEMDEV);

  /* Do the calibration if needed */
  CALIBRATION_Check();
  
  /* Start Demo */
  GUIDEMO_Main();
  
  /* Infinite loop */
  for(;;);
}
開發者ID:pierreroth64,項目名稱:STM32Cube_FW_F4,代碼行數:77,代碼來源:main.c

示例12: main

/**
  * @brief  Main program.
  * @param  None
  * @retval None
  */
int main(void)
{
    /* STM32F4xx HAL library initialization:
         - Configure the Flash prefetch, instruction and Data caches
         - Configure the Systick to generate an interrupt each 1 msec
         - Set NVIC Group Priority to 4
         - Global MSP (MCU Support Package) initialization
       */
    HAL_Init();

    /* Configure the system clock to 180 MHz */
    SystemClock_Config();

    /* Initialize LCD and LEDs */
    BSP_Config();

    /***********************************************************/

    /* Compute the prescaler value to have TIM3 counter clock equal to 10 KHz */
    uwPrescalerValue = (uint32_t) ((SystemCoreClock /2) / 10000) - 1;

    /* Set TIMx instance */
    TimHandle.Instance = TIM3;

    /* Initialize TIM3 peripheral as follows:
         + Period = 500 - 1
         + Prescaler = ((SystemCoreClock/2)/10000) - 1
         + ClockDivision = 0
         + Counter direction = Up
    */
    TimHandle.Init.Period = 500 - 1;
    TimHandle.Init.Prescaler = uwPrescalerValue;
    TimHandle.Init.ClockDivision = 0;
    TimHandle.Init.CounterMode = TIM_COUNTERMODE_UP;
    if(HAL_TIM_Base_Init(&TimHandle) != HAL_OK)
    {
        while(1)
        {
        }
    }

    /*##-2- Start the TIM Base generation in interrupt mode ####################*/
    /* Start Channel1 */
    if(HAL_TIM_Base_Start_IT(&TimHandle) != HAL_OK)
    {
        while(1)
        {
        }
    }

    /***********************************************************/

    /* Init the STemWin GUI Library */
    BSP_SDRAM_Init(); /* Initializes the SDRAM device */
    __HAL_RCC_CRC_CLK_ENABLE(); /* Enable the CRC Module */

    GUI_Init();

    GUI_SetFont(&GUI_Font32_ASCII);

    GUI_DispStringAt("Starting...", 0, 0);

    /* Initialize LCD and LEDs */
    GUI_DispStringAt("Initializing lcd...", 0, 32);

    /* Activate the use of memory device feature */
    WM_SetCreateFlags(WM_CF_MEMDEV);

    MainTask();

    /* Infinite loop */
    for(;;);
}
開發者ID:PaxInstruments,項目名稱:STM32CubeF4,代碼行數:78,代碼來源:main.c


注:本文中的BSP_Config函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。