Driver_ETH.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * Copyright (c) 2013-2020 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: 24. January 2020
  19. * $Revision: V2.2
  20. *
  21. * Project: Ethernet PHY and MAC Driver common definitions
  22. */
  23. /* History:
  24. * Version 2.2
  25. * Removed volatile from ARM_ETH_LINK_INFO
  26. * Version 2.1
  27. * ARM_ETH_LINK_INFO made volatile
  28. * Version 2.0
  29. * Removed ARM_ETH_STATUS enumerator
  30. * Removed ARM_ETH_MODE enumerator
  31. * Version 1.10
  32. * Namespace prefix ARM_ added
  33. * Version 1.00
  34. * Initial release
  35. */
  36. #ifndef DRIVER_ETH_H_
  37. #define DRIVER_ETH_H_
  38. #include "Driver_Common.h"
  39. /**
  40. \brief Ethernet Media Interface type
  41. */
  42. #define ARM_ETH_INTERFACE_MII (0U) ///< Media Independent Interface (MII)
  43. #define ARM_ETH_INTERFACE_RMII (1U) ///< Reduced Media Independent Interface (RMII)
  44. #define ARM_ETH_INTERFACE_SMII (2U) ///< Serial Media Independent Interface (SMII)
  45. /**
  46. \brief Ethernet link speed
  47. */
  48. #define ARM_ETH_SPEED_10M (0U) ///< 10 Mbps link speed
  49. #define ARM_ETH_SPEED_100M (1U) ///< 100 Mbps link speed
  50. #define ARM_ETH_SPEED_1G (2U) ///< 1 Gpbs link speed
  51. /**
  52. \brief Ethernet duplex mode
  53. */
  54. #define ARM_ETH_DUPLEX_HALF (0U) ///< Half duplex link
  55. #define ARM_ETH_DUPLEX_FULL (1U) ///< Full duplex link
  56. /**
  57. \brief Ethernet link state
  58. */
  59. typedef enum _ARM_ETH_LINK_STATE {
  60. ARM_ETH_LINK_DOWN, ///< Link is down
  61. ARM_ETH_LINK_UP ///< Link is up
  62. } ARM_ETH_LINK_STATE;
  63. /**
  64. \brief Ethernet link information
  65. */
  66. typedef struct _ARM_ETH_LINK_INFO {
  67. uint32_t speed : 2; ///< Link speed: 0= 10 MBit, 1= 100 MBit, 2= 1 GBit
  68. uint32_t duplex : 1; ///< Duplex mode: 0= Half, 1= Full
  69. uint32_t reserved : 29;
  70. } ARM_ETH_LINK_INFO;
  71. /**
  72. \brief Ethernet MAC Address
  73. */
  74. typedef struct _ARM_ETH_MAC_ADDR {
  75. uint8_t b[6]; ///< MAC Address (6 bytes), MSB first
  76. } ARM_ETH_MAC_ADDR;
  77. #endif /* DRIVER_ETH_H_ */