• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ Fill_Buffer函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: UsartDMA_Send

void UsartDMA_Send(INT8U *data)
{ 
  if(usart_reset_key < 5)
  {		
	  Fill_Buffer(TxBuffer_dma_save[tx_count], 24, data);
    tx_count++;
    if (tx_count > 9) tx_count = 0; 
    if(data_complete) 
    {	
      Fill_Buffer(TxBuffer_dma, 24, TxBuffer_dma_save[tx_now_send]);
      data_complete = FALSE;
      DMA_Cmd(USARTx_TX_DMA_STREAM, ENABLE);
    }
	}
}
开发者ID:wangxubo1988,项目名称:Center_System,代码行数:15,代码来源:usart_dma.c


示例2: main

int main(void)
{
	uint8_t i;
	printf("SBN1 test 5 \r\n");

	// lock 0xAB 01000
	Fill_Buffer(0x0A, 0x53, 0x42, 0x4E, 0x31, 0x00, 0x03, 0xB4, 0x07, 0xAB, 0x02);
	SBN1_Handle_Reveived();

	// lock 0xAB 00111
	Fill_Buffer(0x0A, 0x53, 0x42, 0x4E, 0x31, 0x01, 0x03, 0xCE, 0x07, 0xAB, 0x1C);
	SBN1_Handle_Reveived();

	return 0;
}
开发者ID:BHFaction,项目名称:SanBot,代码行数:15,代码来源:test6.c


示例3: SD_SingleBlockTest

/**
 * @brief Tests the SD card Single Blocks operations.
 * @param None
 * @retval None
 */
static void SD_SingleBlockTest(void)
{
    SD_Error status;
    /*---------------Block Read/Write----------------*/
    /* Fill the buffer to send */
    Fill_Buffer(aBuffer_Block_Tx, BLOCK_SIZE, 0x320F);

    /* Write Block of 512 bytes on address 0 */
    status = SD_WriteBlock(aBuffer_Block_Tx, 0x00, BLOCK_SIZE);
    /* check if the Transfer finished */
    status = SD_WaitWriteOperation();
    while(SD_GetStatus() != SD_TRANSFER_OK);

    if(status == SD_OK)
    {
	/* Read Block of 512 bytes on address 0 */
	status = SD_ReadBlock(aBuffer_Block_Rx, 0x00, BLOCK_SIZE);
	/* check if the Transfer finished */
	status = SD_WaitReadOperation();
	while(SD_GetStatus() != SD_TRANSFER_OK);
    }

    /* Check the correctness of written data */
    if(status == SD_OK)
    {
	TransferStatus1 = Buffercmp(aBuffer_Block_Tx, aBuffer_Block_Rx,BLOCK_SIZE);
    }

    if(TransferStatus1 == PASSED) printf("SD single block test passed!\n\r");
}
开发者ID:jssmile,项目名称:Plotter,代码行数:35,代码来源:sdio_debug.c


示例4: SD_MultiBlockTest

/**
 * @brief Tests the SD card Multiple Blocks operations.
 * @param None
 * @retval None
 */
static void SD_MultiBlockTest(void)
{
    SD_Error status;

    /* Fill the buffer to send */
    Fill_Buffer(aBuffer_MultiBlock_Tx, MULTI_BUFFER_SIZE, 0x0);

    /* Write Multiple Block of many bytes on address 0 */
    status = SD_WriteMultiBlocksFIXED(aBuffer_MultiBlock_Tx, 0, BLOCK_SIZE, NUMBER_OF_BLOCKS);
    /* check if the Transfer finished */
    status = SD_WaitWriteOperation();
    while(SD_GetStatus() != SD_TRANSFER_OK);

    if(status == SD_OK)
    {
	/* Read Block of many bytes from address 0 */
	status = SD_ReadMultiBlocksFIXED(aBuffer_MultiBlock_Rx, 0, BLOCK_SIZE, NUMBER_OF_BLOCKS);
	/* check if the Transfer finished */
	status = SD_WaitReadOperation();
	while(SD_GetStatus() != SD_TRANSFER_OK);
    }

    /* Check the correctness of written data */
    if(status == SD_OK)
    {
	TransferStatus2 = Buffercmp(aBuffer_MultiBlock_Tx, aBuffer_MultiBlock_Rx,MULTI_BUFFER_SIZE);
    }

    if(TransferStatus2 == PASSED) printf("SD Multiple block test passed!\n\r");

}
开发者ID:jssmile,项目名称:Plotter,代码行数:36,代码来源:sdio_debug.c


