drv_ethernet.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /***************************************************************************//**
  2. * @file drv_ethernet.h
  3. * @brief Ethernet driver (SPI mode) of RT-Thread RTOS for using EFM32 USART
  4. * module
  5. * This driver is tested by using the Microchip ENC28J60 stand-alone Ethernet
  6. * controller with SPI interface.
  7. * COPYRIGHT (C) 2012, RT-Thread Development Team
  8. * @author onelife
  9. * @version 1.0
  10. *******************************************************************************
  11. * @section License
  12. * The license and distribution terms for this file may be found in the file
  13. * LICENSE in this distribution or at http://www.rt-thread.org/license/LICENSE
  14. *******************************************************************************
  15. * @section Change Logs
  16. * Date Author Notes
  17. * 2011-06-22 onelife Initial creation for using EFM32 USART module
  18. ******************************************************************************/
  19. #ifndef __DEV_ETHERNET_H__
  20. #define __DEV_ETHERNET_H__
  21. /* Includes ------------------------------------------------------------------*/
  22. #include "enc28j60.h"
  23. /* Exported types ------------------------------------------------------------*/
  24. /* Exported constants --------------------------------------------------------*/
  25. /* Exported macro ------------------------------------------------------------*/
  26. #define ETH_ADDR_LEN (6)
  27. #define ETH_CLK_MAX (10000000) /* Should be more than 8 Mz (Errata 1) */
  28. //#define ETH_HALF_DUPLEX
  29. #define ETH_PERIOD_WAIT_INIT (RT_TICK_PER_SECOND/100)
  30. #define ETH_PERIOD_WAIT_TX (RT_TICK_PER_SECOND/100)
  31. #define ETH_SPI_RX_SKIP (1)
  32. #define ETH_RESET_PORT (gpioPortB)
  33. #define ETH_RESET_PIN (9)
  34. #define ETH_INT_PORT (gpioPortB)
  35. #define ETH_INT_PIN (10)
  36. /* Exported functions ------------------------------------------------------- */
  37. rt_err_t efm_hw_eth_init(void);
  38. #endif /* __DEV_ETHERNET_H__ */