phy_reset.c 560 B

1234567891011121314151617181920212223242526272829
  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. #include <drv_gpio.h>
  12. #define RESET_IO GET_PIN(D, 3)
  13. void phy_reset(void)
  14. {
  15. rt_pin_write(RESET_IO, PIN_LOW);
  16. rt_thread_mdelay(50);
  17. rt_pin_write(RESET_IO, PIN_HIGH);
  18. }
  19. int phy_init(void)
  20. {
  21. rt_pin_mode(RESET_IO, PIN_MODE_OUTPUT);
  22. rt_pin_write(RESET_IO, PIN_HIGH);
  23. return RT_EOK;
  24. }
  25. INIT_BOARD_EXPORT(phy_init);