示例5: Sram_thread_entry

void Sram_thread_entry(void* parameter)
{
	rt_tick_t t1,t2;
	SRAM_Init();
	Fill_Buffer(aTxBuffer, BUFFER_SIZE, 0xA244250F);  
	//DMA_Config();
//	while(flag)
//	{
//		rt_thread_delay(1);
//	}
	rt_sem_take(&rt_sram_sem, RT_WAITING_FOREVER);
	while(flag1)
	{
		int fd;
		//int i=1024;
		fd = open("/ud/text.txt", O_WRONLY | O_CREAT,0);	
			if (fd >= 0)
			{
				t1 = rt_tick_get();
//				while(i>0)
//				{
					write(fd, RAM_Buffer, sizeof(RAM_Buffer));
//					i--;
//				}
				t2 = rt_tick_get();
				rt_kprintf("%d\n\r",t2-t1);
				close(fd);
			}
			rt_thread_delay(100);
		//SRAM_ReadBuffer(aTxBuffer,0,BUFFER_SIZE);
	}
	while(1);
	//Fill_Buffer(aTxBuffer, BUFFER_SIZE, 0xA244250F); 
}
开发者ID:XHelaoshi,项目名称:USER,代码行数:34,代码来源:fsmc_sram.c


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


示例7: main

/**
  * @brief  Main program
  * @param  None
  * @retval None
  */
int main(void)
{  
  /*!< At this stage the microcontroller clock setting is already configured, 
       this is done through SystemInit() function which is called from startup
       files (startup_stm32f40_41xxx.s/startup_stm32f427_437xx.s/
       startup_stm32f429_439xx.s/startup_stm32f401xx.s) before to branch to 
       application main. To reconfigure the default setting of SystemInit() 
       function, refer to system_stm32f4xx.c file
     */     
  
  /* Initialize LEDs on STM324x9I-EVAL board */
  STM_EVAL_LEDInit(LED1);
  STM_EVAL_LEDInit(LED2);    
  
  /* Configure the FMC interface : SDRAM */
  FMC_Config();
    
  /* Fill the buffer to write */
  Fill_Buffer(aTxBuffer, BUFFER_SIZE, 0x250F);   
  
  /* Write data to the SDRAM memory */
  for (uwIndex = 0; uwIndex < BUFFER_SIZE; uwIndex++)
  {
    *(__IO uint32_t*) (SDRAM_BANK_ADDR + WRITE_READ_ADDR + 4*uwIndex) = aTxBuffer[uwIndex];
  }    
  
  /* Read back data from the SDRAM memory */
  for (uwIndex = 0; uwIndex < BUFFER_SIZE; uwIndex++)
  {
    aRxBuffer[uwIndex] = *(__IO uint32_t*) (SDRAM_BANK_ADDR + WRITE_READ_ADDR + 4*uwIndex);
  } 
   
  /* Check the SDRAM memory content correctness */   
  for (uwIndex = 0; (uwIndex < BUFFER_SIZE) && (uwWriteReadStatus == 0); uwIndex++)
  {
    if (aRxBuffer[uwIndex] != aTxBuffer[uwIndex])
    {
      uwWriteReadStatus++;
    }
  }	

  if (uwWriteReadStatus)
  {
    /* KO */
    /* Turn on LD2 */
    STM_EVAL_LEDOn(LED2);     
  }
  else
  { 
    /* OK */
    /* Turn on LD1 */
    STM_EVAL_LEDOn(LED1);
  }

  while (1)
  {
  } 
  
}
开发者ID:CristianKrieger,项目名称:InterfazAdquisicionNTSC,代码行数:64,代码来源:main.c


