当前位置: 首页>>代码示例>>C++>>正文


C++ BSP_IO_Init函数代码示例

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


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

示例1: main

/**
  * @brief  Main program
  * @param  None
  * @retval None
  */
int main(void)
{
  /* STM32F469xx HAL library initialization */
  HAL_Init();

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

  /* Initialize IO expander (MFX) */
  BSP_IO_Init();

  /* Configure LED1, LED2, LED3 and LED4 */
  BSP_LED_Init(LED1);
  BSP_LED_Init(LED2);
  BSP_LED_Init(LED3);
  BSP_LED_Init(LED4);

  /* Initialize IO expander */
  BSP_IO_Init();

  /* Initialize Joystick */
  if (BSP_JOY_Init(JOY_MODE_GPIO) == 0)
  {
    JoyButtonInitialized = 1;
  }

  /* Init CDC Application */
  USBD_Init(&USBD_Device_HS, &VCP_Desc, 1);

  /* Init HID Application */
  USBD_Init(&USBD_Device_FS, &HID_Desc, 0);

  /* Add Supported Classes */
  USBD_RegisterClass(&USBD_Device_HS, &USBD_CDC);
  USBD_RegisterClass(&USBD_Device_FS, &USBD_HID);

    /* Add CDC Interface Class */
  USBD_CDC_RegisterInterface(&USBD_Device_HS, &USBD_CDC_fops);

  /* Start Device Process */
  USBD_Start(&USBD_Device_FS);
  USBD_Start(&USBD_Device_HS);

  /* Run Application (Interrupt mode) */
  while (1)
  {
    Toggle_Leds();
    if(HID_SendReport == 1)
    {
      HID_SendReport = 0;
      GetPointerData(HID_Buffer);

      /* Send data though IN endpoint*/
      if((HID_Buffer[1] != 0) || (HID_Buffer[2] != 0))
      {
        USBD_HID_SendReport(&USBD_Device_FS, HID_Buffer, 4);
      }
    }
  }
}
开发者ID:Joe-Merten,项目名称:Stm32-Tools-Evaluation,代码行数:65,代码来源:main.c

示例2: BSP_InitIO

void  BSP_InitIO (void)    
{
#ifdef _TARGET_440H
	BSP_IO_Init();
	LCD_Init();
	Tmr_Init();
    LED_Init();                                                         /* Initialize LEDs                                  */
	LS2_UART_Init();
#else
	SYSTEMConfig(BSP_CLK_FREQ, SYS_CFG_WAIT_STATES | SYS_CFG_PCACHE);
	
    BSP_IO_Init(); 
#ifndef AX12_REG_PROGRAMMING                                                     // Initialize the board's I/Os
    Tmr_Init();                                                         // Initialize the timers
    BSP_InitIntCtrl();                                                  // Initialize the interrupt controller
#endif

    LED_Init();                                                         // Initialize LEDs
    //PB_Init();                                                        // Initialize the push buttons
    ADC_Init();
	PMP_Init();
	LS2_UART_Init();
	PWM_Init();
#endif
}
开发者ID:Vanganesha,项目名称:oufffteam,代码行数:25,代码来源:bsp.c

示例3: BSP_TS_ITConfig

/**
  * @brief  Configures and enables the touch screen interrupts.
  * @retval TS_OK if all initializations are OK. Other value if error.
  */
uint8_t BSP_TS_ITConfig(void)
{
  uint8_t ts_status = TS_ERROR;
  uint8_t io_status = IO_ERROR;

  /* Initialize the IO */
  io_status = BSP_IO_Init();
  if(io_status != IO_OK)
  {
    return (ts_status);
  }

  /* Configure TS IT line IO : is active low on FT6206 (see data sheet)                           */
  /* Configure TS_INT_PIN (MFX_IO_14) low level to generate MFX_IRQ_OUT in EXTI on MCU            */
  /* This will call HAL_GPIO_EXTI_Callback() that is setting variable 'mfx_exti_received' to 1b1' */
  io_status = BSP_IO_ConfigPin(TS_INT_PIN, IO_MODE_IT_LOW_LEVEL_PU);
  if(io_status != IO_OK)
  {
    return (ts_status);
  }

  /* Enable the TS in interrupt mode */
  /* In that case the INT output of FT6206 when new touch is available */
  /* is active low and directed on MFX IO14 */
  ts_driver->EnableIT(I2C_Address);

  /* If arrived here : set good status on exit */
  ts_status = TS_OK;

  return (ts_status);
}
开发者ID:robbie-cao,项目名称:stm32f4-discovery,代码行数:35,代码来源:stm32469i_eval_ts.c

