/**
  * @brief  ETH_BSP_Config
  * @param  None
  * @retval None
  */
void ETH_BSP_Config(void)
{
  RCC_ClocksTypeDef RCC_Clocks;
  
  /* Configure the GPIO ports for ethernet pins */
  ETH_GPIO_Config();
  
  /* Configure the Ethernet MAC/DMA */
  ETH_MACDMA_Config();

#ifdef USE_LCD
  if (EthInitStatus == 0)
  {
    LCD_SetTextColor(Red);
    LCD_DisplayStringLine(Line5, (uint8_t*)"   Ethernet Init   ");
    LCD_DisplayStringLine(Line6, (uint8_t*)"      failed      ");
    while(1);
  }
#endif

  /* Configure the PHY to generate an interrupt on change of link status */
  Eth_Link_PHYITConfig(DP83848_PHY_ADDRESS);

  /* Configure the EXTI for Ethernet link status. */
  Eth_Link_EXTIConfig();
  
  /* Configure Systick clock source as HCLK */
  SysTick_CLKSourceConfig(SysTick_CLKSource_HCLK);

  /* SystTick configuration: an interrupt every 10ms */
  RCC_GetClocksFreq(&RCC_Clocks);
  SysTick_Config(RCC_Clocks.HCLK_Frequency / 100);  
}
Exemplo n.º 2
0
/**
 * @brief  ETH_BSP_Config
 * @param  None
 * @retval None
 */
void ETH_BSP_Config(void) {
	RCC_ClocksTypeDef RCC_Clocks;

	/* Configure the GPIO ports for ethernet pins */
	ETH_GPIO_Config();

	/* Configure the Ethernet MAC/DMA */
	ETH_MACDMA_Config();

	if (EthInitStatus == 0) {
		printf("   Ethernet Init  \n ");
		printf("      failed      \n");
		while (1)
			;
	}

	/* Configure the PHY to generate an interrupt on change of link status */
	Eth_Link_PHYITConfig(DP83848_PHY_ADDRESS);

	/* Configure the EXTI for Ethernet link status. */
	Eth_Link_EXTIConfig();

	/* Configure Systick clock source as HCLK */
	SysTick_CLKSourceConfig(SysTick_CLKSource_HCLK);

	/* SystTick configuration: an interrupt every 10ms */
	RCC_GetClocksFreq(&RCC_Clocks);
	SysTick_Config(RCC_Clocks.HCLK_Frequency / 100);
}
Exemplo n.º 3
0
/**
 * @brief  ETH_BSP_Config
 * @param  None
 * @retval None
 */
void ETH_BSP_Config(void) {
	/***************************************************************************
	 NOTE:
	 When using Systick to manage the delay in Ethernet driver, the Systick
	 must be configured before Ethernet initialization and, the interrupt
	 priority should be the highest one.
	 *****************************************************************************/

	/* Configure the GPIO ports for ethernet pins */
	ETH_GPIO_Config();

	/* Configure the Ethernet MAC/DMA */
	ETH_MACDMA_Config();

	/* Get Ethernet link status*/
	if (ETH_ReadPHYRegister(DP83848_PHY_ADDRESS, PHY_SR ) & 1) {
		EthStatus |= ETH_LINK_FLAG;
	}

	/* Configure the PHY to generate an interrupt on change of link status */
	Eth_Link_PHYITConfig(DP83848_PHY_ADDRESS);

	/* Configure the EXTI for Ethernet link status. */
	Eth_Link_EXTIConfig();
}
/**
  * @brief  ETH_BSP_Config
  * @param  None
  * @retval None
  */
void ETH_BSP_Config(void)
{
  /* Configure the GPIO ports for ethernet pins */
  ETH_GPIO_Config();

  /* Config NVIC for Ethernet */
  //ETH_NVIC_Config();

  /* Configure the Ethernet MAC/DMA */
  ETH_MACDMA_Config();

  /* Get Ethernet link status*/
  if(ETH_ReadPHYRegister(DP83848_PHY_ADDRESS, PHY_SR) & 1)
  {
    EthStatus |= ETH_LINK_FLAG;
  }

  /* Configure the PHY to generate an interrupt on change of link status */
  Eth_Link_PHYITConfig(DP83848_PHY_ADDRESS);

  /* Configure the EXTI for Ethernet link status. */
  Eth_Link_EXTIConfig();
  
  if (ETH_link_xSemaphore == NULL)
  {
    /* create binary semaphore used for ETH_link handling */
    vSemaphoreCreateBinary( ETH_link_xSemaphore );
  }

  /* create the task that handles the ETH_link */
  xTaskCreate(Eth_Link_IT_task, (signed char*) "E_link", ETH_LINK_TASK_STACK_SIZE, (void *)DP83848_PHY_ADDRESS,
              ETH_LINK_TASK_PRIORITY,NULL);
}
Exemplo n.º 5
0
/**
 * @brief Late initialization after heap and global initializations.
 */
