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


C++ BSP_JOY_Init函数代码示例

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


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

示例1: LowPowerStopRTCAlarm

/**
  * @brief  Enter in stop mode and exit by an alarm
  * @param  None
  * @note   This example enter in stop mode.  
  * @retval None
  */
void LowPowerStopRTCAlarm(void)
{
  kWindow_Popup("STOP Alarme", LCD_COLOR_WHITE, LCD_COLOR_BLUE,\
                "\nset delay time\n",                          \
                LCD_COLOR_BLUE, LCD_COLOR_WHITE ); 
  
  /* set the alarm */
  LowPowerHandleAlarm();
  
  kWindow_Popup("STOP Alarm", LCD_COLOR_WHITE, LCD_COLOR_BLUE, \
                "\n\nstop mode\nstarted\nwait alarm\nto exit\n",        \
                LCD_COLOR_BLUE, LCD_COLOR_WHITE );  
  
  BSP_JOY_Init(JOY_MODE_GPIO);  
  
  /* Enter Stop Mode */
  HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFE);
  
  /* Restore the clock configuration */
  SystemClock_STOPExit();
  
  HAL_RTC_DeactivateAlarm(&RtcHandle, RTC_ALARM_A);
  /* Clear the Alarm interrupt pending bit */
  __HAL_RTC_ALARM_CLEAR_FLAG(&RtcHandle,RTC_FLAG_ALRAF);
  /* Clear the EXTI's line Flag for RTC Alarm */
  __HAL_RTC_EXTI_CLEAR_FLAG(RTC_EXTI_LINE_ALARM_EVENT);
  
  BSP_JOY_Init(JOY_MODE_EXTI);
}
开发者ID:GreyCardinalRus,项目名称:stm32-cube,代码行数:35,代码来源:lowpower_app.c

示例2: LowPowerStopEXTI

/**
  * @brief  Enter in stop mode and exit by pressingf the tamper button
  * @param  None
  * @note   This example enter in stop mode.  
  * @retval None
  */
void LowPowerStopEXTI(void)
{
  kWindow_Popup("STOP EXTI", LCD_COLOR_WHITE, LCD_COLOR_BLUE,        \
                "\n\nPres JOY sel to\nstart\nstop mode\n", \
                 LCD_COLOR_WHITE, LCD_COLOR_BLUE );
  HAL_Delay(100);
  user_event = JOY_UP;
  while(user_event != JOY_SEL)
  {
    user_action = 0;
  };

  kWindow_Popup("STOP EXTI", LCD_COLOR_WHITE, LCD_COLOR_BLUE,        \
                "\n\nstop mode\nstarted\npress tamper\nto exit\n", \
                 LCD_COLOR_BLUE, LCD_COLOR_WHITE );  
  
  /* User push-button (EXTI_Line0) will be used to wakeup the system from STOP mode */
  BSP_PB_Init(BUTTON_TAMPER, BUTTON_MODE_EXTI);
  /* avoid wakeup from JOY event */
  BSP_JOY_Init(JOY_MODE_GPIO);  
  
  /* Clear PWR wake up Flag */
  __HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
  
  /* Enter Stop Mode */
  HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
  
  /* Restore the clock configuration */
  SystemClock_STOPExit();
  
  /* User push-button (EXTI_Line0) will be used to wakeup the system from STOP mode */
  BSP_PB_Init(BUTTON_TAMPER, BUTTON_MODE_GPIO);  
  BSP_JOY_Init(JOY_MODE_EXTI);  
}
开发者ID:GreyCardinalRus,项目名称:stm32-cube,代码行数:40,代码来源:lowpower_app.c

示例3: DUAL_InitApplication

/**
  * @brief  DUALCORE application Init.
  * @param  None
  * @retval None
  */
static void DUAL_InitApplication(void)
{
  /* Configure KEY Button */
  BSP_PB_Init(BUTTON_KEY, BUTTON_MODE_GPIO);                
  
  /* Configure Joystick in EXTI mode */
  BSP_JOY_Init(JOY_MODE_EXTI);
  
  /* Configure the LEDs */
  BSP_LED_Init(LED1);
  BSP_LED_Init(LED2);
  BSP_LED_Init(LED3);
  BSP_LED_Init(LED4);
  
  /* Initialize the LCD */
  BSP_LCD_Init();
  
  /* Initialize the LCD Log module */
  LCD_LOG_Init();
  
  LCD_LOG_SetHeader((uint8_t *)" USB OTG DualCore Host");
  
  LCD_UsrLog("USB Host library started.\n"); 
  
  /* Start DualCore Interface */
  USBH_UsrLog("Initializing hardware....");
  DUAL_MenuInit(); 
}
开发者ID:EarnestHein89,项目名称:STM32Cube_FW_F4,代码行数:33,代码来源:main.c