示例8: main

/**
  * @brief   Main program.
  * @param  None
  * @retval None
  */
int main(void)
{
    /* System Clocks Configuration */
    RCC_Configuration();

    /* Initialize Leds mounted on STM3210X-EVAL board */
    STM_EVAL_LEDInit(LED1);
    STM_EVAL_LEDInit(LED2);

    /* Write/read to/from FSMC SRAM memory  *************************************/
    /* Enable the FSMC Clock */
    RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC, ENABLE);

    /* Configure FSMC Bank1 NOR/SRAM2 */
    FSMC_NOR_Init();

    /* Read NOR memory ID */
    FSMC_NOR_ReadID(&NOR_ID);

    FSMC_NOR_ReturnToReadMode();

    /* Erase the NOR memory block to write on */
    FSMC_NOR_EraseBlock(WRITE_READ_ADDR);

    /* Write data to FSMC NOR memory */
    /* Fill the buffer to send */
    Fill_Buffer(TxBuffer, BUFFER_SIZE, 0x3210);
    FSMC_NOR_WriteBuffer(TxBuffer, WRITE_READ_ADDR, BUFFER_SIZE);

    /* Read data from FSMC NOR memory */
    FSMC_NOR_ReadBuffer(RxBuffer, WRITE_READ_ADDR, BUFFER_SIZE);

    /* Read back NOR memory and check content correctness */
    for (Index = 0x00; (Index < BUFFER_SIZE) && (WriteReadStatus == 0); Index++)
    {
        if (RxBuffer[Index] != TxBuffer[Index])
        {
            WriteReadStatus = Index + 1;
        }
    }

    if (WriteReadStatus == 0)
    {
        /* OK */
        /* Turn on LED1 */
        STM_EVAL_LEDOn(LED1);
    }
    else
    {
        /* KO */
        /* Turn on LED2 */
        STM_EVAL_LEDOn(LED2);
    }

    while (1)
    {
    }
}
开发者ID:qiubailiang,项目名称:src_docs,代码行数:63,代码来源:main.c


示例9: main

/**
  * @brief  Main program
  * @param  None
  * @retval None
  */
int main(void)
{
    /* Configure the MPU attributes as Write Through */
    MPU_Config();

    /* Enable the CPU Cache */
    CPU_CACHE_Enable();

    /* STM32F7xx HAL library initialization:
         - Configure the Flash ART accelerator on ITCM interface
         - 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 LED1 and LED3 */
    BSP_LED_Init(LED1);
    BSP_LED_Init(LED3);

    /* Configure the system clock to 200 MHz */
    /* This function will be executed from SDRAM */
    SystemClock_Config();

    /*##-1- Fill the buffer in the SDRAM device ##########################################*/
    Fill_Buffer(aTable, 1024, 0);

    /*##-2- Read address of the buffer and stack pointer address ########################*/
    uwTabAddr = (uint32_t)aTable; /* should be above 0x60000000 */

    /* Get main stack pointer value */
    MSPValue = __get_MSP(); /* should be above 0x60000000 */

    /*##-3- Activate LEDs pending on read values ########################################*/
    if ((uwTabAddr >= SDRAM_ADDRESS) && (MSPValue >= SDRAM_ADDRESS))
    {
        BSP_LED_On(LED1);
    }
    else
    {   /* Toggle LED3 in an infinite loop */
        while (1)
        {
            BSP_LED_Toggle(LED3);
            /* Insert delay 100 ms */
            HAL_Delay(100);
        }
    }

    /* Infinite loop */
    while (1)
    {
    }
}
开发者ID:MrZANE42,项目名称:verisure1512,代码行数:62,代码来源:main.c


