phy_reset.c 693 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * Copyright (c) 2006-2018, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2018-11-21 SummerGift add port file
  9. */
  10. #include <rtthread.h>
  11. #include "board.h"
  12. #include <drivers/pin.h>
  13. #define ETH_PWR_IO GET_PIN(A, 3)
  14. #define ETH_RESET_IO GET_PIN(B, 10) //PHY RESET PIN
  15. /* phy reset */
  16. void phy_reset(void)
  17. {
  18. rt_pin_mode(ETH_PWR_IO, PIN_MODE_OUTPUT);
  19. rt_pin_write(ETH_PWR_IO, PIN_HIGH);
  20. rt_pin_mode(ETH_RESET_IO, PIN_MODE_OUTPUT);
  21. rt_pin_write(ETH_RESET_IO, PIN_HIGH);
  22. rt_thread_mdelay(100);
  23. rt_pin_write(ETH_RESET_IO, PIN_LOW);
  24. rt_thread_mdelay(100);
  25. }