Driver_ETH_PHY.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /*
  2. * Copyright (c) 2013-2018 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. #include "Driver_ETH_PHY.h"
  19. #define ARM_ETH_PHY_DRV_VERSION ARM_DRIVER_VERSION_MAJOR_MINOR(2, 0) /* driver version */
  20. /* Driver Version */
  21. static const ARM_DRIVER_VERSION DriverVersion = {
  22. ARM_ETH_PHY_API_VERSION,
  23. ARM_ETH_PHY_DRV_VERSION
  24. };
  25. //
  26. // Functions
  27. //
  28. ARM_DRIVER_VERSION ARM_ETH_PHY_GetVersion(void)
  29. {
  30. }
  31. int32_t ARM_ETH_PHY_Initialize(ARM_ETH_PHY_Read_t fn_read, ARM_ETH_PHY_Write_t fn_write)
  32. {
  33. }
  34. int32_t ARM_ETH_PHY_Uninitialize(void)
  35. {
  36. }
  37. int32_t ARM_ETH_PHY_PowerControl(ARM_POWER_STATE state)
  38. {
  39. switch (state)
  40. {
  41. case ARM_POWER_OFF:
  42. break;
  43. case ARM_POWER_LOW:
  44. break;
  45. case ARM_POWER_FULL:
  46. break;
  47. default:
  48. return ARM_DRIVER_ERROR_UNSUPPORTED;
  49. }
  50. }
  51. int32_t ARM_ETH_PHY_SetInterface(uint32_t interface)
  52. {
  53. switch (interface)
  54. {
  55. case ARM_ETH_INTERFACE_MII:
  56. break;
  57. case ARM_ETH_INTERFACE_RMII:
  58. break;
  59. default:
  60. return ARM_DRIVER_ERROR_UNSUPPORTED;
  61. }
  62. }
  63. int32_t ARM_ETH_PHY_SetMode(uint32_t mode)
  64. {
  65. switch (mode & ARM_ETH_PHY_SPEED_Msk)
  66. {
  67. case ARM_ETH_PHY_SPEED_10M:
  68. break;
  69. case ARM_ETH_PHY_SPEED_100M:
  70. break;
  71. default:
  72. return ARM_DRIVER_ERROR_UNSUPPORTED;
  73. }
  74. switch (mode & ARM_ETH_PHY_DUPLEX_Msk)
  75. {
  76. case ARM_ETH_PHY_DUPLEX_HALF:
  77. break;
  78. case ARM_ETH_PHY_DUPLEX_FULL:
  79. break;
  80. }
  81. if (mode & ARM_ETH_PHY_AUTO_NEGOTIATE)
  82. {
  83. }
  84. if (mode & ARM_ETH_PHY_LOOPBACK)
  85. {
  86. }
  87. if (mode & ARM_ETH_PHY_ISOLATE)
  88. {
  89. }
  90. }
  91. ARM_ETH_LINK_STATE ARM_ETH_PHY_GetLinkState(void)
  92. {
  93. }
  94. ARM_ETH_LINK_INFO ARM_ETH_PHY_GetLinkInfo(void)
  95. {
  96. }
  97. ARM_DRIVER_ETH_PHY ARM_Driver_ETH_PHY_(ETH_PHY_NUM) =
  98. {
  99. ARM_ETH_PHY_GetVersion,
  100. ARM_ETH_PHY_Initialize,
  101. ARM_ETH_PHY_Uninitialize,
  102. ARM_ETH_PHY_PowerControl,
  103. ARM_ETH_PHY_SetInterface,
  104. ARM_ETH_PHY_SetMode,
  105. ARM_ETH_PHY_GetLinkState,
  106. ARM_ETH_PHY_GetLinkInfo,
  107. };