示例10: main

/**
  * @brief   Main program.
  * @param  None
  * @retval None
  */
int 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_stm32f10x_xx.s) before to branch to application main.
       To reconfigure the default setting of SystemInit() function, refer to
       system_stm32f10x.c file
     */     

  /* Initialize Leds mounted on STM3210X-EVAL board */
  STM_EVAL_LEDInit(LED1);
  STM_EVAL_LEDInit(LED2);
  
  /* Write/read to/from FSMC SRAM memory  *************************************/
  /* Enable the FSMC Clock */
  RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC, ENABLE);
  
  /* Configure FSMC Bank1 NOR/SRAM3 */
  SRAM_Init();

  /* Write data to FSMC SRAM memory */
  /* Fill the buffer to send */
  Fill_Buffer(TxBuffer, BUFFER_SIZE, 0x3212);
  SRAM_WriteBuffer(TxBuffer, WRITE_READ_ADDR, BUFFER_SIZE);


  /* Read data from FSMC SRAM memory */
  SRAM_ReadBuffer(RxBuffer, WRITE_READ_ADDR, BUFFER_SIZE);  

  /* Read back SRAM memory and check content correctness */   
  for (Index = 0x00; (Index < BUFFER_SIZE) && (WriteReadStatus == 0); Index++)
  {
    if (RxBuffer[Index] != TxBuffer[Index])
    {
      WriteReadStatus = Index + 1;
    }
  }

  if (WriteReadStatus == 0)
  { 
    /* OK */
    /* Turn on LED1 */
    STM_EVAL_LEDOn(LED1);
  }
  else
  { 
    /* KO */
    /* Turn on LED2 */
    STM_EVAL_LEDOn(LED2);
  }

  while (1)
  {
  }
}
开发者ID:Dzenik,项目名称:QuadVolucer,代码行数:60,代码来源:main.c


示例11: main

/**
  * @brief  Main program
  * @param  None
  * @retval None
  */
int main(void)
{
  /*!< At this stage the microcontroller clock setting is already configured, 
       this is done through SystemInit() function which is called from startup
       files (startup_stm32f40xx.s/startup_stm32f427x.s) before to branch to 
       application main. 
       To reconfigure the default setting of SystemInit() function, refer to
       system_stm32f4xx.c file
     */     
     
  /* Initialize LEDs on EVAL board */
  STM_EVAL_LEDInit(LED1);
  STM_EVAL_LEDInit(LED2);    
  
  /* Initialize the SRAM memory */
  SRAM_Init();
  
  /* Fill the buffer to send */
  Fill_Buffer(aTxBuffer, BUFFER_SIZE, 0x250F);
  
  /* Write data to the SRAM memory */
  SRAM_WriteBuffer(aTxBuffer, WRITE_READ_ADDR, BUFFER_SIZE);  
    
  /* Read back data from the SRAM memory */
  SRAM_ReadBuffer(aRxBuffer, WRITE_READ_ADDR, BUFFER_SIZE); 
   
  /* Check the SRAM memory content correctness */   
  for (uwIndex = 0; (uwIndex < BUFFER_SIZE) && (uwWriteReadStatus_SRAM == 0); uwIndex++)
  {
    if (aRxBuffer[uwIndex] != aTxBuffer[uwIndex])
    {
      uwWriteReadStatus_SRAM++;
    }
  }

  
  if (uwWriteReadStatus_SRAM)
  {
    /* KO */
    /* Turn on LD2 */
    STM_EVAL_LEDOn(LED2);  
  }
  else
  { 
    /* OK */
    /* Turn on LD1 */
    STM_EVAL_LEDOn(LED1);   
  }

  while (1)
  {
  } 
  
}
开发者ID:BlockWorksCo,项目名称:Platform,代码行数:59,代码来源:main.c


示例12: main