示例4: BSP_TS_Init

/**
  * @brief  Initializes and configures the touch screen functionalities and 
  *         configures all necessary hardware resources (GPIOs, clocks..).
  * @param  xSize: Maximum X size of the TS area on LCD
  * @param  ySize: Maximum Y size of the TS area on LCD  
  * @retval TS_OK if all initializations are OK. Other value if error.
  */
uint8_t BSP_TS_Init(uint16_t xSize, uint16_t ySize)
{
  uint8_t mfxstm32l152_id = 0;
  
  tsBundaryX = xSize;
  tsBundaryY = ySize;

  /* Initialize IO functionalities (MFX) used by TS */
  BSP_IO_Init(); 
  
  /* Read ID and verify if the IO expander is ready */
  mfxstm32l152_id = mfxstm32l152_io_drv.ReadID(IO_I2C_ADDRESS);
  if((mfxstm32l152_id == MFXSTM32L152_ID_1) || (mfxstm32l152_id == MFXSTM32L152_ID_2))
  { 
    /* Initialize the TS driver structure */
    ts_driver = &mfxstm32l152_ts_drv;  
    AddressI2C = TS_I2C_ADDRESS;
    tsOrientation = TS_SWAP_NONE;
  }

  
  /* Initialize the TS driver */
  ts_driver->Init(AddressI2C);
  ts_driver->Start(AddressI2C);
  
  return TS_OK;
}
开发者ID:jaggies,项目名称:matchbox,代码行数:34,代码来源:stm32446e_eval_ts.c

示例5: main

/**
  * @brief  Main program
  * @param  None
  * @retval None
  */
int main(void)
{
  /* STM32F446xx HAL library initialization */
  HAL_Init();
  
  /* Configure the system clock to 180 Mhz */
  SystemClock_Config();
  
  /* Initialize IO expander */
  BSP_IO_Init();

  /* Init HID Application */
  HID_InitApplication();

  /* Init Host Library */
  USBH_Init(&hUSBHost, USBH_UserProcess, 0);
  
  /* Add Supported Class */
  USBH_RegisterClass(&hUSBHost, USBH_HID_CLASS);
  
  /* Start Host Process */
  USBH_Start(&hUSBHost);
  
  /* Run Application (Blocking mode) */
  while (1)
  {
    /* USB Host Background task */
    USBH_Process(&hUSBHost); 
     
    /* HID Menu Process */
    HID_MenuProcess();
  }
}
开发者ID:pierreroth64,项目名称:STM32Cube_FW_F4,代码行数:38,代码来源:main.c

示例6: 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
       - Low Level Initialization
     */
  HAL_Init();
  
  /* Configure the System clock to have a frequency of 200 Mhz */
  SystemClock_Config();
  
  /* Initialize IO expander */
  BSP_IO_Init();
  
  /* Start task */
  osThreadDef(USER_Thread, StartThread, osPriorityNormal, 0, 8 * configMINIMAL_STACK_SIZE);
  osThreadCreate(osThread(USER_Thread), NULL);
  
  /* Create Application Queue */
  osMessageQDef(osqueue, 1, uint16_t);
  AppliEvent = osMessageCreate(osMessageQ(osqueue), NULL);
  
  /* Start scheduler */
  osKernelStart();
  
  /* We should never get here as control is now taken by the scheduler */
  for( ;; );
}
开发者ID:MrZANE42,项目名称:verisure1512,代码行数:38,代码来源:main.c

