55
66void NetBootloaderMode ()
77{
8- ChangeToOutput (NET_BOOT_GPIO_Port , NET_BOOT_Pin );
9- ChangeToOutput (NET_NRST_GPIO_Port , NET_NRST_Pin );
10-
8+ PowerCycle (NET_NRST_GPIO_Port , NET_NRST_Pin , 10 );
119 // Bring the boot low for esp, bootloader mode (0)
1210 HAL_GPIO_WritePin (NET_BOOT_GPIO_Port , NET_BOOT_Pin , GPIO_PIN_RESET );
1311
@@ -17,30 +15,24 @@ void NetBootloaderMode()
1715
1816void NetNormalMode ()
1917{
20- ChangeToOutput (NET_BOOT_GPIO_Port , NET_BOOT_Pin );
21- ChangeToOutput (NET_NRST_GPIO_Port , NET_NRST_Pin );
18+ PowerCycle (NET_NRST_GPIO_Port , NET_NRST_Pin , 10 );
2219
2320 HAL_GPIO_WritePin (NET_BOOT_GPIO_Port , NET_BOOT_Pin , GPIO_PIN_SET );
2421
2522 // Power cycle
2623 PowerCycle (NET_NRST_GPIO_Port , NET_NRST_Pin , 10 );
27-
28- // ChangeToInput(NET_BOOT_GPIO_Port, NET_BOOT_Pin);
29- // ChangeToInput(NET_NRST_GPIO_Port, NET_NRST_Pin);
3024}
3125
3226void NetHoldInReset ()
3327{
34- ChangeToOutput (NET_NRST_GPIO_Port , NET_NRST_Pin );
28+ HAL_GPIO_WritePin (NET_BOOT_GPIO_Port , NET_BOOT_Pin , GPIO_PIN_SET );
29+
3530 // Reset
3631 HAL_GPIO_WritePin (NET_NRST_GPIO_Port , NET_NRST_Pin , GPIO_PIN_RESET );
3732}
3833
3934void UIBootloaderMode ()
4035{
41- ChangeToOutput (UI_BOOT0_GPIO_Port , UI_BOOT0_Pin );
42- ChangeToOutput (UI_NRST_GPIO_Port , UI_NRST_Pin );
43-
4436 // Normal boot mode (boot0 = 1 and boot1 = 0)
4537 HAL_GPIO_WritePin (UI_BOOT0_GPIO_Port , UI_BOOT0_Pin , GPIO_PIN_SET );
4638 HAL_GPIO_WritePin (UI_BOOT1_GPIO_Port , UI_BOOT1_Pin , GPIO_PIN_RESET );
@@ -51,18 +43,21 @@ void UIBootloaderMode()
5143
5244void UINormalMode ()
5345{
54- ChangeToOutput (UI_BOOT0_GPIO_Port , UI_BOOT0_Pin );
55- ChangeToOutput (UI_NRST_GPIO_Port , UI_NRST_Pin );
56-
5746 // Normal boot mode (boot0 = 0 and boot1 = 1)
5847 HAL_GPIO_WritePin (UI_BOOT0_GPIO_Port , UI_BOOT0_Pin , GPIO_PIN_RESET );
5948 HAL_GPIO_WritePin (UI_BOOT1_GPIO_Port , UI_BOOT1_Pin , GPIO_PIN_SET );
6049
6150 // Power cycle
6251 PowerCycle (UI_NRST_GPIO_Port , UI_NRST_Pin , 10 );
52+ }
53+
54+ void UIHoldInReset ()
55+ {
56+ // Normal boot mode (boot0 = 0 and boot1 = 1)
57+ HAL_GPIO_WritePin (UI_BOOT0_GPIO_Port , UI_BOOT0_Pin , GPIO_PIN_RESET );
58+ HAL_GPIO_WritePin (UI_BOOT1_GPIO_Port , UI_BOOT1_Pin , GPIO_PIN_SET );
6359
64- ChangeToInput (UI_BOOT0_GPIO_Port , UI_BOOT0_Pin );
65- ChangeToInput (UI_NRST_GPIO_Port , UI_NRST_Pin );
60+ HAL_GPIO_WritePin (UI_NRST_GPIO_Port , UI_NRST_Pin , GPIO_PIN_RESET );
6661}
6762
6863void NormalStart ()
@@ -73,13 +68,6 @@ void NormalStart()
7368 UINormalMode ();
7469}
7570
76- void UIHoldInReset ()
77- {
78- ChangeToOutput (UI_NRST_GPIO_Port , UI_NRST_Pin );
79-
80- HAL_GPIO_WritePin (UI_NRST_GPIO_Port , UI_NRST_Pin , GPIO_PIN_RESET );
81- }
82-
8371/**
8472 * @brief Waits for the network chip to send a ready signal
8573 *
0 commit comments