/**
  * @brief  Main program.
  * @param  None
  * @retval None
  */
int 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_stm32f0xx.s) before to branch to application main.
  To reconfigure the default setting of SystemInit() function, refer to
  system_stm32f0xx.c file
  */
  
  /* Initialize Leds mounted on STM320518-EVAL board */
  STM_EVAL_LEDInit(LED1);
  STM_EVAL_LEDInit(LED2);
  
  /* Initializes the SD/SPI communication */
  Status = SD_Init();	
  
  /* If SD is responding */
  if (Status == SD_RESPONSE_NO_ERROR)
  {
    /* Fill the buffer to send */
    Fill_Buffer(Buffer_Block_Tx, BUFFERSIZE, 0x0);
    
    /* Write block of 512 bytes on address 0 */
    Status = SD_WriteBlock(Buffer_Block_Tx, 0, BUFFERSIZE);
    
    /* Read block of 512 bytes from address 0 */
    Status = SD_ReadBlock(Buffer_Block_Rx, 0, BUFFERSIZE);
    
    /* Check the corectness of written dada */
    TransferStatus = Buffercmp(Buffer_Block_Tx, Buffer_Block_Rx, BUFFERSIZE);
    
    if (TransferStatus == PASSED)
    {
      /* OK: Turn on LD1 */
      STM_EVAL_LEDOn(LED1);
    }
    else
    {
      /* Error: Turn on LD2 */
      STM_EVAL_LEDOn(LED2);
    }
  }
  else
  {
    /* Error: Turn on LD2 */
    STM_EVAL_LEDOn(LED2);
  }
  
  while (1)
  {
  }
  
}
开发者ID:Qasemt,项目名称:STM32F0xx_StdPeriph_Lib_V1.0.0,代码行数:58,代码来源:main.c


示例13: SD_SingleBlockTest

/**
 * @brief	Tests the SD card Single Blocks operations.
 * @param	None
 * @retval	None
 */
void SD_SingleBlockTest(void)
{
	TestStatus TransferStatus1 = FAILED;

	/* Fill the buffer to send */
	Fill_Buffer(Buffer_Block_Tx, BLOCK_SIZE, 0x320F);

	/* Write block of 512 bytes on address 0 */
	Status = SDC_WriteBlock(Buffer_Block_Tx, 0x00, BLOCK_SIZE);

	/* Check if the Transfer is finished */
	Status = SDC_WaitWriteOperation();
	while(SDC_GetStatus() != SD_TRANSFER_OK);
	
	if (Status == SD_OK)
	{
		/* Read block of 512 bytes from address 0 */
		Status = SDC_ReadBlock(Buffer_Block_Rx, 0x00, BLOCK_SIZE);

		/* Check if the Transfer is finished */
		Status = SDC_WaitReadOperation();
		while(SDC_GetStatus() != SD_TRANSFER_OK);
	}
	else
	{
		printf("SD_SingleBlockTest:SDC_WriteBlock failed with %d\n",Status);
	}

	/* Check the correctness of written data */
	if (Status == SD_OK)
	{
		TransferStatus1 = Buffercmp(Buffer_Block_Tx, Buffer_Block_Rx, \
			BLOCK_SIZE);

		if(TransferStatus1 == PASSED)
		{
			printf("SD_SingleBlockTest() passed\n");
		}
		else
		{
			printf("SD_SingleBlockTest():Buffercmp failed\n");
		}
	}
	else
	{
		printf("SD_SingleBlockTest:SDC_ReadBlock failed with %d\n",Status);
	}
	
}
开发者ID:lilpako,项目名称:ministm32-bsp,代码行数:54,代码来源:main.c


示例14: SD_MultiBlockTest

/**
 * @brief	Tests the SD card Multiple Blocks operations.
 * @param	None
 * @retval	None
 */