示例7: main

/**
  * @brief  Main program
  * @param  None
  * @retval None
  */
int main(void)
{ 
  /* STM32F446xx HAL library initialization */
  HAL_Init();
  
  /* Configure the system clock to 180 MHz */
  SystemClock_Config();
    
  /* Initialize IO expander */
  BSP_IO_Init();

  /* Init Device Library */
  USBD_Init(&USBD_Device, &MSC_Desc, 0);
  
  /* Add Supported Class */
  USBD_RegisterClass(&USBD_Device, USBD_MSC_CLASS);
  
  /* Add Storage callbacks for MSC Class */
  USBD_MSC_RegisterStorage(&USBD_Device, &USBD_DISK_fops);
  
  /* Start Device Process */
  USBD_Start(&USBD_Device);
  
  /* Run Application (Interrupt mode) */
  while (1)
  {
  }
}
开发者ID:eemei,项目名称:library-stm32f4,代码行数:33,代码来源:main.c

示例8: main

/**
  * @brief  Main program
  * @param  None
  * @retval None
  */
int main(void)
{
    /* STM32F446xx HAL library initialization */
    HAL_Init();

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

    /* Initialize IO expander */
    BSP_IO_Init();

    /* Start task */
    osThreadDef(USER_Thread, StartThread, osPriorityNormal, 0, 8 * configMINIMAL_STACK_SIZE);
    osThreadCreate(osThread(USER_Thread), NULL);

    /* Create Application Queue */
    osMessageQDef(osqueue, 1, uint16_t);
    AppliEvent = osMessageCreate(osMessageQ(osqueue), NULL);

    /* Start scheduler */
    osKernelStart();

    /* We should never get here as control is now taken by the scheduler */
    for( ;; );
}
开发者ID:PaxInstruments,项目名称:STM32CubeF4,代码行数:30,代码来源:main.c

示例9: 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 the IO module*/
  BSP_IO_Init ();
  
  /* Configure LED1 and LED3 */
  BSP_LED_Init(LED1);
  BSP_LED_Init(LED3);  
  
  /*##-1- Link the USB Host disk I/O driver ##################################*/
  if(FATFS_LinkDriver(&USBH_Driver, USBDISKPath) == 0)
  {
    /*##-2- Init Host Library ################################################*/
    USBH_Init(&hUSB_Host, USBH_UserProcess, 0);
    
    /*##-3- Add Supported Class ##############################################*/
    USBH_RegisterClass(&hUSB_Host, USBH_MSC_CLASS);
    
    /*##-4- Start Host Process ###############################################*/
    USBH_Start(&hUSB_Host);
    
    /*##-5- Run Application (Blocking mode) ##################################*/
    while (1)
    {
      /* USB Host Background task */
      USBH_Process(&hUSB_Host);
      
      /* Mass Storage Application State Machine */
      switch(Appli_state)
      {
      case APPLICATION_START:
        MSC_Application();
        Appli_state = APPLICATION_IDLE;
        break;
         
      case APPLICATION_IDLE:
      default:
        break;      
      }
    }
  }

  /* Infinite loop */
  while (1)
  {
  }
    
}
开发者ID:Lembed,项目名称:STM32CubeF4-mirrors,代码行数:64,代码来源:main.c

示例10: SD_Detect_MspInit

/**
  * @brief  Initializes the SD Detect pin MSP.
  * @param  hsd: SD handle
  * @param  Params
  * @retval None
  */
static void SD_Detect_MspInit(void)
{
  if (BSP_IO_Init() == IO_ERROR)
  {
    BSP_ErrorHandler();
  }
  BSP_IO_ConfigPin(SD_DETECT_PIN, IO_MODE_INPUT_PU);
}
开发者ID:cyysu,项目名称:AliOS-Things,代码行数:14,代码来源:stm32l496g_discovery_sd.c

示例11: BSP_CAMERA_Init

/**
  * @brief  Initializes the camera.
  * @param  uint32_t Resolution : camera sensor requested resolution (x, y) : standard resolution
  *         naming QQVGA, QVGA, VGA ...
  *
  * @retval Camera status
  */
