Driver_ETH.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * Copyright (c) 2013-2017 ARM Limited. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Licensed under the Apache License, Version 2.0 (the License); you may
  7. * not use this file except in compliance with the License.
  8. * You may obtain a copy of the License at
  9. *
  10. * www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an AS IS BASIS, WITHOUT
  14. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. *
  18. * $Date: 2. Feb 2017
  19. * $Revision: V2.1
  20. *
  21. * Project: Ethernet PHY and MAC Driver common definitions
  22. */
  23. /* History:
  24. * Version 2.1
  25. * ARM_ETH_LINK_INFO made volatile
  26. * Version 2.0
  27. * Removed ARM_ETH_STATUS enumerator
  28. * Removed ARM_ETH_MODE enumerator
  29. * Version 1.10
  30. * Namespace prefix ARM_ added
  31. * Version 1.00
  32. * Initial release
  33. */
  34. #ifndef DRIVER_ETH_H_
  35. #define DRIVER_ETH_H_
  36. #include "Driver_Common.h"
  37. /**
  38. \brief Ethernet Media Interface type
  39. */
  40. #define ARM_ETH_INTERFACE_MII (0) ///< Media Independent Interface (MII)
  41. #define ARM_ETH_INTERFACE_RMII (1) ///< Reduced Media Independent Interface (RMII)
  42. #define ARM_ETH_INTERFACE_SMII (2) ///< Serial Media Independent Interface (SMII)
  43. /**
  44. \brief Ethernet link speed
  45. */
  46. #define ARM_ETH_SPEED_10M (0) ///< 10 Mbps link speed
  47. #define ARM_ETH_SPEED_100M (1) ///< 100 Mbps link speed
  48. #define ARM_ETH_SPEED_1G (2) ///< 1 Gpbs link speed
  49. /**
  50. \brief Ethernet duplex mode
  51. */
  52. #define ARM_ETH_DUPLEX_HALF (0) ///< Half duplex link
  53. #define ARM_ETH_DUPLEX_FULL (1) ///< Full duplex link
  54. /**
  55. \brief Ethernet link state
  56. */
  57. typedef enum _ARM_ETH_LINK_STATE {
  58. ARM_ETH_LINK_DOWN, ///< Link is down
  59. ARM_ETH_LINK_UP ///< Link is up
  60. } ARM_ETH_LINK_STATE;
  61. /**
  62. \brief Ethernet link information
  63. */
  64. typedef volatile struct _ARM_ETH_LINK_INFO {
  65. uint32_t speed : 2; ///< Link speed: 0= 10 MBit, 1= 100 MBit, 2= 1 GBit
  66. uint32_t duplex : 1; ///< Duplex mode: 0= Half, 1= Full
  67. uint32_t reserved : 29;
  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_ */