void SD_MultiBlockTest(void)
{
	TestStatus TransferStatus2 = FAILED;
	
	/* Fill the buffer to send */
	Fill_Buffer(Buffer_MultiBlock_Tx, MULTI_BUFFER_SIZE, 0x0);
	
	/* Write multiple block of many bytes on address 0 */
	Status = SDC_WriteMultiBlocks(Buffer_MultiBlock_Tx, 0x00, \
		BLOCK_SIZE, NUMBER_OF_BLOCKS);

	/* Check if the Transfer is finished */
	Status = SDC_WaitWriteOperation();
	while(SDC_GetStatus() != SD_TRANSFER_OK);
	
	if (Status == SD_OK)
	{
		/* Read block of many bytes from address 0 */
		Status = SDC_ReadMultiBlocks(Buffer_MultiBlock_Rx, 0x00, \
			BLOCK_SIZE, NUMBER_OF_BLOCKS);
		/* Check if the Transfer is finished */
		Status = SDC_WaitReadOperation();
		while(SDC_GetStatus() != SD_TRANSFER_OK);
	}
	else
	{
		printf("SD_MultiBlockTest:SDC_WriteMultiBlock failed\n");
	}
	
	/* Check the correctness of written data */
	if (Status == SD_OK)
	{
		TransferStatus2 = Buffercmp(Buffer_MultiBlock_Tx, \
			Buffer_MultiBlock_Rx, MULTI_BUFFER_SIZE);
		if(TransferStatus2 == PASSED)
		{
			printf("SD_MultiBlockTest passed\n");
		}
		else
		{
			printf("SD_MultiBlockTest:Buffercmp failed\n");
		}
	}
	else
	{
		printf("SD_MultiBlockTest:SDC_ReadMultiBlock failed\n");
	}
	
}
开发者ID:lilpako,项目名称:ministm32-bsp,代码行数:54,代码来源:main.c


示例15: main

int main(void)
{
    uint8_t i;
    printf("SBN1 test 2 \r\n");

    Fill_Buffer(0x09, 0x53, 0x42, 0x4E, 0x31, 0x00, 0x02, 0x04, 0x03, 0x01);
    SBN1_Handle_Reveived();

    for(i = 0x00; i < 0xff; i++)
    {
        SBN1_Loop();
    }

    return 0;
}
开发者ID:BHFaction,项目名称:SanBot,代码行数:15,代码来源:test2.c


示例16: main

/**
  * @brief  Main program
  * @param  None
  * @retval None
  */
int main(void)
{
  /* 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();
  
  /* Configure LED1 and LED2 */
  BSP_LED_Init(LED1);
  BSP_LED_Init(LED3);

  /*##-1- Fill the buffer in the SRAM device ##########################################*/
  Fill_Buffer(aTable, 1024, 0);

  /*##-2- Read address of the buffer and stack pointer address ########################*/
  uwTabAddr = (uint32_t)aTable; /* should be above 0x64000000 */
  
  /* Get main stack pointer value */
  MSPValue = __get_MSP(); /* should be above 0x64000000 */

  /*##-3- Activate LEDs pending on read values ########################################*/
  if ((uwTabAddr >= SRAM_ADDRESS) && (MSPValue >= SRAM_ADDRESS))
  {
    BSP_LED_On(LED1);
  } else
  {
    BSP_LED_On(LED3);
  }

  /* Infinite loop */
  while (1)
  {
  }
}
开发者ID:pierreroth64,项目名称:STM32Cube_FW_F4,代码行数:49,代码来源:main.c


示例17: SD_SingleBlockTest

/**
  * @brief  Tests the SD card Single Blocks operations.
  * @param  None
  * @retval None
  */