uint8_t BSP_CAMERA_Init(uint32_t Resolution)
{ 
  DCMI_HandleTypeDef *phdcmi;
  uint8_t status = CAMERA_ERROR;

  /* Get the DCMI handle structure */
  phdcmi = &hDcmiEval;

  /*** Configures the DCMI to interface with the camera module ***/
  /* DCMI configuration */
  phdcmi->Init.CaptureRate      = DCMI_CR_ALL_FRAME;
  phdcmi->Init.HSPolarity       = DCMI_HSPOLARITY_HIGH;
  phdcmi->Init.SynchroMode      = DCMI_SYNCHRO_HARDWARE;
  phdcmi->Init.VSPolarity       = DCMI_VSPOLARITY_HIGH;
  phdcmi->Init.ExtendedDataMode = DCMI_EXTEND_DATA_8B;
  phdcmi->Init.PCKPolarity      = DCMI_PCKPOLARITY_RISING;
  phdcmi->Instance              = DCMI;

  /* Configure IO functionalities for CAMERA detect pin */
  BSP_IO_Init(); 
  
  /* Apply Camera Module hardware reset */
  BSP_CAMERA_HwReset();

  /* Check if the CAMERA Module is plugged on board */
  if(BSP_IO_ReadPin(CAM_PLUG_PIN) == BSP_IO_PIN_SET)
  {
    status = CAMERA_NOT_DETECTED;
    return status; /* Exit with error */
  }

  /* Read ID of Camera module via I2C */
  if (s5k5cag_ReadID(CAMERA_I2C_ADDRESS) == S5K5CAG_ID)
  {
    /* Initialize the camera driver structure */
    camera_drv = &s5k5cag_drv;
    CameraHwAddress = CAMERA_I2C_ADDRESS;

    /* DCMI Initialization */
    BSP_CAMERA_MspInit(&hDcmiEval, NULL);
    HAL_DCMI_Init(phdcmi);

    /* Camera Module Initialization via I2C to the wanted 'Resolution' */
    camera_drv->Init(CameraHwAddress, Resolution);

    CameraCurrentResolution = Resolution;

    /* Return CAMERA_OK status */
    status = CAMERA_OK;
  }
  else
  {
    /* Return CAMERA_NOT_SUPPORTED status */
	status = CAMERA_NOT_SUPPORTED;
  }

  return status;
}
开发者ID:ASzz,项目名称:verisure1512,代码行数:65,代码来源:stm32756g_eval_camera.c

示例12: AUDIO_InitApplication

/**
  * @brief  Audio Application Init.
  * @param  None
  * @retval None
  */
static void AUDIO_InitApplication(void)
{
  /* Configure Key Button */
  BSP_PB_Init(BUTTON_KEY, BUTTON_MODE_EXTI);              
  
  /* Configure IO and LED1 */
  BSP_IO_Init();
  BSP_LED_Init(LED1);
  BSP_LED_Init(LED4);
 
  /* Configure Joystick in EXTI mode */
  BSP_JOY_Init(JOY_MODE_EXTI);
  
  /* Camera has to be powered down as some signals use same GPIOs between
   * I2S signals and camera bus. Camera drives its signals to low impedance
   * when powered ON. So the camera is powered off to let its signals
   * in high impedance */

  /* Camera power down sequence */
  BSP_IO_ConfigPin(RSTI_PIN, IO_MODE_OUTPUT);
  BSP_IO_ConfigPin(XSDN_PIN, IO_MODE_OUTPUT);

  /* De-assert the camera STANDBY pin (active high) */
  BSP_IO_WritePin(XSDN_PIN, BSP_IO_PIN_RESET);

  /* Assert the camera RSTI pin (active low) */
  BSP_IO_WritePin(RSTI_PIN, BSP_IO_PIN_RESET);

  /* Initialize the LCD */
  BSP_LCD_Init();
  
  /* LCD Layer Initialization */
  BSP_LCD_LayerDefaultInit(1, LCD_FB_START_ADDRESS); 
  
  /* Select the LCD Layer */
  BSP_LCD_SelectLayer(1);
  
  /* Enable the display */
  BSP_LCD_DisplayOn();
  
  /* Init the LCD Log module */
  LCD_LOG_Init();
  
  LCD_LOG_SetHeader((uint8_t *)"Audio Playback and Record Application");
  
  LCD_UsrLog("USB Host library started.\n"); 
  
  /* Start Audio interface */
  USBH_UsrLog("Starting Audio Demo");
  
  /* Init Audio interface */
  AUDIO_PLAYER_Init();
  
  /* Start Audio interface */
  AUDIO_MenuInit();
}
开发者ID:acrepina,项目名称:STM32F7_serverWEB,代码行数:61,代码来源:main.c

