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


C++ BSP_SDRAM_Init函数代码示例

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


在下文中一共展示了BSP_SDRAM_Init函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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,代码来源:k_bsp.c

示例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,代码来源:main.c

示例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,代码来源:sdram.c

示例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,代码来源:main.c

示例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,代码来源:stm32746g_discovery_lcd.c

示例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,代码来源:sdram_diskio.c

示例7: main

int 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,代码来源:main.c

示例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,代码来源:k_bsp.c

示例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,代码来源:main.c

示例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,代码来源:main.c

示例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,代码来源:k_bsp.c

示例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,代码来源:k_bsp.c

示例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,代码来源:k_bsp.c

示例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,代码来源:main.c

示例15: system_init

void 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,代码来源:system.c


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