示例4: 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

示例5: MSC_InitApplication

/**
  * @brief  MSC application Init.
  * @param  None
  * @retval None
  */
static void MSC_InitApplication(void)
{
  /* Configure Key Button */
  BSP_PB_Init(BUTTON_KEY, BUTTON_MODE_GPIO);                
  
  /* Configure Joystick in EXTI mode */
  BSP_JOY_Init(JOY_MODE_EXTI);
    
  /* Initialize the LCD */
  BSP_LCD_Init();
  
  /* Initialize the LCD Log module */
  LCD_LOG_Init();
  
#ifdef USE_USB_HS 
  LCD_LOG_SetHeader((uint8_t *)" USB OTG HS MSC Host");
#else
  LCD_LOG_SetHeader((uint8_t *)" USB OTG FS MSC Host");
#endif
  
  LCD_UsrLog("USB Host library started.\n"); 
  
  /* Initialize menu and MSC process */
  USBH_UsrLog("Starting MSC Demo");
  Menu_Init();
}
开发者ID:451506709,项目名称:automated_machine,代码行数:31,代码来源:main.c

示例6: DynamicSwitch_InitApplication

/**
  * @brief  DS application Init.
  * @param  None
  * @retval None
  */
static void DynamicSwitch_InitApplication(void)
{
    /* Configure Key Button */
    BSP_PB_Init(BUTTON_KEY, BUTTON_MODE_EXTI);

    /* Configure Joystick in EXTI mode */
    BSP_JOY_Init(JOY_MODE_EXTI);

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

    /* Initialize the LCD */
    BSP_LCD_Init();

    /* Initialize the LCD Log module */
    LCD_LOG_Init();

#ifdef USE_USB_HS
    LCD_LOG_SetHeader((uint8_t *)" USB HS DynamicSwitch Host");
#else
    LCD_LOG_SetHeader((uint8_t *)" USB FS DynamicSwitch Host");
#endif

    LCD_UsrLog("USB Host library started.\n");

    /* Start Dynamic Switch Interface */
    LCD_UsrLog("Starting DynamicSwitch Demo\n");
    LCD_UsrLog("Plug your device To Continue...\n");
}
开发者ID:PaxInstruments,项目名称:STM32CubeF4,代码行数:37,代码来源:main.c

示例7: HID_InitApplication

/**
  * @brief  HID application Init
  * @param  None
  * @retval None
  */
static void HID_InitApplication(void)
{
  /* Configure KEY Button */
  BSP_PB_Init(BUTTON_TAMPER, BUTTON_MODE_GPIO);
  
  /* Configure Joystick in EXTI mode */
  BSP_JOY_Init(JOY_MODE_EXTI);

  /* Initialize the LCD */
  BSP_LCD_Init();
  
  /* Init the LCD Log module */
  LCD_LOG_Init();
  
#ifdef USE_USB_HS 
  LCD_LOG_SetHeader((uint8_t *)" USB OTG HS HID Host");
#else
  LCD_LOG_SetHeader((uint8_t *)" USB OTG FS HID Host");
#endif
  
  LCD_UsrLog("USB Host library started.\n"); 
  
  /* Start HID Interface */
  HID_MenuInit();
}
开发者ID:pierreroth64,项目名称:STM32Cube_FW_F4,代码行数:30,代码来源:main.c

示例8: Joystick_demo

/**
  * @brief  Joystick Gpio demo
  * @param  None
  * @retval None
  */
void Joystick_demo (void)
{ 

  uint8_t status = 0;

  Joystick_SetHint();
  
  status = BSP_JOY_Init();
  
  if (status != HAL_OK)
  {
    BSP_LCD_SetBackColor(LCD_COLOR_WHITE); 
    BSP_LCD_SetTextColor(LCD_COLOR_RED);
    BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize()- 70, (uint8_t *)"ERROR", CENTER_MODE);
    BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize()- 55, (uint8_t *)"Joystick cannot", CENTER_MODE);
    BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize()- 40, (uint8_t *)"be initialized", CENTER_MODE);
  }
  
  while (1)
  {
    if (status == HAL_OK)
    {
      /* Get the Joystick State */
      JoyState = BSP_JOY_GetState();
      Joystick_SetCursorPosition();
    }
    if(CheckForUserInput() > 0)
    {
      return;
    }
    HAL_Delay(6);
  }
}
开发者ID:PaxInstruments,项目名称:STM32CubeF2,代码行数:38,代码来源:joystick.c