void SD_SingleBlockTest(void)
{
  /*------------------- Block Read/Write --------------------------*/
  /* Fill the buffer to send */
  Fill_Buffer(Buffer_Block_Tx, BLOCK_SIZE, 0x320F);

  if (Status == SD_OK)
  {
    /* Write block of 512 bytes on address 0 */
    Status = SD_WriteBlock(Buffer_Block_Tx, 0x00, BLOCK_SIZE);
    /* Check if the Transfer is finished */
    Status = SD_WaitWriteOperation();
    while(SD_GetStatus() != SD_TRANSFER_OK);
  }

  if (Status == SD_OK)
  {
    /* Read block of 512 bytes from address 0 */
    Status = SD_ReadBlock(Buffer_Block_Rx, 0x00, BLOCK_SIZE);
    /* Check if the Transfer is finished */
    Status = SD_WaitReadOperation();
    while(SD_GetStatus() != SD_TRANSFER_OK);
  }

  /* Check the correctness of written data */
  if (Status == SD_OK)
  {
    TransferStatus1 = Buffercmp(Buffer_Block_Tx, Buffer_Block_Rx, BLOCK_SIZE);
  }
  
  if(TransferStatus1 == PASSED)
  {
    STM_EVAL_LEDOn(LED2);
	LCD_DisplayStringLine(LCD_LINE_2, "Passed");
  }
  else
  {
    STM_EVAL_LEDOff(LED2);
    STM_EVAL_LEDOn(LED4);    
	LCD_DisplayStringLine(LCD_LINE_2, "failed");
  }
}
开发者ID:ahmadrezahossiny,项目名称:stm32f4_extboard_periph_examples,代码行数:47,代码来源:main.c


示例18: SD_MultiBlockTest

/**
  * @brief  Tests the SD card Multiple Blocks operations.
  * @param  None
  * @retval None
  */
void SD_MultiBlockTest(void)
{
  /*--------------- Multiple Block Read/Write ---------------------*/
  /* Fill the buffer to send */
  Fill_Buffer(Buffer_MultiBlock_Tx, MULTI_BUFFER_SIZE, 0x0);

  if (Status == SD_OK)
  {
    /* Write multiple block of many bytes on address 0 */
    Status = SD_WriteMultiBlocks(Buffer_MultiBlock_Tx, 0x00, BLOCK_SIZE, NUMBER_OF_BLOCKS);
    /* Check if the Transfer is finished */
    Status = SD_WaitWriteOperation();
    while(SD_GetStatus() != SD_TRANSFER_OK);
  }

  if (Status == SD_OK)
  {
    /* Read block of many bytes from address 0 */
    Status = SD_ReadMultiBlocks(Buffer_MultiBlock_Rx, 0x00, BLOCK_SIZE, NUMBER_OF_BLOCKS);
    /* Check if the Transfer is finished */
    Status = SD_WaitReadOperation();
    while(SD_GetStatus() != SD_TRANSFER_OK);
  }

  /* Check the correctness of written data */
  if (Status == SD_OK)
  {
    TransferStatus2 = Buffercmp(Buffer_MultiBlock_Tx, Buffer_MultiBlock_Rx, MULTI_BUFFER_SIZE);
  }
  
  if(TransferStatus2 == PASSED)
  {
    STM_EVAL_LEDOn(LED3);
	LCD_DisplayStringLine(LCD_LINE_2, "Passed");
  }
  else
  {
    STM_EVAL_LEDOff(LED3);
    STM_EVAL_LEDOn(LED4);    
	LCD_DisplayStringLine(LCD_LINE_2, "failed");
  }
}
开发者ID:ahmadrezahossiny,项目名称:stm32f4_extboard_periph_examples,代码行数:47,代码来源:main.c


示例19: SD_SingleBlockTest

/**
  * @brief  Tests the SD card Single Blocks operations.
  * @param  None
  * @retval None
  */