void late_init()
{
	/**
	 * Open the standard I/O.
	 */
	 caribou_uart_config_t config;
	_stdout = _stdin = _stderr = fopen(CONSOLE_USART,"rw");
	caribou_uart_init_config(&config);
	config.baud_rate	= CARIBOU_UART_BAUD_RATE_115200;
	config.word_size	= CARIBOU_UART_WORDSIZE_8;
	config.stop_bits	= CARIBOU_UART_STOPBITS_1;
	config.parity_bits	= CARIBOU_UART_PARITY_NONE;
	config.flow_control	= /* CARIBOU_UART_FLOW_NONE */ CARIBOU_UART_FLOW_RTS_CTS;
	caribou_uart_set_config(CONSOLE_USART,&config);

	#if 0
		caribou_vector_install(ETH_LINK_EXTI_IRQn,isr_phy_eth0,&network_interface.phyAddress);
		caribou_vector_install(ETH_IRQn,isr_eth0,NULL);

		/* Configure the Ethernet MAC/DMA */
		ETH_MACDMA_Config();
		/* Configure the PHY to generate an interrupt on change of link status */
		Eth_Link_PHYITConfig(DP83848_PHY_ADDRESS);
		/* Configure the EXTI for Ethernet link status. */
		Eth_Link_EXTIConfig();
		/* Enable the interrupt vectors... */
		caribou_vector_enable(ETH_LINK_EXTI_IRQn);
		caribou_vector_enable(ETH_IRQn);
	#endif

		caribou_gpio_set(&led1);
		caribou_gpio_set(&led2);
		caribou_gpio_set(&led3);
		caribou_gpio_set(&led4);
}
Exemplo n.º 6
0
/**
  * @brief  ETH_BSP_Config
  * @param  None
  * @retval None
  */
void ETH_BSP_Config(void)
{
  RCC_ClocksTypeDef RCC_Clocks;

  /***************************************************************************
    NOTE: 
         When using Systick to manage the delay in Ethernet driver, the Systick
         must be configured before Ethernet initialization and, the interrupt 
         priority should be the highest one.
  *****************************************************************************/

  /* Configure Systick clock source as HCLK */
  SysTick_CLKSourceConfig(SysTick_CLKSource_HCLK);

  /* SystTick configuration: an interrupt every 10ms */
  RCC_GetClocksFreq(&RCC_Clocks);
  SysTick_Config(RCC_Clocks.HCLK_Frequency / 100);

  /* Set Systick interrupt priority to 0*/
  NVIC_SetPriority (SysTick_IRQn, 0);

  /* Configure the GPIO ports for ethernet pins */
  ETH_GPIO_Config();

  /* Configure the Ethernet MAC/DMA */
  ETH_MACDMA_Config();

  /* Get Ethernet link status*/
  if(ETH_ReadPHYRegister(DP83848_PHY_ADDRESS, PHY_SR) & 1)
  {
  	//printf("link\n");
    EthStatus |= ETH_LINK_FLAG;
  }
  //else
  	//printf("unlink\n");

  /* Configure the PHY to generate an interrupt on change of link status */
  Eth_Link_PHYITConfig(DP83848_PHY_ADDRESS);

  /* Configure the EXTI for Ethernet link status. */
  Eth_Link_EXTIConfig(); 
}
Exemplo n.º 7
0
/**
  * @brief  ETH_BSP_Config
  * @param  None
  * @retval None
  */
void ETH_BSP_Config(void)
{
  
  
  /* Configure the GPIO ports for ethernet pins */
  ETH_GPIO_Config();
  
  /* Config NVIC for Ethernet */
  ETH_NVIC_Config();

  /* Configure the Ethernet MAC/DMA */
  ETH_MACDMA_Config();

  if (EthInitStatus == 0)
  {
    while(1);
  }

  /* Configure the PHY to generate an interrupt on change of link status */
  Eth_Link_PHYITConfig(DP83848_PHY_ADDRESS);

  /* Configure the EXTI for Ethernet link status. */
  Eth_Link_EXTIConfig();
}