Driver_ETH.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /* -----------------------------------------------------------------------------
  2. * Copyright (c) 2013-2014 ARM Ltd.
  3. *
  4. * This software is provided 'as-is', without any express or implied warranty.
  5. * In no event will the authors be held liable for any damages arising from
  6. * the use of this software. Permission is granted to anyone to use this
  7. * software for any purpose, including commercial applications, and to alter
  8. * it and redistribute it freely, subject to the following restrictions:
  9. *
  10. * 1. The origin of this software must not be misrepresented; you must not
  11. * claim that you wrote the original software. If you use this software in
  12. * a product, an acknowledgment in the product documentation would be
  13. * appreciated but is not required.
  14. *
  15. * 2. Altered source versions must be plainly marked as such, and must not be
  16. * misrepresented as being the original software.
  17. *
  18. * 3. This notice may not be removed or altered from any source distribution.
  19. *
  20. *
  21. * $Date: 7. Mar 2014
  22. * $Revision: V2.00
  23. *
  24. * Project: Ethernet PHY and MAC Driver common definitions
  25. * -------------------------------------------------------------------------- */
  26. /* History:
  27. * Version 2.00
  28. * Removed ARM_ETH_STATUS enumerator
  29. * Removed ARM_ETH_MODE enumerator
  30. * Version 1.10
  31. * Namespace prefix ARM_ added
  32. * Version 1.00
  33. * Initial release
  34. */
  35. #ifndef __DRIVER_ETH_H
  36. #define __DRIVER_ETH_H
  37. #include "Driver_Common.h"
  38. /**
  39. \brief Ethernet Media Interface type
  40. */
  41. #define ARM_ETH_INTERFACE_MII 0 ///< Media Independent Interface (MII)
  42. #define ARM_ETH_INTERFACE_RMII 1 ///< Reduced Media Independent Interface (RMII)
  43. #define ARM_ETH_INTERFACE_SMII 2 ///< Serial Media Independent Interface (SMII)
  44. /**
  45. \brief Ethernet link speed
  46. */
  47. #define ARM_ETH_SPEED_10M 0 ///< 10 Mbps link speed
  48. #define ARM_ETH_SPEED_100M 1 ///< 100 Mbps link speed
  49. #define ARM_ETH_SPEED_1G 2 ///< 1 Gpbs link speed
  50. /**
  51. \brief Ethernet duplex mode
  52. */
  53. #define ARM_ETH_DUPLEX_HALF 0 ///< Half duplex link
  54. #define ARM_ETH_DUPLEX_FULL 1 ///< Full duplex link
  55. /**
  56. \brief Ethernet link state
  57. */
  58. typedef enum _ARM_ETH_LINK_STATE {
  59. ARM_ETH_LINK_DOWN, ///< Link is down
  60. ARM_ETH_LINK_UP ///< Link is up
  61. } ARM_ETH_LINK_STATE;
  62. /**
  63. \brief Ethernet link information
  64. */
  65. typedef struct _ARM_ETH_LINK_INFO {
  66. uint32_t speed : 2; ///< Link speed: 0= 10 MBit, 1= 100 MBit, 2= 1 GBit
  67. uint32_t duplex : 1; ///< Duplex mode: 0= Half, 1= Full
  68. } ARM_ETH_LINK_INFO;
  69. /**
  70. \brief Ethernet MAC Address
  71. */
  72. typedef struct _ARM_ETH_MAC_ADDR {
  73. uint8_t b[6]; ///< MAC Address (6 bytes), MSB first
  74. } ARM_ETH_MAC_ADDR;
  75. #endif /* __DRIVER_ETH_H */