示例13: BSP_TS_ITConfig

/**
  * @brief  Configures and enables the touch screen interrupts.
  * @retval TS_OK if all initializations are OK. Other value if error.
  */
uint8_t BSP_TS_ITConfig(void)
{
  /* Initialize the IO */
  BSP_IO_Init();
    
  /* Enable the TS ITs */
  ts_driver->EnableIT(AddressI2C);

  return TS_OK;  
}
开发者ID:jaggies,项目名称:matchbox,代码行数:14,代码来源:stm32446e_eval_ts.c

示例14: main

/**
  * @brief  Main program
  * @param  None
  * @retval None
  */
int main(void)
{
  /* Configure Key Button */
  BSP_PB_Init(BUTTON_KEY, BUTTON_MODE_GPIO);

  /* Unlock the Flash to enable the flash control register access */
  FLASH_If_FlashUnlock();

  /* Test if User button on the STM32446E_EVAL is pressed */
  if (BSP_PB_GetState(BUTTON_KEY) != GPIO_PIN_SET)
  {
    /* Check Vector Table: Test if user code is programmed starting from address
    "APPLICATION_ADDRESS" */
    if (((*(__IO uint32_t*)APPLICATION_ADDRESS) & 0xFF000000 ) == 0x20000000)
    {
      /* Jump to user application */
      JumpAddress = *(__IO uint32_t*) (APPLICATION_ADDRESS + 4);
      Jump_To_Application = (pFunction) JumpAddress;
      /* Initialize user application's Stack Pointer */
      __set_MSP(*(__IO uint32_t*) APPLICATION_ADDRESS);
      Jump_To_Application();
    }
  }

  /* STM32F446xx HAL library initialization */
  HAL_Init();

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

  /* Initialize IO expander */
  BSP_IO_Init();

  /* Init FW upgrade Application */
  FW_InitApplication();

  /* Init Host Library */
  USBH_Init(&hUSBHost, USBH_UserProcess, 0);

  /* Add Supported Class */
  USBH_RegisterClass(&hUSBHost, USBH_MSC_CLASS);

  /* Start Host Process */
  USBH_Start(&hUSBHost);

  /* Run Application (Blocking mode)*/
  while (1)
  {
    /* USB Host Background task */
    USBH_Process(&hUSBHost);

    /* FW Menu Process */
    FW_UPGRADE_Process();
  }
}
开发者ID:Joe-Merten,项目名称:Stm32-Tools-Evaluation,代码行数:60,代码来源:main.c

示例15: SD_Detect_MspDeInit

/**
  * @brief  Initializes the SD Detect pin MSP.
  * @param  hsd: SD handle
  * @param  Params
  * @retval None
  */
static void SD_Detect_MspDeInit(void)
{
  /* Disable all interrupts */
  /*HAL_NVIC_DisableIRQ(MFX_INT_EXTI_IRQn);*/

  if (BSP_IO_Init() == IO_ERROR)
  {
    BSP_ErrorHandler();
  }
  BSP_IO_ConfigPin(SD_DETECT_PIN, IO_MODE_ANALOG);
}
开发者ID:cyysu,项目名称:AliOS-Things,代码行数:17,代码来源:stm32l496g_discovery_sd.c


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