示例9: MSC_InitApplication

/**
  * @brief  MSC application Init.
  * @param  None
  * @retval None
  */
static void MSC_InitApplication(void)
{
  /* Configure KEY Button */
  BSP_PB_Init(BUTTON_KEY, BUTTON_MODE_GPIO);                
  
  /* Configure Joystick in EXTI mode */
  BSP_JOY_Init(JOY_MODE_EXTI);
  
  /* Configure the LEDs */
  BSP_LED_Init(LED1);
  BSP_LED_Init(LED2);
  BSP_LED_Init(LED3);
  BSP_LED_Init(LED4);
  
  /* Initialize the LCD */
  BSP_LCD_Init();
  
  /* Initialize the LCD Log module */
  LCD_LOG_Init();
  
  LCD_LOG_SetHeader((uint8_t *)" USB OTG FS MSC Host");
  
  LCD_UsrLog("USB Host library started.\n"); 
  
  /* Start MSC Interface */
  USBH_UsrLog("Starting MSC Demo");
  
  Menu_Init();
}
开发者ID:Lembed,项目名称:STM32CubeF1-mirrors,代码行数:34,代码来源:main.c

示例10: MSC_InitApplication

/**
  * @brief  MSC application Init.
  * @param  None
  * @retval None
  */
static void MSC_InitApplication(void)
{
  /* Configure Key Button */
  BSP_PB_Init(BUTTON_KEY, BUTTON_MODE_GPIO);

  /* Configure Joystick in EXTI mode */
  BSP_JOY_Init(JOY_MODE_EXTI);

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

  /* Initialize the LCD */
  BSP_LCD_Init();
  BSP_LCD_LayerDefaultInit(0, LCD_FB_START_ADDRESS);
  BSP_LCD_SelectLayer(0);

  /* Init the LCD Log module */
  LCD_LOG_Init();

#ifdef USE_USB_HS
  LCD_LOG_SetHeader((uint8_t *)" USB OTG HS MSC Host");
#else
  LCD_LOG_SetHeader((uint8_t *)" USB OTG FS MSC Host");
#endif

  LCD_UsrLog("USB Host library started.\n");

  /* Initialize menu and MSC process */
  USBH_UsrLog("Starting MSC Demo");
  Menu_Init();
}
开发者ID:Joe-Merten,项目名称:Stm32-Tools-Evaluation,代码行数:39,代码来源:main.c

示例11: main

/**
  * @brief  Main program.
  * @param  None
  * @retval None
  */
int main(void)
{
  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();
  
  /* Initialize LEDs */
  BSP_LED_Init(LED1);
  BSP_LED_Init(LED2);
  BSP_LED_Init(LED3);
  BSP_LED_Init(LED4);
  
  /* Configure the system clock to 72 MHz */
  SystemClock_Config();
  
  /* Initialize Joystick */
  BSP_JOY_Init(JOY_MODE_GPIO);
  
  /* Configure Key push-button for remote wakeup */
  BSP_PB_Init(BUTTON_KEY, BUTTON_MODE_EXTI);
  
  /* Init Device Library */
  USBD_Init(&USBD_Device, &HID_Desc, 0);
  
  /* Register the HID class */
  USBD_RegisterClass(&USBD_Device, &USBD_HID);
  
  /* Start Device Process */
  USBD_Start(&USBD_Device);
  
  /* Infinite loop */
  while (1)
  {
  }
}
开发者ID:Lembed,项目名称:STM32CubeF1-mirrors,代码行数:39,代码来源:main.c

示例12: HID_InitApplication

/**
  * @brief  HID application Init.
  * @param  None
  * @retval None
  */
