本文整理汇总了C++中Toggle_Leds函数的典型用法代码示例。如果您正苦于以下问题:C++ Toggle_Leds函数的具体用法?C++ Toggle_Leds怎么用?C++ Toggle_Leds使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Toggle_Leds函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MSC_Application
/**
* @brief MSC class application
* @param None
* @retval None
*/
static void MSC_Application(void)
{
switch(USBH_USR_ApplicationState)
{
case USH_USR_FS_INIT:
/* Register work area for logical drives */
if (f_mount(&USBDISK_FatFs, "", 0) != FR_OK)
{
LCD_ErrLog("> File System NOT initialized.\n");
Error_Handler();
}
else
{
LCD_UsrLog("> File System initialized.\n");
USBH_USR_ApplicationState = USH_USR_FS_READLIST;
}
break;
case USH_USR_FS_READLIST:
LCD_UsrLog("> Exploring disk flash ...\n");
if (Explore_Disk("0:/", 1) != FR_OK)
{
LCD_ErrLog("> File cannot be explored.\n");
Error_Handler();
}
else
{
line_idx = 0;
USBH_USR_ApplicationState = USH_USR_FS_DRAW;
LCD_UsrLog("To start Image Slideshow\n");
LCD_UsrLog("Press Key\n");
while(BSP_PB_GetState (BUTTON_KEY) != SET)
{
Toggle_Leds();
}
}
break;
case USH_USR_FS_DRAW:
/* USER Button in polling */
while(BSP_PB_GetState (BUTTON_KEY) != RESET)
{
Toggle_Leds();
}
while(Appli_state == APPLICATION_START)
{
Image_Browser("0:/");
return;
}
break;
default:
break;
}
return;
}
示例2: main
/**
* @brief Main program
* @param None
* @retval None
*/
int main(void)
{
/* STM32F3xx 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.
- Set NVIC Group Priority to 4
- Low Level Initialization
*/
HAL_Init();
/* Configure the system clock to 72 Mhz */
SystemClock_Config();
/* Initialize LEDs and User_Button on STM32F3-Discovery ------------------*/
BSP_LED_Init(LED4);
BSP_LED_Init(LED3);
BSP_LED_Init(LED5);
BSP_LED_Init(LED7);
BSP_LED_Init(LED9);
BSP_LED_Init(LED10);
BSP_LED_Init(LED8);
BSP_LED_Init(LED6);
BSP_PB_Init(BUTTON_USER, BUTTON_MODE_EXTI);
/* Toggle LEDs between each Test */
while (!UserPressButton) Toggle_Leds();
BSP_LED_Off(LED3);
BSP_LED_Off(LED4);
BSP_LED_Off(LED5);
BSP_LED_Off(LED6);
/* 1. Start Test: Wait For User inputs -------------------------------------*/
while (1)
{
UserPressButton = 0;
BSP_examples[DemoIndex++].DemoFunc();
/* If all Demo has been already executed, Reset DemoIndex to restart BSP example*/
if(DemoIndex >= COUNT_OF_EXAMPLE(BSP_examples))
{
DemoIndex = 0;
}
/* Toggle LEDs between each Test */
UserPressButton = 0;
while (!UserPressButton) Toggle_Leds();
BSP_LED_Off(LED3);
BSP_LED_Off(LED4);
BSP_LED_Off(LED5);
BSP_LED_Off(LED6);
}
}
示例3: 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 LED3, LED4, LED5 and LED6 */
BSP_LED_Init(LED3);
BSP_LED_Init(LED4);
BSP_LED_Init(LED5);
BSP_LED_Init(LED6);
/* Configure the system clock to 168 MHz */
SystemClock_Config();
/* Configure USER Button */
BSP_PB_Init(BUTTON_KEY, BUTTON_MODE_EXTI);
/* Toggle LEDs between each Test */
while (!UserPressButton)
{
Toggle_Leds();
}
BSP_LED_Off(LED3);
BSP_LED_Off(LED4);
BSP_LED_Off(LED5);
BSP_LED_Off(LED6);
/* 1. Start Test: Wait For User inputs -------------------------------------*/
while(1)
{
UserPressButton = 0;
BSP_examples[DemoIndex++].DemoFunc();
/* If all Demo has been already executed, Reset DemoIndex to restart BSP example */
if(DemoIndex >= COUNT_OF_EXAMPLE(BSP_examples))
{
DemoIndex = 0;
}
/* Toggle LEDs between each Test */
UserPressButton = 0;
while (!UserPressButton) Toggle_Leds();
BSP_LED_Off(LED3);
BSP_LED_Off(LED4);
BSP_LED_Off(LED5);
BSP_LED_Off(LED6);
}
}
示例4: Image_Browser
static uint8_t Image_Browser (char* path)
{
FRESULT res;
uint8_t ret = 1;
FILINFO fno;
DIR dir;
char *fn;
uint8_t key = 0;
res = f_opendir(&dir, path);
if (res == FR_OK) {
for (;;) {
res = f_readdir(&dir, &fno);
if (res != FR_OK || fno.fname[0] == 0) break;
if (fno.fname[0] == '.') continue;
fn = fno.fname;
if (fno.fattrib & AM_DIR)
{
continue;
}
else
{
if((strstr(fn, "bmp")) || (strstr(fn, "BMP")))
{
res = f_open(&file, fn, FA_OPEN_EXISTING | FA_READ);
Show_Image();
USB_OTG_BSP_mDelay(100);
ret = 0;
// while((HCD_IsDeviceConnected(&USB_OTG_Core)))// && \
//// (STM_EVAL_PBGetState (BUTTON_KEY) == SET))
// {
// Toggle_Leds();
// }
while(key != '1')
{
SerialKeyPressed((uint8_t*)&key);
Toggle_Leds();
}
key = 0;
f_close(&file);
}
}
}
}
#ifdef USE_USB_OTG_HS
LCD_LOG_SetHeader(" USB OTG HS MSC Host");
#else
LCD_LOG_SetHeader(" USB OTG FS MSC Host");
#endif
LCD_LOG_SetFooter (" USB Host Library v2.1.0" );
LCD_UsrLog("> Disk capacity : %d Bytes\n", USBH_MSC_Param.MSCapacity * \
USBH_MSC_Param.MSPageLength);
USBH_USR_ApplicationState = USH_USR_FS_READLIST;
return ret;
}
示例5: 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);
}
}
}
}
示例6: 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();
/* Configure LED1, LED2, LED3 and LED4 */
BSP_LED_Init(LED1);
BSP_LED_Init(LED3);
/* Init Device Library */
USBD_Init(&USBD_Device, &VCP_Desc, 0);
/* Add Supported Class */
USBD_RegisterClass(&USBD_Device, USBD_CDC_CLASS);
/* Add CDC Interface Class */
USBD_CDC_RegisterInterface(&USBD_Device, &USBD_CDC_fops);
/* Start Device Process */
USBD_Start(&USBD_Device);
/* Run Application (Interrupt mode) */
while (1)
{
Toggle_Leds();
}
}
示例7: main
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 LED3, LED4, LED5 and LED6 */
BSP_LED_Init(LED3);
BSP_LED_Init(LED4);
BSP_LED_Init(LED5);
BSP_LED_Init(LED6);
/* Configure the system clock to 168 MHz */
SystemClock_Config();
/* Configure USER Button */
BSP_PB_Init(BUTTON_KEY, BUTTON_MODE_EXTI);
/* Toggle LEDs between each Test */
while (!UserPressButton)
{
Toggle_Leds();
}
BSP_LED_Off(LED3);
BSP_LED_Off(LED4);
BSP_LED_Off(LED5);
BSP_LED_Off(LED6);
/* 1. Start Test: Wait For User inputs -------------------------------------*/
while(1)
{
UserPressButton = 0;
AudioPlay_Test();
UserPressButton = 0;
while (!UserPressButton) Toggle_Leds();
BSP_LED_Off(LED3);
BSP_LED_Off(LED4);
BSP_LED_Off(LED5);
BSP_LED_Off(LED6);
}
}
示例8: SysTick_Handler
/**
* @brief This function handles SysTick Handler.
* @param None
* @retval None
*/
void SysTick_Handler(void)
{
HAL_IncTick();
Toggle_Leds();
/* Check periodically the buffer state and fill played buffer with new data
following the state that has been updated by the BSP_AUDIO_OUT_TransferComplete_CallBack()
and BSP_AUDIO_OUT_HalfTransfer_CallBack() */
AUDIO_Process();
}
示例9: SysTick_Handler
/**
* @brief This function handles SysTick Handler.
* @param None
* @retval None
*/
void SysTick_Handler (void)
{
HAL_IncTick();
if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED)
{
xPortSysTickHandler();
}
Toggle_Leds();
}
示例10: Image_Browser
/**
* @brief Image browser
* @param path: pointer to root path
* @retval None
*/
static uint8_t Image_Browser(char *path)
{
FRESULT res;
uint8_t ret = 1;
FILINFO fno;
DIR dir;
char *fn;
res = f_opendir(&dir, path);
if (res != FR_OK)
{
Error_Handler();
}
else
{
for (;;) {
res = f_readdir(&dir, &fno);
if (res != FR_OK || fno.fname[0] == 0) break;
if (fno.fname[0] == '.') continue;
fn = fno.fname;
if (fno.fattrib & AM_DIR)
{
continue;
}
else
{
if((strstr(fn, "bmp")) || (strstr(fn, "BMP")))
{
res = f_open(&file, fn, FA_OPEN_EXISTING | FA_READ);
Show_Image();
USBH_Delay(100);
ret = 0;
while((Appli_state == APPLICATION_START) && \
(BSP_PB_GetState (BUTTON_KEY) != SET))
{
Toggle_Leds();
}
f_close(&file);
}
}
}
}
/* LCD Log initialization */
LCD_LOG_Init();
LCD_LOG_SetHeader((uint8_t *)"LTDC Application");
LCD_LOG_SetFooter ((uint8_t *)" USB Host Library V3.2.0" );
USBH_USR_ApplicationState = USH_USR_FS_READLIST;
f_closedir(&dir);
return ret;
}
示例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 168 MHz */
SystemClock_Config();
/* Configure LED3 and LED4 */
BSP_LED_Init(LED3);
BSP_LED_Init(LED4);
/* Configure USER Button */
BSP_PB_Init(BUTTON_KEY, BUTTON_MODE_GPIO);
/* Initialize LCD driver */
LCD_Config();
/* Link the USB Host disk I/O driver */
USBDISK_Driver_Num = FATFS_LinkDriver(&USBH_Driver, "");
/* Init Host Library */
if (USBH_Init(&hUSB_Host, USBH_UserProcess, 0) != USBH_OK)
{
/* USB Initialization Error */
Error_Handler();
}
/* Add Supported Class */
USBH_RegisterClass(&hUSB_Host, USBH_MSC_CLASS);
/* Start Host Process */
if (USBH_Start(&hUSB_Host) != USBH_OK)
{
/* USB Initialization Error */
Error_Handler();
}
/* Infinite loop */
while (1)
{
if (Appli_state == APPLICATION_START)
{
MSC_Application();
}
Toggle_Leds();
USBH_Process(&hUSB_Host);
}
}
示例12: SysTick_Handler
/**
* @brief This function handles SysTick Handler.
* @param None
* @retval None
*/
void SysTick_Handler(void)
{
static __IO uint32_t counter=0;
HAL_IncTick();
if (counter++ == 10)
{
GetPointerData(HID_Buffer);
if((HID_Buffer[1] != 0) || (HID_Buffer[2] != 0))
{
USBD_HID_SendReport(&USBD_Device_FS, HID_Buffer, 4);
}
counter =0;
}
Toggle_Leds();
}
示例13: SysTick_Handler
/**
* @brief This function handles SysTick Handler.
* @param None
* @retval None
*/
void SysTick_Handler(void)
{
static __IO uint32_t counter=0;
HAL_IncTick();
/* check Joystick state every polling interval (10ms) */
if (counter++ == USBD_HID_GetPollingInterval(&USBD_Device))
{
GetPointerData(HID_Buffer);
/* send data though IN endpoint*/
if((HID_Buffer[1] != 0) || (HID_Buffer[2] != 0))
{
USBD_HID_SendReport(&USBD_Device, HID_Buffer, 4);
}
counter =0;
}
Toggle_Leds();
}
示例14: 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 216 MHz */
SystemClock_Config();
/* Configure LED1 and LED3 */
BSP_LED_Init(LED1);
BSP_LED_Init(LED3);
/* Init Device Library */
USBD_Init(&USBD_Device, &VCP_Desc, 0);
/* Add Supported Class */
USBD_RegisterClass(&USBD_Device, USBD_CDC_CLASS);
/* Add CDC Interface Class */
USBD_CDC_RegisterInterface(&USBD_Device, &USBD_CDC_fops);
/* Start Device Process */
USBD_Start(&USBD_Device);
/* Run Application (Interrupt mode) */
while (1)
{
Toggle_Leds();
}
}
示例15: SysTick_Handler
/**
* @brief This function handles SysTick Handler.
* @param None
* @retval None
*/
void SysTick_Handler(void)
{
HAL_IncTick();
Toggle_Leds();
}