void SD_SingleBlockTest(void)
{
  /*------------------- Block Read/Write --------------------------*/
  /* Fill the buffer to send */
  Fill_Buffer(Buffer_Block_Tx, BLOCK_SIZE, 0x320F);

  if (Status == SD_OK)
  {
    /* Write block of 512 bytes on address 0 */
    Status = SD_WriteBlock(Buffer_Block_Tx, 0x00, BLOCK_SIZE);
    /* Check if the Transfer is finished */
    Status = SD_WaitWriteOperation();
    while(SD_GetStatus() != SD_TRANSFER_OK);
  }

  if (Status == SD_OK)
  {
    /* Read block of 512 bytes from address 0 */
    Status = SD_ReadBlock(Buffer_Block_Rx, 0x00, BLOCK_SIZE);
    /* Check if the Transfer is finished */
    Status = SD_WaitReadOperation();
    while(SD_GetStatus() != SD_TRANSFER_OK);
  }

  /* Check the correctness of written data */
  if (Status == SD_OK)
  {
    TransferStatus1 = Buffercmp(Buffer_Block_Tx, Buffer_Block_Rx, BLOCK_SIZE);
  }
  
  if(TransferStatus1 == PASSED)
  {
	  xprintf("Block test passed\n");
  }
  else
  {
	  xprintf("Block test failed\n");
  }
}
开发者ID:art1,项目名称:FloatSat-Project-G9,代码行数:44,代码来源:sd_tests.cpp


示例20: BSP_TEST_SDIO

uint8_t BSP_TEST_SDIO(void)
{
	uint8_t t_status = 0;

	/*-------------------------- SD Init ----------------------------- */
	BSP_SDCARD_ENABLE();

	Status = SD_Init();

	if (Status == SD_OK)
	{
	/*----------------- Read CSD/CID MSD registers ------------------*/
		Status = SD_GetCardInfo(&SDCardInfo);
	}

	if (Status == SD_OK)
	{
	  /*----------------- Select Card --------------------------------*/
	  Status = SD_SelectDeselect((uint32_t) (SDCardInfo.RCA << 16));
	}

	if (Status == SD_OK)
	{
	  Status = SD_EnableWideBusOperation(SDIO_BusWide_4b);
	}

	/*------------------- Block Erase -------------------------------*/
	if (Status == SD_OK)
	{
	    /* Erase NumberOfBlocks Blocks of WRITE_BL_LEN(512 Bytes) */
	  Status = SD_Erase(0x00, (SDIO_BLOCK_SIZE * SDIO_NB_BLOCK));
	}

	/* Set Device Transfer Mode to DMA */
	if (Status == SD_OK)
	{
	  Status = SD_SetDeviceMode(SD_DMA_MODE);
	}

	if (Status == SD_OK)
	{
	  Status = SD_ReadMultiBlocks(0x00, Buffer_MultiBlock_Rx, SDIO_BLOCK_SIZE, SDIO_NB_BLOCK);
	}

	if (Status == SD_OK)
	{
		t_status = eBuffercmp(Buffer_MultiBlock_Rx, SDIO_MULTIWSIZE);
	}

	/*------------------- Block Read/Write --------------------------*/
	/* Fill the buffer to send */
	Fill_Buffer(Buffer_Block_Tx, SDIO_BUFFERW_SIZE, 0xFFFF);

	if (Status == SD_OK)
	{
	  /* Write block of 512 bytes on address 0 */
	  Status = SD_WriteBlock(0x00, Buffer_Block_Tx, SDIO_BLOCK_SIZE);
	}

	if (Status == SD_OK)
	{
	  /* Read block of 512 bytes from address 0 */
	  Status = SD_ReadBlock(0x00, Buffer_Block_Rx, SDIO_BLOCK_SIZE);
	}

	if (Status == SD_OK)
	{
	  /* Check the corectness of written dada */
		t_status &= Buffercmp(Buffer_Block_Tx, Buffer_Block_Rx, SDIO_BUFFERW_SIZE);
	}

	BSP_SDCARD_DISABLE();

	return t_status;
}
开发者ID:ozwin,项目名称:erts-project,代码行数:75,代码来源:bsp.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ Filter函数代码示例发布时间:2022-05-30
下一篇:
C++ FillRect函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap