* @brief phy reset */
| 99 | * @brief phy reset |
| 100 | */ |
| 101 | static void phy_reset(void) |
| 102 | { |
| 103 | gpio_init_type gpio_init_struct; |
| 104 | |
| 105 | #if defined (SOC_SERIES_AT32F437) || defined (SOC_SERIES_AT32F457) |
| 106 | crm_periph_clock_enable(CRM_GPIOE_PERIPH_CLOCK, TRUE); |
| 107 | crm_periph_clock_enable(CRM_GPIOG_PERIPH_CLOCK, TRUE); |
| 108 | |
| 109 | gpio_default_para_init(&gpio_init_struct); |
| 110 | gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER; |
| 111 | gpio_init_struct.gpio_mode = GPIO_MODE_OUTPUT; |
| 112 | gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL; |
| 113 | gpio_init_struct.gpio_pull = GPIO_PULL_NONE; |
| 114 | gpio_init_struct.gpio_pins = GPIO_PINS_15; |
| 115 | gpio_init(GPIOE, &gpio_init_struct); |
| 116 | |
| 117 | gpio_init_struct.gpio_pins = GPIO_PINS_15; |
| 118 | gpio_init(GPIOG, &gpio_init_struct); |
| 119 | |
| 120 | gpio_bits_reset(GPIOE, GPIO_PINS_15); |
| 121 | gpio_bits_reset(GPIOG, GPIO_PINS_15); |
| 122 | rt_thread_mdelay(2); |
| 123 | gpio_bits_set(GPIOE, GPIO_PINS_15); |
| 124 | #endif |
| 125 | #if defined (SOC_SERIES_AT32F407) |
| 126 | crm_periph_clock_enable(CRM_GPIOC_PERIPH_CLOCK, TRUE); |
| 127 | |
| 128 | gpio_default_para_init(&gpio_init_struct); |
| 129 | gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER; |
| 130 | gpio_init_struct.gpio_mode = GPIO_MODE_OUTPUT; |
| 131 | gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL; |
| 132 | gpio_init_struct.gpio_pull = GPIO_PULL_NONE; |
| 133 | gpio_init_struct.gpio_pins = GPIO_PINS_8; |
| 134 | gpio_init(GPIOC, &gpio_init_struct); |
| 135 | |
| 136 | gpio_bits_reset(GPIOC, GPIO_PINS_8); |
| 137 | rt_thread_mdelay(2); |
| 138 | gpio_bits_set(GPIOC, GPIO_PINS_8); |
| 139 | #endif |
| 140 | rt_thread_mdelay(2000); |
| 141 | } |
| 142 | |
| 143 | /** |
| 144 | * @brief phy clock config |
no test coverage detected