static void HID_InitApplication(void)
{
  /* Configure Key Button */
  BSP_PB_Init(BUTTON_KEY, BUTTON_MODE_GPIO);                
  
  /* Configure Joystick in EXTI mode */
  BSP_JOY_Init(JOY_MODE_EXTI);
  
  /* Configure LED1, LED2, LED3 and LED4 */
  BSP_LED_Init(LED1);
  BSP_LED_Init(LED2);
  BSP_LED_Init(LED3);
  BSP_LED_Init(LED4);
  
  /* Initialize the LCD */
  BSP_LCD_Init();
  
  /* Initialize the LCD Log module */
  LCD_LOG_Init();
  
#ifdef USE_USB_HS 
  LCD_LOG_SetHeader((uint8_t *)" USB OTG HS HID Host");
#else
  LCD_LOG_SetHeader((uint8_t *)" USB OTG FS HID Host");
#endif
  
  LCD_UsrLog("USB Host library started.\n"); 
  
  /* Start HID Interface */
  USBH_UsrLog("Starting HID Demo");
  HID_MenuInit();
}
开发者ID:PaxInstruments,项目名称:STM32CubeF2,代码行数:37,代码来源:main.c

示例13: Log_demo

/**
  * @brief  LCD Log demo 
  * @param  None
  * @retval None
  */
void Log_demo(void)
{ 
  JOYState_TypeDef JoyState = JOY_NONE;
  uint8_t i = 0;
  
  /* Wait For User inputs */
  while(CheckForUserInput() == 0);
  
  BSP_JOY_Init(JOY_MODE_GPIO);
  
  /* Initialize LCD Log module */
  LCD_LOG_Init();
  
  /* Show Header and Footer texts */
  LCD_LOG_SetHeader((uint8_t *)"Log Example");
  LCD_LOG_SetFooter((uint8_t *)"Use Joystick to scroll up/down");
  
  /* Output User logs */
  for (i = 0; i < 10; i++)
  {
    LCD_UsrLog ("This is Line %d \n", i);
  }
  
  HAL_Delay(2000);
  
  /* Clear Old logs */
  LCD_LOG_ClearTextZone();
  
  /* Output new user logs */
  for (i = 0; i < 30; i++)
  {
    LCD_UsrLog ("This is Line %d \n", i);
  }
  
  /* Check for joystick user input for scroll (back and forward) */
  while (1)
  {
    JoyState = BSP_JOY_GetState();
    switch(JoyState)
    {
    case JOY_UP:
      LCD_LOG_ScrollBack();
      break;
      
    case JOY_DOWN:
      LCD_LOG_ScrollForward();
      break;          
      
    default:
      break;           
    }
    if(CheckForUserInput() > 0)
    {
      return;
    }    
    HAL_Delay (10);
  }
}
开发者ID:451506709,项目名称:automated_machine,代码行数:63,代码来源:log.c

示例14: 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

示例15: Joystick_exti_demo

/**
  * @brief  Joystick Exti demo
  * @param  None
  * @retval None
  */
void Joystick_exti_demo (void)
{
  uint8_t status = 0;
  uint32_t ITstatus = 0;

  Joystick_SetHint(1);

  status = BSP_JOY_Init(JOY_MODE_EXTI);

  if (status != IO_OK)
  {
    BSP_LCD_SetBackColor(LCD_COLOR_WHITE);
    BSP_LCD_SetTextColor(LCD_COLOR_RED);
    BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize()- 95, (uint8_t *)"ERROR", CENTER_MODE);
    BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize()- 80, (uint8_t *)"Joystick cannot be initialized", CENTER_MODE);
  }

  if (status == IO_OK)
  {
    Joystick_SetCursorPosition();
  }	

  while (1)  /* pull for USER button in GPIO mode */
  {
    if (status == IO_OK)
    {
      if (MfxExtiReceived == 1)
      {
        MfxExtiReceived = 0;
        ITstatus = BSP_IO_ITGetStatus(JOY_ALL_PINS);
        if (ITstatus)
        {
          /* Get the Joystick State */
          JoyState = BSP_JOY_GetState();
          Joystick_SetCursorPosition();
        }
        BSP_IO_ITClear();
        /* poll if joystick is still pressed until it is released*/
        while ( BSP_JOY_GetState() != JOY_NONE)
        {
          Joystick_SetCursorPosition();
          HAL_Delay(5);
        }
      }
    }
    if(CheckForUserInput() > 0)
    {
      return;
    }
    HAL_Delay(5);
  }
}
开发者ID:eemei,项目名称:library-stm32f4,代码行数:57,代码来源:joystick.c


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