aboutsummaryrefslogtreecommitdiff
path: root/stm-fpgacfg.c
diff options
context:
space:
mode:
Diffstat (limited to 'stm-fpgacfg.c')
-rw-r--r--stm-fpgacfg.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/stm-fpgacfg.c b/stm-fpgacfg.c
index 0026b9e..0d255e5 100644
--- a/stm-fpgacfg.c
+++ b/stm-fpgacfg.c
@@ -34,6 +34,7 @@
#include "stm32f4xx_hal.h"
#include "stm-fpgacfg.h"
+#include "stm-init.h"
SPI_HandleTypeDef hspi_fpgacfg;
@@ -277,3 +278,19 @@ int _n25q128_get_wel_flag(void)
// done
return ((spi_rx[1] >> 1) & 1);
}
+
+void fpgacfg_give_access_to_stm32()
+{
+ // fpga disable = 1
+ HAL_GPIO_WritePin(GPIOI, GPIO_PIN_14, GPIO_PIN_SET);
+ // arm enable = 0
+ HAL_GPIO_WritePin(GPIOF, GPIO_PIN_6, GPIO_PIN_RESET);
+}
+
+void fpgacfg_give_access_to_fpga()
+{
+ // fpga disable = 0
+ HAL_GPIO_WritePin(GPIOI, GPIO_PIN_14, GPIO_PIN_RESET);
+ // arm enable = 1
+ HAL_GPIO_WritePin(GPIOF, GPIO_PIN_6, GPIO_PIN_SET);
+}
14' href='#n114'>114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151