phy_reset.c 538 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2018-11-23 flybreak first version
  9. */
  10. #include <board.h>
  11. #define RESET_IO GET_PIN(D, 3)
  12. void phy_reset(void)
  13. {
  14. rt_pin_write(RESET_IO, PIN_LOW);
  15. rt_thread_mdelay(50);
  16. rt_pin_write(RESET_IO, PIN_HIGH);
  17. }
  18. int phy_init(void)
  19. {
  20. rt_pin_mode(RESET_IO, PIN_MODE_OUTPUT);
  21. rt_pin_write(RESET_IO, PIN_HIGH);
  22. return RT_EOK;
  23. }
  24. INIT_BOARD_EXPORT(phy_init);