这篇教程C++ BSP_SDRAM_Init函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中BSP_SDRAM_Init函数的典型用法代码示例。如果您正苦于以下问题:C++ BSP_SDRAM_Init函数的具体用法?C++ BSP_SDRAM_Init怎么用?C++ BSP_SDRAM_Init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了BSP_SDRAM_Init函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: k_BspInit/** * @brief Initializes LEDs, SDRAM, touch screen, CRC and SRAM. * @param None * @retval None */void k_BspInit(void){ GPIO_InitTypeDef GPIO_InitStructure; /* Enable CS GPIO clock and Configure GPIO PIN for Gyroscope Chip select */ __HAL_RCC_GPIOC_CLK_ENABLE(); GPIO_InitStructure.Pin = GPIO_PIN_1; GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStructure.Pull = GPIO_NOPULL; GPIO_InitStructure.Speed = GPIO_SPEED_MEDIUM; HAL_GPIO_Init(GPIOC, &GPIO_InitStructure); /* Deselect : Chip Select high */ HAL_GPIO_WritePin(GPIOC, GPIO_PIN_1, GPIO_PIN_SET); /* Configure LED3 and LED4 */ BSP_LED_Init(LED3); BSP_LED_Init(LED4); /* Initialize the SDRAM */ BSP_SDRAM_Init(); /* Initialize the Touch screen */ BSP_TS_Init(240, 320); /* Enable CRC to Unlock GUI */ __HAL_RCC_CRC_CLK_ENABLE(); /* Enable Back up SRAM */ __HAL_RCC_BKPSRAM_CLK_ENABLE();}
开发者ID:Joe-Merten,项目名称:Stm32-Tools-Evaluation,代码行数:38,
示例2: main/** * @brief Main program * @param None * @retval None */int main(void){ HAL_StatusTypeDef hal_status = HAL_OK; uint8_t lcd_status = LCD_OK; /* STM32F4xx HAL library initialization: - Configure the Flash prefetch, instruction and Data caches - 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: global MSP (MCU Support Package) initialization */ HAL_Init(); /* Configure the system clock */ SystemClock_Config(); /* Wait until MFX is ready after reset */ HAL_Delay(100); /* Configure LED1, LED2 and LED3 */ BSP_LED_Init(LED1); BSP_LED_Init(LED2); BSP_LED_Init(LED3); /*##-1- Initialize the SDRAM ##############################################*/ BSP_SDRAM_Init(); /*##-2- Initialize the LCD #################################################*/ /* Proceed to LTDC, DSI initialization and LCD screen initialization * with the configuration filled in above */ lcd_status = BSP_LCD_Init(); LCD_LayerDefaultInit(1, (uint32_t)&aBufferResult); BSP_LCD_SelectLayer(1); OnError_Handler(lcd_status != LCD_OK); HAL_Delay(100); /*##-3- DMA2D configuration ################################################*/ DMA2D_Config(); /*##-4- Start DMA2D transfer ###############################################*/ hal_status = HAL_DMA2D_Start_IT(&Dma2dHandle, (uint32_t)LCD_COLOR_GREEN, /* Fill the DMA2D output register with this color */ (uint32_t)&aBufferResult, /* DMA2D output register */ LAYER_SIZE_X, LAYER_SIZE_Y); OnError_Handler(hal_status != HAL_OK); while (1) { ; }}
开发者ID:pierreroth64,项目名称:STM32Cube_FW_F4,代码行数:64,
示例3: SDRAM_demo/** * @brief SDRAM Demo * @param None * @retval None */void SDRAM_demo (void){ SDRAM_SetHint(); /* SDRAM device configuration */ if(BSP_SDRAM_Init() != SDRAM_OK) { BSP_LCD_DisplayStringAt(20, 115, (uint8_t *)"SDRAM Initialization : FAILED.", LEFT_MODE); BSP_LCD_DisplayStringAt(20, 130, (uint8_t *)"SDRAM Test Aborted.", LEFT_MODE); } else { BSP_LCD_DisplayStringAt(20, 100, (uint8_t *)"SDRAM Initialization : OK.", LEFT_MODE); } /* Fill the buffer to write */ Fill_Buffer(sdram_aTxBuffer, SDRAM_BUFFER_SIZE, 0xA244250F); /* Write data to the SDRAM memory */ if(BSP_SDRAM_WriteData(SDRAM_WRITE_READ_ADDR + WRITE_READ_ADDR_OFFSET, sdram_aTxBuffer, SDRAM_BUFFER_SIZE) != SDRAM_OK) { BSP_LCD_DisplayStringAt(20, 115, (uint8_t *)"SDRAM WRITE : FAILED.", LEFT_MODE); BSP_LCD_DisplayStringAt(20, 130, (uint8_t *)"SDRAM Test Aborted.", LEFT_MODE); } else { BSP_LCD_DisplayStringAt(20, 115, (uint8_t *)"SDRAM WRITE : OK.", LEFT_MODE); } /* Read back data from the SDRAM memory */ if(BSP_SDRAM_ReadData(SDRAM_WRITE_READ_ADDR + WRITE_READ_ADDR_OFFSET, sdram_aRxBuffer, SDRAM_BUFFER_SIZE) != SDRAM_OK) { BSP_LCD_DisplayStringAt(20, 130, (uint8_t *)"SDRAM READ : FAILED.", LEFT_MODE); BSP_LCD_DisplayStringAt(20, 145, (uint8_t *)"SDRAM Test Aborted.", LEFT_MODE); } else { BSP_LCD_DisplayStringAt(20, 130, (uint8_t *)"SDRAM READ : OK.", LEFT_MODE); } if(Buffercmp(sdram_aTxBuffer, sdram_aRxBuffer, SDRAM_BUFFER_SIZE) > 0) { BSP_LCD_DisplayStringAt(20, 145, (uint8_t *)"SDRAM COMPARE : FAILED.", LEFT_MODE); BSP_LCD_DisplayStringAt(20, 160, (uint8_t *)"SDRAM Test Aborted.", LEFT_MODE); } else { BSP_LCD_DisplayStringAt(20, 145, (uint8_t *)"SDRAM Test : OK.", LEFT_MODE); } while (1) { if(CheckForUserInput() > 0) { BSP_SDRAM_DeInit(); return; } }}
开发者ID:Joe-Merten,项目名称:Stm32-Tools-Evaluation,代码行数:64,
示例4: main/** * @brief Main program * @param None * @retval None */int main(void){ uint8_t lcd_status = LCD_OK; /* STM32F4xx HAL library initialization: - Configure the Flash prefetch, instruction and Data caches - 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: global MSP (MCU Support Package) initialization */ HAL_Init(); /* Configure the system clock to 180 MHz */ SystemClock_Config(); /* Initialize the SDRAM */ BSP_SDRAM_Init(); /* Initialize the LCD */ lcd_status = LCD_Init(); OnError_Handler(lcd_status != LCD_OK); /* Initialize LTDC layer 0 iused for Hint */ BSP_LCD_LayerDefaultInit(0, LAYER0_ADDRESS); BSP_LCD_SelectLayer(0); /* Display example brief */ LCD_BriefDisplay(); /*Draw first image */ CopyBuffer((uint32_t *)Images[ImageIndex++], (uint32_t *)LAYER0_ADDRESS, 240, 160, 320, 240); pending_buffer = 0; /*Refresh the LCD display*/ HAL_DSI_Refresh(&hdsi_eval); /* Infinite loop */ while (1) { if(pending_buffer < 0) { CopyBuffer((uint32_t *)Images[ImageIndex++], (uint32_t *)LAYER0_ADDRESS, 240, 160, 320, 240); if(ImageIndex >= 2) { ImageIndex = 0; } pending_buffer = 0; HAL_DSI_Refresh(&hdsi_eval); } /* Wait some time before switching to next image */ HAL_Delay(2000); }}
开发者ID:pierreroth64,项目名称:STM32Cube_FW_F4,代码行数:64,
示例5: BSP_LCD_Init/** * @brief Initializes the LCD. * @retval LCD state */uint8_t BSP_LCD_Init(void){ /* Select the used LCD */ /* The RK043FN48H LCD 480x272 is selected */ /* Timing Configuration */ hLtdcHandler.Init.HorizontalSync = (RK043FN48H_HSYNC - 1); hLtdcHandler.Init.VerticalSync = (RK043FN48H_VSYNC - 1); hLtdcHandler.Init.AccumulatedHBP = (RK043FN48H_HSYNC + RK043FN48H_HBP - 1); hLtdcHandler.Init.AccumulatedVBP = (RK043FN48H_VSYNC + RK043FN48H_VBP - 1); hLtdcHandler.Init.AccumulatedActiveH = (RK043FN48H_HEIGHT + RK043FN48H_VSYNC + RK043FN48H_VBP - 1); hLtdcHandler.Init.AccumulatedActiveW = (RK043FN48H_WIDTH + RK043FN48H_HSYNC + RK043FN48H_HBP - 1); hLtdcHandler.Init.TotalHeigh = (RK043FN48H_HEIGHT + RK043FN48H_VSYNC + RK043FN48H_VBP + RK043FN48H_VFP - 1); hLtdcHandler.Init.TotalWidth = (RK043FN48H_WIDTH + RK043FN48H_HSYNC + RK043FN48H_HBP + RK043FN48H_HFP - 1); /* LCD clock configuration */ BSP_LCD_ClockConfig(&hLtdcHandler, NULL); /* Initialize the LCD pixel width and pixel height */ hLtdcHandler.LayerCfg->ImageWidth = RK043FN48H_WIDTH; hLtdcHandler.LayerCfg->ImageHeight = RK043FN48H_HEIGHT; /* Background value */ hLtdcHandler.Init.Backcolor.Blue = 0; hLtdcHandler.Init.Backcolor.Green = 0; hLtdcHandler.Init.Backcolor.Red = 0; /* Polarity */ hLtdcHandler.Init.HSPolarity = LTDC_HSPOLARITY_AL; hLtdcHandler.Init.VSPolarity = LTDC_VSPOLARITY_AL; hLtdcHandler.Init.DEPolarity = LTDC_DEPOLARITY_AL; hLtdcHandler.Init.PCPolarity = LTDC_PCPOLARITY_IPC; hLtdcHandler.Instance = LTDC; if(HAL_LTDC_GetState(&hLtdcHandler) == HAL_LTDC_STATE_RESET) { /* Initialize the LCD Msp: this __weak function can be rewritten by the application */ BSP_LCD_MspInit(&hLtdcHandler, NULL); } HAL_LTDC_Init(&hLtdcHandler); /* Assert display enable LCD_DISP pin */ HAL_GPIO_WritePin(LCD_DISP_GPIO_PORT, LCD_DISP_PIN, GPIO_PIN_SET); /* Assert backlight LCD_BL_CTRL pin */ HAL_GPIO_WritePin(LCD_BL_CTRL_GPIO_PORT, LCD_BL_CTRL_PIN, GPIO_PIN_SET);#if !defined(DATA_IN_ExtSDRAM) /* Initialize the SDRAM */ BSP_SDRAM_Init();#endif /* Initialize the font */ BSP_LCD_SetFont(&LCD_DEFAULT_FONT); return LCD_OK;}
开发者ID:picohari,项目名称:intewa_stm32f7,代码行数:61,
示例6: SDRAMDISK_initialize/** * @brief Initializes a Drive * @param lun : not used * @retval DSTATUS: Operation status */DSTATUS SDRAMDISK_initialize(BYTE lun){ Stat = STA_NOINIT; /* Configure the SDRAM device */ BSP_SDRAM_Init(); Stat &= ~STA_NOINIT; return Stat;}
开发者ID:Jegeva,项目名称:STM32F469-Discovery,代码行数:15,
示例7: mainint main (void) { MPU_Config(); /* Configure the MPU */ CPU_CACHE_Enable(); /* Enable the CPU Cache */ HAL_Init(); /* Initialize the HAL Library */ BSP_SDRAM_Init(); /* Initialize BSP SDRAM */ SystemClock_Config(); /* Configure the System Clock */ init_filesystem(); /* Inital rl-flash Librart */ MainTask(); for (;;);}
开发者ID:jackeyjiang,项目名称:meizi_f7disc,代码行数:12,
示例8: k_BspInit/** * @brief Initializes LEDs, touch screen, CRC and SRAM. * @param None * @retval None */void k_BspInit(void){ /* Configure LED1 and LED3 */ BSP_LED_Init(LED1); BSP_LED_Init(LED3); BSP_SDRAM_Init(); /* Initialize the Touch screen */ BSP_TS_Init(320, 240); /* Enable CRC to Unlock GUI */ __HAL_RCC_CRC_CLK_ENABLE();}
开发者ID:nguyenvuhung,项目名称:STM32Cube_FW_F4,代码行数:19,
示例9: BSP_Config/** * @brief Initializes the STM32F429I-DISCO's LCD and LEDs resources. * @param None * @retval None */static void BSP_Config(void){ /* Initialize STM32F429I-DISCO's LEDs */ BSP_LED_Init(LED3); BSP_LED_Init(LED4); /* Initializes the SDRAM device */ BSP_SDRAM_Init(); /* Initialize the Touch screen */ BSP_TS_Init(240, 320); /* Enable the CRC Module */ __CRC_CLK_ENABLE();}
开发者ID:EarnestHein89,项目名称:STM32Cube_FW_F4,代码行数:20,
示例10: main/** * @brief Main program * @param None * @retval None */int main(void){ /* This project template calls firstly two functions in order to configure MPU feature and to enable the CPU Cache, respectively MPU_Config() and CPU_CACHE_Enable(). These functions are provided as template implementation that User may integrate in his application, to enhance the performance in case of use of AXI interface with several masters. */ /* Configure the MPU attributes as Write Through */ MPU_Config(); /* Enable the CPU Cache */ CPU_CACHE_Enable();#ifdef RTE_CMSIS_RTOS // when using CMSIS RTOS osKernelInitialize(); // initialize CMSIS-RTOS#endif /* 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(); /* Add your application code here */ BSP_SDRAM_Init(); Touch_Initialize(); #ifdef RTE_CMSIS_RTOS // when using CMSIS RTOS Init_Thread1(); Init_Thread2(); osKernelStart(); // start thread execution #endif Analyzer_Init(); GUI_Init(); osMutexWait(mid_Thread_Mutex,osWaitForever); Hello_MSG(); osMutexRelease(mid_Thread_Mutex); osThreadTerminate(osThreadGetId());}
开发者ID:AdrK,项目名称:STM32F7_MULTITHREAD,代码行数:53,
示例11: k_BspInit/** * @brief Initializes LEDs, SDRAM, touch screen, CRC and SRAM. * @param None * @retval None */void k_BspInit(void){ /* Initialize the NOR */ BSP_QSPI_Init(); BSP_QSPI_MemoryMappedMode(); /* Initialize the SDRAM */ BSP_SDRAM_Init(); /* Initialize the Touch screen */ BSP_TS_Init(420, 272); /* Enable CRC to Unlock GUI */ __HAL_RCC_CRC_CLK_ENABLE(); /* Enable Back up SRAM */__HAL_RCC_BKPSRAM_CLK_ENABLE(); }
开发者ID:CamelShoko,项目名称:RadioYuN,代码行数:24,
示例12: k_BspInit/** * @brief Initializes LEDs, SDRAM, touch screen, CRC and SRAM. * @param None * @retval None */void k_BspInit(void){ /* Configure LED1, LED2, LED3 and LED4 */ BSP_LED_Init(LED1); BSP_LED_Init(LED2); BSP_LED_Init(LED3); BSP_LED_Init(LED4); /* Initialize the SDRAM */ BSP_SDRAM_Init(); /* Initialize the Touch screen */ BSP_TS_Init(640, 480); /* Enable CRC to Unlock GUI */ __HAL_RCC_CRC_CLK_ENABLE(); /* Enable Back up SRAM */ __HAL_RCC_BKPSRAM_CLK_ENABLE();}
开发者ID:Joe-Merten,项目名称:Stm32-Tools-Evaluation,代码行数:26,
示例13: k_BspInit/** * @brief Initializes LEDs, SDRAM, touch screen, CRC and SRAM. * @param None * @retval None */void k_BspInit(void){ BSP_IO_Init(); /* Initialize the NOR */ BSP_NOR_Init(); /* Initialize the SDRAM */ BSP_SDRAM_Init(); /* Initialize the Touch screen */ BSP_TS_Init(640, 480); /* Enable CRC to Unlock GUI */ __HAL_RCC_CRC_CLK_ENABLE(); /* Enable Back up SRAM */__HAL_RCC_BKPSRAM_CLK_ENABLE(); }
开发者ID:RadMie,项目名称:STM32F7DiscoveryBase,代码行数:26,
示例14: main/** * @brief Main program * @param None * @retval None */int main(void){ /* STM32F4xx 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 180 MHz */ SystemClock_Config(); /*##-1- Initialize the SDRAM ##############################################*/ BSP_SDRAM_Init(); /*##-2- Initialise the LCD #################################################*/ BSP_LCD_Init(); /*##-3- Camera Initialisation and start capture ############################*/ /* Initialize the Camera */ BSP_CAMERA_Init(CAMERA_R320x240); /* Wait 1s before Camera snapshot */ HAL_Delay(1000); /* Start the Camera Capture */ BSP_CAMERA_SnapshotStart((uint8_t *)CAMERA_FRAME_BUFFER); while (1) { }}
开发者ID:eemei,项目名称:library-stm32f4,代码行数:44,
示例15: system_initvoid system_init(void){ SCB_EnableICache(); SCB_EnableDCache(); DBG_INIT(); init_system_clock(); HAL_Init(); BSP_SDRAM_Init(); BSP_LED_Init(LED1); BSP_PB_Init(BUTTON_KEY, BUTTON_MODE_GPIO); MX_FATFS_Init(); FRESULT res = f_mount(&ctx.fs, SD_Path, 0); ASSERT_WARN(res == FR_OK); gui_init();}
开发者ID:korzo89,项目名称:st_sid_player,代码行数:22,
示例16: main/** * @brief Main function. Executes all initialization and terminate its thread. * @param None * @retval None */int main(void){ /////////////////////////////////////////////////////////////////////////////////////////// /* Configure the MPU attributes as Write Through */ MPU_Config(); /* Enable the CPU Cache */ CPU_CACHE_Enable(); // initialize CMSIS-RTOS osKernelInitialize(); /////////////////////////////////////////////////////////////////////////////////////////// // Hardware initialize if( HAL_Init() != HAL_OK) Error_Handler(); if( ConfigureDMA(&g_DmaHandle, &g_AdcHandle) != HAL_OK) Error_Handler(); if( ADC_INIT(&g_AdcHandle) != HAL_OK) Error_Handler(); BSP_SDRAM_Init(); Touch_Initialize(); /////////////////////////////////////////////////////////////////////////////////////////// /* Configure the System clock to have a frequency of 216 MHz */ SystemClock_Config(); // Thread initialization Init_TH_GUI(); Init_TH_Touch(); // RTOS Start Kernel osKernelStart(); // start thread execution // Get Main Thread ID Main_thID = osThreadGetId(); /////////////////////////////////////////////////////////////////////////////////////////// // Start data acquire HAL_ADC_Start_DMA(&g_AdcHandle, values, ADC_BUFFER_LENGTH); /////////////////////////////////////////////////////////////////////////////////////////// // Terminate main thread osThreadTerminate(Main_thID); /* Infinite loop */ while (1) { }}
开发者ID:AdrK,项目名称:STM32F7_ADC_DMA_LCD,代码行数:44,
示例17: main/** * @brief Main program * @param None * @retval None */int main(void){ uint8_t lcd_status = LCD_OK; /* STM32F4xx HAL library initialization: - Configure the Flash prefetch, instruction and Data caches - 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: global MSP (MCU Support Package) initialization */ HAL_Init(); /* Configure the system clock to 180 MHz */ SystemClock_Config(); /* Initialize the SDRAM */ BSP_SDRAM_Init(); /* Initialize the LCD */ lcd_status = LCD_Init(); OnError_Handler(lcd_status != LCD_OK); /* Initialize LTDC layer 0 iused for Hint */ LCD_LayertInit(0, LAYER0_ADDRESS); BSP_LCD_SelectLayer(0); HAL_DSI_LongWrite(&hdsi_eval, 0, DSI_DCS_LONG_PKT_WRITE, 4, OTM8009A_CMD_CASET, pColLeft); HAL_DSI_LongWrite(&hdsi_eval, 0, DSI_DCS_LONG_PKT_WRITE, 4, OTM8009A_CMD_PASET, pPage); /* Update pitch : the draw is done on the whole physical X Size */ HAL_LTDC_SetPitch(&hltdc_eval, BSP_LCD_GetXSize(), 0); /* Display example brief */ LCD_BriefDisplay(); /* Show first image */ CopyPicture((uint32_t *)Images[ImageIndex++], (uint32_t *)LAYER0_ADDRESS, 240, 160, 320, 240); pending_buffer = 0; active_area = LEFT_AREA; HAL_DSI_LongWrite(&hdsi_eval, 0, DSI_DCS_LONG_PKT_WRITE, 2, OTM8009A_CMD_WRTESCN, pSyncLeft); /* Infinite loop */ while (1) { if(pending_buffer < 0) { CopyPicture((uint32_t *)Images[ImageIndex++], (uint32_t *)LAYER0_ADDRESS, 240, 160, 320, 240); if(ImageIndex >= 2) { ImageIndex = 0; } pending_buffer = 1; HAL_DSI_LongWrite(&hdsi_eval, 0, DSI_DCS_LONG_PKT_WRITE, 2, OTM8009A_CMD_WRTESCN, pSyncLeft); } /* Wait some time before switching to next image */ HAL_Delay(2000); }}
开发者ID:Joe-Merten,项目名称:Stm32-Tools-Evaluation,代码行数:71,
示例18: 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,
示例19: BSP_LCD_InitEx/** * @brief Initializes the LCD. * @param PclkConfig : pixel clock profile * @retval LCD state */uint8_t BSP_LCD_InitEx(uint32_t PclkConfig){ PCLK_profile = PclkConfig; /* Select the used LCD */ /* The AMPIRE 480x272 does not contain an ID register then we check the availability of AMPIRE 480x640 LCD using device ID of the STMPE811 mounted on MB1046 daughter board */ if(stmpe811_ts_drv.ReadID(TS_I2C_ADDRESS) == STMPE811_ID) { /* The AMPIRE LCD 480x272 is selected */ /* Timing Configuration */ hltdc_eval.Init.HorizontalSync = (AMPIRE480272_HSYNC - 1); hltdc_eval.Init.VerticalSync = (AMPIRE480272_VSYNC - 1); hltdc_eval.Init.AccumulatedHBP = (AMPIRE480272_HSYNC + AMPIRE480272_HBP - 1); hltdc_eval.Init.AccumulatedVBP = (AMPIRE480272_VSYNC + AMPIRE480272_VBP - 1); hltdc_eval.Init.AccumulatedActiveH = (AMPIRE480272_HEIGHT + AMPIRE480272_VSYNC + AMPIRE480272_VBP - 1); hltdc_eval.Init.AccumulatedActiveW = (AMPIRE480272_WIDTH + AMPIRE480272_HSYNC + AMPIRE480272_HBP - 1); hltdc_eval.Init.TotalHeigh = (AMPIRE480272_HEIGHT + AMPIRE480272_VSYNC + AMPIRE480272_VBP + AMPIRE480272_VFP - 1); hltdc_eval.Init.TotalWidth = (AMPIRE480272_WIDTH + AMPIRE480272_HSYNC + AMPIRE480272_HBP + AMPIRE480272_HFP - 1); /* Initialize the LCD pixel width and pixel height */ hltdc_eval.LayerCfg->ImageWidth = AMPIRE480272_WIDTH; hltdc_eval.LayerCfg->ImageHeight = AMPIRE480272_HEIGHT; } else { /* The LCD AMPIRE 640x480 is selected */ /* Timing configuration */ hltdc_eval.Init.HorizontalSync = (AMPIRE640480_HSYNC - 1); hltdc_eval.Init.VerticalSync = (AMPIRE640480_VSYNC - 1); hltdc_eval.Init.AccumulatedHBP = (AMPIRE640480_HSYNC + AMPIRE640480_HBP - 1); hltdc_eval.Init.AccumulatedVBP = (AMPIRE640480_VSYNC + AMPIRE640480_VBP - 1); hltdc_eval.Init.AccumulatedActiveH = (AMPIRE640480_HEIGHT + AMPIRE640480_VSYNC + AMPIRE640480_VBP - 1); hltdc_eval.Init.AccumulatedActiveW = (AMPIRE640480_WIDTH + AMPIRE640480_HSYNC + AMPIRE640480_HBP - 1); hltdc_eval.Init.TotalHeigh = (AMPIRE640480_HEIGHT + AMPIRE640480_VSYNC + AMPIRE640480_VBP + AMPIRE640480_VFP - 1); hltdc_eval.Init.TotalWidth = (AMPIRE640480_WIDTH + AMPIRE640480_HSYNC + AMPIRE640480_HBP + AMPIRE640480_HFP - 1); /* Initialize the LCD pixel width and pixel height */ hltdc_eval.LayerCfg->ImageWidth = AMPIRE640480_WIDTH; hltdc_eval.LayerCfg->ImageHeight = AMPIRE640480_HEIGHT; } /* Background value */ hltdc_eval.Init.Backcolor.Blue = 0; hltdc_eval.Init.Backcolor.Green = 0; hltdc_eval.Init.Backcolor.Red = 0; /* Polarity */ hltdc_eval.Init.HSPolarity = LTDC_HSPOLARITY_AL; hltdc_eval.Init.VSPolarity = LTDC_VSPOLARITY_AL; hltdc_eval.Init.DEPolarity = LTDC_DEPOLARITY_AL; hltdc_eval.Init.PCPolarity = LTDC_PCPOLARITY_IPC; hltdc_eval.Instance = LTDC; /* LCD clock configuration */ BSP_LCD_ClockConfig(&hltdc_eval, &PCLK_profile); MspInit(); HAL_LTDC_Init(&hltdc_eval);#if !defined(DATA_IN_ExtSDRAM) /* Initialize the SDRAM */ BSP_SDRAM_Init();#endif /* DATA_IN_ExtSDRAM */ /* Initialize the font */ BSP_LCD_SetFont(&LCD_DEFAULT_FONT); return LCD_OK;}
开发者ID:Joe-Merten,项目名称:Stm32-Tools-Evaluation,代码行数:75,
示例20: main/** * @brief Main program * @param None * @retval None */int main(void){ uint8_t sdram_status = SDRAM_OK; uint8_t lcd_status = LCD_OK; uint32_t ts_status = TS_OK; p_bmp_converted_pixel_data = (uint8_t *)CONVERTED_FRAME_BUFFER; /* 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 LED1 and LED3 */ BSP_LED_Init(LED1); BSP_LED_Init(LED3); /*##-1- Initialize the SDRAM */ sdram_status = BSP_SDRAM_Init(); if(sdram_status != SDRAM_OK) { Error_Handler(); } /*##-2- LCD Initialization #################################################*/ /* Initialize the LCD DSI */ lcd_status = BSP_LCD_Init() ; if(lcd_status != LCD_OK) { Error_Handler(); } lcd_status = BSP_LCD_InitEx(LCD_ORIENTATION_LANDSCAPE); if(lcd_status != LCD_OK) { Error_Handler(); } BSP_LCD_LayerDefaultInit(LTDC_ACTIVE_LAYER_BACKGROUND, LCD_FB_START_ADDRESS); /* Clear the LCD Background layer */ BSP_LCD_Clear(LCD_COLOR_WHITE); /*##-3- Touch screen initialization ########################################*/ BSP_TS_ResetTouchData(&TS_State); /* If calibration is not yet done, proceed with calibration */ if (TouchScreen_IsCalibrationDone() == 0) { ts_status = Touchscreen_Calibration(); if(ts_status == TS_OK) { BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize() - 65, (uint8_t *)"Touchscreen calibration success.", CENTER_MODE); } } /* of if (TouchScreen_IsCalibrationDone() == 0) */ /*##-4- Link the SD Card disk I/O driver ###################################*/ /* Clear the LCD and display waiting message */ BSP_LCD_Clear(LCD_COLOR_WHITE); BSP_LCD_SetTextColor(LCD_COLOR_BLACK); BSP_LCD_SetBackColor(LCD_COLOR_WHITE); BSP_LCD_SetFont(&Font12); BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize()/2 - 27, (uint8_t*)"Please WAIT few seconds", CENTER_MODE); BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize()/2 - 12, (uint8_t*)"Creating FAT file system on SD card", CENTER_MODE); if(FATFS_LinkDriver(&SD_Driver, SDPath) != 0) { /* FatFs Initialization Error */ BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize()/2 + 3, (uint8_t*)"FAT FS Error !!", CENTER_MODE); Error_Handler(); }/*##-4- Register the file system object to the FatFs module ################*/ if(f_mount(&SDFatFs, (TCHAR const*)SDPath, 0) != FR_OK) { /* FatFs Initialization Error */ BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize()/2 + 3, (uint8_t*)"FAT FS Error !!", CENTER_MODE); Error_Handler(); } /* Create a FAT file system (format) on the logical drive */ if(f_mkfs((TCHAR const*)SDPath, 0, 0) != FR_OK) { BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize()/2 + 3, (uint8_t*)"FAT FS Error !!", CENTER_MODE); Error_Handler(); } /*##-5- Draw the menu ######################################################*///.........这里部分代码省略.........
开发者ID:pierreroth64,项目名称:STM32Cube_FW_F4,代码行数:101,
示例21: BSP_LCD_Init/** * @brief Initializes the LCD. * @param None * @retval LCD state */uint8_t BSP_LCD_Init(void){ static RCC_PeriphCLKInitTypeDef PeriphClkInitStruct; /* Select the used LCD */ /* The AMPIRE 480x272 does not contain an ID register then we check the availability of AMPIRE 480x640 LCD using device ID of the STMPE811 mounted on MB1046 daughter board */ if(stmpe811_ts_drv.ReadID(TS_I2C_ADDRESS) == STMPE811_ID) { /* The AMPIRE LCD 480x272 is selected */ /* Timing Configuration */ hltdc_eval.Init.HorizontalSync = (AMPIRE480272_HSYNC - 1); hltdc_eval.Init.VerticalSync = (AMPIRE480272_VSYNC - 1); hltdc_eval.Init.AccumulatedHBP = (AMPIRE480272_HSYNC + AMPIRE480272_HBP - 1); hltdc_eval.Init.AccumulatedVBP = (AMPIRE480272_VSYNC + AMPIRE480272_VBP - 1); hltdc_eval.Init.AccumulatedActiveH = (AMPIRE480272_HEIGHT + AMPIRE480272_VSYNC + AMPIRE640480_VBP - 1); hltdc_eval.Init.AccumulatedActiveW = (AMPIRE480272_WIDTH + AMPIRE480272_HSYNC + AMPIRE640480_HBP - 1); hltdc_eval.Init.TotalHeigh = (AMPIRE480272_HEIGHT + AMPIRE480272_VSYNC + AMPIRE480272_VBP + AMPIRE480272_VFP - 1); hltdc_eval.Init.TotalWidth = (AMPIRE480272_WIDTH + AMPIRE480272_HSYNC + AMPIRE480272_HBP + AMPIRE480272_HFP - 1); /* LCD clock configuration */ /* PLLSAI_VCO Input = HSE_VALUE/PLL_M = 1 Mhz */ /* PLLSAI_VCO Output = PLLSAI_VCO Input * PLLSAIN = 192 Mhz */ /* PLLLCDCLK = PLLSAI_VCO Output/PLLSAIR = 192/5 = 38.4 Mhz */ /* LTDC clock frequency = PLLLCDCLK / LTDC_PLLSAI_DIVR_4 = 38.4/4 = 9.6Mhz */ PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_LTDC; PeriphClkInitStruct.PLLSAI.PLLSAIN = 192; PeriphClkInitStruct.PLLSAI.PLLSAIR = AMPIRE480272_FREQUENCY_DIVIDER; PeriphClkInitStruct.PLLSAIDivR = RCC_PLLSAIDIVR_4; HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); /* Initialize the LCD pixel width and pixel height */ hltdc_eval.LayerCfg->ImageWidth = AMPIRE480272_WIDTH; hltdc_eval.LayerCfg->ImageHeight = AMPIRE480272_HEIGHT; } else { /* The LCD AMPIRE 640x480 is selected */ /* Timing configuration */ hltdc_eval.Init.HorizontalSync = (AMPIRE640480_HSYNC - 1); hltdc_eval.Init.VerticalSync = (AMPIRE640480_VSYNC - 1); hltdc_eval.Init.AccumulatedHBP = (AMPIRE640480_HSYNC + AMPIRE640480_HBP - 1); hltdc_eval.Init.AccumulatedVBP = (AMPIRE640480_VSYNC + AMPIRE640480_VBP - 1); hltdc_eval.Init.AccumulatedActiveH = (AMPIRE640480_HEIGHT + AMPIRE640480_VSYNC + AMPIRE640480_VBP - 1); hltdc_eval.Init.AccumulatedActiveW = (AMPIRE640480_WIDTH + AMPIRE640480_HSYNC + AMPIRE640480_HBP - 1); hltdc_eval.Init.TotalHeigh = (AMPIRE640480_HEIGHT + AMPIRE640480_VSYNC + AMPIRE640480_VBP + AMPIRE640480_VFP - 1); hltdc_eval.Init.TotalWidth = (AMPIRE640480_WIDTH + AMPIRE640480_HSYNC + AMPIRE640480_HBP + AMPIRE640480_HFP - 1); /* LCD clock configuration */ /* PLLSAI_VCO Input = HSE_VALUE/PLL_M = 1 Mhz */ /* PLLSAI_VCO Output = PLLSAI_VCO Input * PLLSAIN = 108 Mhz */ /* PLLLCDCLK = PLLSAI_VCO Output/PLLSAIR = 108/3 = 36 Mhz */ /* LTDC clock frequency = PLLLCDCLK / LTDC_PLLSAI_DIVR_2 = 36/2 = 18 Mhz */ PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_LTDC; PeriphClkInitStruct.PLLSAI.PLLSAIN = 108; PeriphClkInitStruct.PLLSAI.PLLSAIR = AMPIRE640480_FREQUENCY_DIVIDER; PeriphClkInitStruct.PLLSAIDivR = RCC_PLLSAIDIVR_2; HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); /* Initialize the LCD pixel width and pixel height */ hltdc_eval.LayerCfg->ImageWidth = AMPIRE640480_WIDTH; hltdc_eval.LayerCfg->ImageHeight = AMPIRE640480_HEIGHT; } /* Background value */ hltdc_eval.Init.Backcolor.Blue = 0; hltdc_eval.Init.Backcolor.Green = 0; hltdc_eval.Init.Backcolor.Red = 0; /* Polarity */ hltdc_eval.Init.HSPolarity = LTDC_HSPOLARITY_AL; hltdc_eval.Init.VSPolarity = LTDC_VSPOLARITY_AL; hltdc_eval.Init.DEPolarity = LTDC_DEPOLARITY_AL; hltdc_eval.Init.PCPolarity = LTDC_PCPOLARITY_IPC; hltdc_eval.Instance = LTDC; MspInit(); HAL_LTDC_Init(&hltdc_eval); #if !defined(DATA_IN_ExtSDRAM) /* Initialize the SDRAM */ BSP_SDRAM_Init();#endif /* DATA_IN_ExtSDRAM */ /* Initialize the font */ BSP_LCD_SetFont(&LCD_DEFAULT_FONT); return LCD_OK;}
开发者ID:dsi-fceia,项目名称:AudioFilterSTM32F401,代码行数:94,
示例22: mainint main(void){ /*!< At this stage the microcontroller clock setting is already configured, this is done through SystemInit() function which is called from startup file (startup_stm32f4xx.s) before to branch to application main. To reconfigure the default setting of SystemInit() function, refer to system_stm32f4xx.c file */ SystemClock_Config(); uint8_t lcd_status = LCD_OK; HAL_MspInit(); HAL_Init(); BSP_SDRAM_Init(); // uint32_t i; int i; __HAL_RCC_GPIOD_CLK_ENABLE(); __HAL_RCC_GPIOG_CLK_ENABLE(); __HAL_RCC_GPIOK_CLK_ENABLE(); GPIO_InitTypeDef GPIO_InitStructure; GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStructure.Speed = GPIO_SPEED_HIGH; GPIO_InitStructure.Pull = GPIO_NOPULL; //GPIO_PULLDOWN;//GPIO_PULLUP;// GUI_Conf.border=8; GPIO_InitStructure.Pin = GPIO_PIN_6; HAL_GPIO_Init(GPIOG,&GPIO_InitStructure); GPIO_InitStructure.Pin = GPIO_PIN_5; HAL_GPIO_Init(GPIOD,&GPIO_InitStructure); GPIO_InitStructure.Pin = GPIO_PIN_4; HAL_GPIO_Init(GPIOD,&GPIO_InitStructure); GPIO_InitStructure.Pin = GPIO_PIN_3; HAL_GPIO_Init(GPIOK,&GPIO_InitStructure); BSP_LCD_Reset(); BSP_LCD_MspInit(); //lcd_status = BSP_LCD_InitEx(LCD_ORIENTATION_PORTRAIT); //lcd_status = BSP_LCD_InitEx(LCD_ORIENTATION_LANDSCAPE); lcd_status = BSP_LCD_Init(); BSP_LCD_LayerDefaultInit(0, LCD_FB_START_ADDRESS); BSP_LCD_SelectLayer(0); BSP_LCD_DisplayOn(); BSP_LCD_SetTransparency(0,0xff); if(lcd_status!=LCD_OK) f_error(); BSP_LCD_Clear(LCD_COLOR_BLACK); BSP_LCD_SetTextColor(LCD_COLOR_BLUE); BSP_LCD_FillRect(0, 0,BSP_LCD_GetXSize(),BSP_LCD_GetYSize()); BSP_LCD_SetTextColor(LCD_COLOR_WHITE); BSP_LCD_FillRect(GUI_Conf.border, GUI_Conf.border,BSP_LCD_GetXSize()-2*GUI_Conf.border,BSP_LCD_GetYSize()-2*GUI_Conf.border); BSP_LCD_SetTextColor(LCD_COLOR_BLACK); BSP_LCD_SetFont(&Font16); BSP_LCD_SetBackColor(LCD_COLOR_TRANSPARENT); BSP_LCD_DisplayStringAtLine(1, (uint8_t *)" FAT SD"); while(1){ Delay(1000); switch(i%4){ case 0: HAL_GPIO_TogglePin(GPIOG,GPIO_PIN_6); break; case 1: HAL_GPIO_TogglePin(GPIOD,GPIO_PIN_4); break; case 2: HAL_GPIO_TogglePin(GPIOD,GPIO_PIN_5); break; case 3: HAL_GPIO_TogglePin(GPIOK,GPIO_PIN_3); break; } i++; if(! i%4) i=0; } }
开发者ID:Jegeva,项目名称:STM32F469-Discovery,代码行数:100,
示例23: 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 LED1, LED2, LED3 and LED4 */ BSP_LED_Init(LED1); BSP_LED_Init(LED2); BSP_LED_Init(LED3); BSP_LED_Init(LED4); /* WAKEUP button (EXTI_Line0) will be used to wakeup the system from STOP mode */ BSP_PB_Init(BUTTON_WAKEUP, BUTTON_MODE_EXTI); /* Configure Key Button */ BSP_PB_Init(BUTTON_KEY, BUTTON_MODE_GPIO); /*##-1- Configure the SDRAM device #########################################*/ /* SDRAM device configuration */ BSP_SDRAM_Init(); /*##-2- SDRAM memory write access ##########################################*/ /* Fill the buffer to write */ Fill_Buffer(aTxBuffer, BUFFER_SIZE, 0xA244250F); /* Write data to the SDRAM memory */ BSP_SDRAM_WriteData(SDRAM_DEVICE_ADDR + WRITE_READ_ADDR, aTxBuffer, BUFFER_SIZE); /* Wait for TAMPER/KEY to be pushed to enter stop mode */ while(BSP_PB_GetState(BUTTON_TAMPER) != RESET) { } /*##-3- Issue self-refresh command to SDRAM device #########################*/ SDRAMCommandStructure.CommandMode = FMC_SDRAM_CMD_SELFREFRESH_MODE; SDRAMCommandStructure.CommandTarget = FMC_SDRAM_CMD_TARGET_BANK1; SDRAMCommandStructure.AutoRefreshNumber = 1; SDRAMCommandStructure.ModeRegisterDefinition = 0; if(BSP_SDRAM_Sendcmd(&SDRAMCommandStructure) != HAL_OK) { /* Command send Error */ Error_Handler(); } /*##-4- Enter CPU power stop mode ##########################################*/ /* Put LED4 on to indicate entering to STOP mode */ BSP_LED_On(LED4); /* Request to enter STOP mode */ HAL_PWR_EnterSTOPMode(PWR_MAINREGULATOR_ON, PWR_STOPENTRY_WFI); /*##-5- Wakeup CPU from power stop mode ###################################*/ /* Configure the system clock after wakeup from STOP: enable HSE, PLL and select PLL as system clock source (HSE and PLL are disabled in STOP mode) */ SystemClock_Config(); /*##-6- SDRAM memory read back access ######################################*/ SDRAMCommandStructure.CommandMode = FMC_SDRAM_CMD_NORMAL_MODE; if(BSP_SDRAM_Sendcmd(&SDRAMCommandStructure) != HAL_OK) { /* Command send Error */ Error_Handler(); } /* Read back data from the SDRAM memory */ BSP_SDRAM_ReadData(SDRAM_DEVICE_ADDR + WRITE_READ_ADDR, aRxBuffer, BUFFER_SIZE); /*##-7- Checking data integrity ############################################*/ uwWriteReadStatus = Buffercmp(aTxBuffer, aRxBuffer, BUFFER_SIZE); if (uwWriteReadStatus != PASSED) { /* KO */ /* Turn on LED2 */ BSP_LED_On(LED2); } else { /* OK */ /* Turn on LED1 */ BSP_LED_On(LED1); } /* Infinite loop */ while (1)//.........这里部分代码省略.........
开发者ID:eemei,项目名称:library-stm32f4,代码行数:101,
示例24: NOR_demo/** * @brief NOR Demo * @param None * @retval None */void NOR_demo(void){ /* NOR IDs structure */ static NOR_IDTypeDef pNOR_ID; NOR_SetHint(); /* STM32F427x/437x/429x/439x "Revision 3" devices: FMC dynamic and static bank switching is allowed */ if (HAL_GetREVID() >= 0x2000) {} else { /* Disable the LCD to avoid the refrech from the SDRAM */ BSP_LCD_DisplayOff(); } /*##-1- Configure the NOR device ###########################################*/ /* NOR device configuration */ if(BSP_NOR_Init() != NOR_STATUS_OK) { ubInitStatus++; } /*##-2- Read & check the NOR device IDs ####################################*/ /* Initialize the ID structure */ pNOR_ID.Manufacturer_Code = (uint16_t)0x00; pNOR_ID.Device_Code1 = (uint16_t)0x00; pNOR_ID.Device_Code2 = (uint16_t)0x00; pNOR_ID.Device_Code3 = (uint16_t)0x00; /* Read the NOR memory ID */ BSP_NOR_Read_ID(&pNOR_ID); /* Test the NOR ID correctness */ if(pNOR_ID.Manufacturer_Code != (uint16_t)0x0020) ubIDStatus++; else if(pNOR_ID.Device_Code1 != (uint16_t)0x227E) ubIDStatus++; else if (pNOR_ID.Device_Code2 != (uint16_t)0x2221) ubIDStatus++; else if (pNOR_ID.Device_Code3 != (uint16_t)0x2200) ubIDStatus++; /*##-3- Erase NOR memory ###################################################*/ /* Return to read mode */ BSP_NOR_ReturnToReadMode(); if(BSP_NOR_Erase_Block(WRITE_READ_ADDR) != NOR_STATUS_OK) { ubEraseStatus++; } /*##-4- NOR memory read/write access ######################################*/ /* Fill the buffer to write */ Fill_Buffer(nor_aTxBuffer, BUFFER_SIZE, 0xC20F); /* Write data to the NOR memory */ if(BSP_NOR_WriteData(WRITE_READ_ADDR, nor_aTxBuffer, BUFFER_SIZE) != NOR_STATUS_OK) { ubWriteStatus++; } /* Read back data from the NOR memory */ if(BSP_NOR_ReadData(WRITE_READ_ADDR, nor_aRxBuffer, BUFFER_SIZE) != NOR_STATUS_OK) { ubReadStatus++; } /*##-5- Checking data integrity ############################################*/ /* STM32F427x/437x/429x/439x "Revision 3" devices: FMC dynamic and static bank switching is allowed */ if (HAL_GetREVID() >= 0x2000) {} else { /* Enable the LCD */ BSP_LCD_DisplayOn(); /* SDRAM initialization */ BSP_SDRAM_Init(); } if(ubIDStatus != 0) { BSP_LCD_DisplayStringAt(20, 100, (uint8_t *)"NOR Read ID : FAILED.", LEFT_MODE); BSP_LCD_DisplayStringAt(20, 115, (uint8_t *)"NOR Test Aborted.", LEFT_MODE); } else { if(ubInitStatus != 0) { BSP_LCD_DisplayStringAt(20, 100, (uint8_t *)"NOR Initialization : FAILED.", LEFT_MODE); BSP_LCD_DisplayStringAt(20, 115, (uint8_t *)"NOR Test Aborted.", LEFT_MODE); } else {//.........这里部分代码省略.........
开发者ID:eemei,项目名称:library-stm32f4,代码行数:101,
示例25: BSP_LCD_Init/** * @brief Initializes the LCD. * @retval LCD state */uint8_t BSP_LCD_Init(void){ /* On STM32F429I-DISCO, it is not possible to read ILI9341 ID because */ /* PIN EXTC is not connected to VDD and then LCD_READ_ID4 is not accessible. */ /* In this case, ReadID function is bypassed.*/ /*if(ili9341_drv.ReadID() == ILI9341_ID)*/ /* LTDC Configuration ----------------------------------------------------*/ LtdcHandler.Instance = LTDC; /* Timing configuration (Typical configuration from ILI9341 datasheet) HSYNC=10 (9+1) HBP=20 (29-10+1) ActiveW=240 (269-20-10+1) HFP=10 (279-240-20-10+1) VSYNC=2 (1+1) VBP=2 (3-2+1) ActiveH=320 (323-2-2+1) VFP=4 (327-320-2-2+1) */ /* Configure horizontal synchronization width */ LtdcHandler.Init.HorizontalSync = ILI9341_HSYNC; /* Configure vertical synchronization height */ LtdcHandler.Init.VerticalSync = ILI9341_VSYNC; /* Configure accumulated horizontal back porch */ LtdcHandler.Init.AccumulatedHBP = ILI9341_HBP; /* Configure accumulated vertical back porch */ LtdcHandler.Init.AccumulatedVBP = ILI9341_VBP; /* Configure accumulated active width */ LtdcHandler.Init.AccumulatedActiveW = 269; /* Configure accumulated active height */ LtdcHandler.Init.AccumulatedActiveH = 323; /* Configure total width */ LtdcHandler.Init.TotalWidth = 279; /* Configure total height */ LtdcHandler.Init.TotalHeigh = 327; /* Configure R,G,B component values for LCD background color */ LtdcHandler.Init.Backcolor.Red= 0; LtdcHandler.Init.Backcolor.Blue= 0; LtdcHandler.Init.Backcolor.Green= 0; /* LCD clock configuration */ /* PLLSAI_VCO Input = HSE_VALUE/PLL_M = 1 Mhz */ /* PLLSAI_VCO Output = PLLSAI_VCO Input * PLLSAIN = 192 Mhz */ /* PLLLCDCLK = PLLSAI_VCO Output/PLLSAIR = 192/4 = 48 Mhz */ /* LTDC clock frequency = PLLLCDCLK / LTDC_PLLSAI_DIVR_8 = 48/4 = 6Mhz */ PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_LTDC; PeriphClkInitStruct.PLLSAI.PLLSAIN = 192; PeriphClkInitStruct.PLLSAI.PLLSAIR = 4; PeriphClkInitStruct.PLLSAIDivR = RCC_PLLSAIDIVR_8; HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); /* Polarity */ LtdcHandler.Init.HSPolarity = LTDC_HSPOLARITY_AL; LtdcHandler.Init.VSPolarity = LTDC_VSPOLARITY_AL; LtdcHandler.Init.DEPolarity = LTDC_DEPOLARITY_AL; LtdcHandler.Init.PCPolarity = LTDC_PCPOLARITY_IPC; BSP_LCD_MspInit(); HAL_LTDC_Init(&LtdcHandler); /* Select the device */ LcdDrv = &ili9341_drv; /* LCD Init */ LcdDrv->Init(); /* Initialize the SDRAM */ BSP_SDRAM_Init(); /* Initialize the font */ BSP_LCD_SetFont(&LCD_DEFAULT_FONT); return LCD_OK;}
开发者ID:mnowell129,项目名称:GliderScaleSystemWorkbench,代码行数:82,
示例26: BSP_Config/** * @brief Initializes the STM32479I-EVAL's LCD and LEDs resources. * @param None * @retval None */static void BSP_Config(void){#ifdef USE_LCD uint8_t lcd_status = LCD_OK; uint8_t sdram_status = SDRAM_OK;#endif /* USE_LCD */ /* Initialize RNG peripheral */ HAL_RNG_Init(&RngHandle); /* UART configuration */ UartHandle.Instance = USART1; UartHandle.Init.BaudRate = 9600; UartHandle.Init.WordLength = UART_WORDLENGTH_8B; UartHandle.Init.StopBits = UART_STOPBITS_1; UartHandle.Init.Parity = UART_PARITY_NONE; UartHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE; UartHandle.Init.Mode = UART_MODE_TX; UartHandle.Init.OverSampling = UART_OVERSAMPLING_16; /* Initialize UART peripheral */ HAL_UART_Init(&UartHandle); /* Configures COM1 port */ BSP_COM_Init(COM1, &UartHandle); /* Configure LED1, LED2, LED3 and LED4 */ BSP_LED_Init(LED1); BSP_LED_Init(LED2); BSP_LED_Init(LED3); BSP_LED_Init(LED4); /* Set Systick Interrupt to the highest priority */ HAL_NVIC_SetPriority(SysTick_IRQn, 0xF, 0x0); /* Init IO Expander (MFX) */ BSP_IO_Init(); /* Enable IO Expander (MFX) interrupt for ETH MII pin */ BSP_IO_ConfigPin(MII_INT_PIN, IO_MODE_IT_FALLING_EDGE);#ifdef USE_LCD /* Initialize the SDRAM */ sdram_status = BSP_SDRAM_Init(); if(sdram_status != SDRAM_OK) { Error_Handler(); } /* Initialize LCD in landscape mode in DSI mode video burst */ /* Initialize and start the LCD display in mode 'lcd_mode' * Using LCD_FB_START_ADDRESS as frame buffer displayed contents. * This buffer is modified by the BSP (draw fonts, objects depending on BSP calls). */ /* Set Portrait orientation if needed, by default orientation is set to Landscape */ /* Initialize DSI LCD */ // BSP_LCD_InitEx(LCD_ORIENTATION_PORTRAIT); /* uncomment if Portrait orientation is needed */ BSP_LCD_Init(); /* Uncomment if default config (landscape orientation) is needed */ while(lcd_status != LCD_OK); BSP_LCD_LayerDefaultInit(1, LCD_FB_START_ADDRESS); /* Set LCD Foreground Layer as active one */ BSP_LCD_SelectLayer(1); BSP_LCD_SetFont(&LCD_DEFAULT_FONT); /* Clear the LCD */ BSP_LCD_Clear(LCD_COLOR_BLACK); /* Set the LCD Back Color */ BSP_LCD_SetBackColor(LCD_COLOR_BLACK); /* Set the LCD Text Color */ BSP_LCD_SetTextColor(LCD_COLOR_WHITE); /* Display message on the LCD*/ BSP_LCD_DisplayStringAtLine(0, (uint8_t*)" STM32F479xx "); BSP_LCD_DisplayStringAtLine(1, (uint8_t*)" STM32F-4 Series "); BSP_LCD_DisplayStringAtLine(2, (uint8_t*)" SSL Client demo "); BSP_LCD_DisplayStringAtLine(3, (uint8_t*)" using HW Crypto "); BSP_LCD_DisplayStringAtLine(8, (uint8_t*)" Ethernet Initialization ..."); #endif /* USE_LCD */}
开发者ID:z80,项目名称:stm32f429,代码行数:94,
示例27: Camera_demo/** * @brief Camera demo * @param None * @retval None */void Camera_demo (void){ uint8_t status = 0; uint16_t *ptrCamera; uint32_t i; uint32_t exit = 0; Camera_SetHint(); status = BSP_JOY_Init(JOY_MODE_GPIO); /* Initialize the SDRAM for CAMERA_FRAME_BUFFER */ BSP_SDRAM_Init(); if (status != IO_OK) { BSP_LCD_SetBackColor(LCD_COLOR_WHITE); BSP_LCD_SetTextColor(LCD_COLOR_RED); BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize()- CAMERA_STATUS_TEXT_POS, (uint8_t *)"ERROR", CENTER_MODE); BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize()- CAMERA_STATUS_TEXT_POS - 15, (uint8_t *)"Joystick cannot be initialized", CENTER_MODE); status = 0; } /*## Camera Initialization and start capture ############################*/ BSP_LCD_SetBackColor(LCD_COLOR_BLUE); BSP_LCD_SetTextColor(LCD_COLOR_WHITE); BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize()- CAMERA_STATUS_TEXT_POS, (uint8_t *)"Wait for camera initialization...", CENTER_MODE); /* Init Camera buffer */ ptrCamera = (uint16_t*)(CAMERA_FRAME_BUFFER); CameraResIndex = CAMERA_R160x120; /* Set QQVGA default resolution */ CameraChangeResolutionAsked = 1; for (i=0; i<(CAMERA_QVGA_RES_X * CAMERA_QVGA_RES_Y); i++) /* Camera buffer initialization */ { ptrCamera[i]=0xFFFF; } /* Initialize IO */ BSP_IO_Init(); /* Infinite loop */ while(exit == 0) { if (CameraChangeResolutionAsked) /* A camera change resolution has been asked */ { CameraChangeResolutionAsked = 0; if (CameraResIndex > CAMERA_R160x120) { /* If camera stream already started, it has to be stopped before reconfiguration */ /* Stop camera stream */ status = BSP_CAMERA_Stop(); ASSERT(status != CAMERA_OK); /* Clear screen */ Camera_SetHint(); BSP_LCD_SetBackColor(LCD_COLOR_BLUE); BSP_LCD_SetTextColor(LCD_COLOR_WHITE); BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize()- CAMERA_STATUS_TEXT_POS, (uint8_t *)"Wait for camera initialization...", CENTER_MODE); } BSP_LCD_SetBackColor(LCD_COLOR_WHITE); BSP_LCD_SetTextColor(LCD_COLOR_BLUE); status = 0; switch (CameraResIndex) { case CAMERA_R160x120: /* Initialize the Camera */ status = BSP_CAMERA_Init(RESOLUTION_R160x120); BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize()- CAMERA_STATUS_TEXT_POS, (uint8_t *)" QQVGA camera stream ", CENTER_MODE); break; case CAMERA_R320x240: /* Initialize the Camera */ status = BSP_CAMERA_Init(RESOLUTION_R320x240); BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize()- CAMERA_STATUS_TEXT_POS, (uint8_t *)" QVGA camera stream ", CENTER_MODE); break; } if (status != CAMERA_OK) { BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize()- CAMERA_STATUS_TEXT_POS - 15, (uint8_t *)" CAMERA INIT ERROR ", CENTER_MODE); } /* Start / Restart camera stream */ BSP_CAMERA_ContinuousStart((uint8_t *)CAMERA_FRAME_BUFFER); } /* (CameraResIndex != CameraCurrentResIndex) */ /* Toggle LED4 */ BSP_LED_Toggle(LED3);//.........这里部分代码省略.........
开发者ID:451506709,项目名称:automated_machine,代码行数:101,
注:本文中的BSP_SDRAM_Init函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ BSP_SD_Init函数代码示例 C++ BSP_PB_Init函数代码示例 |