// You should have received a copy of the GNU General Public License
// along with SCSI2SD. If not, see <http://www.gnu.org/licenses/>.
+#ifdef STM32F2xx
#include "stm32f2xx.h"
+#endif
+
+#ifdef STM32F4xx
+#include "stm32f4xx.h"
+#endif
+
#include "spi.h"
#include "fpga.h"
HAL_GPIO_WritePin(
nFGPA_CRESET_B_GPIO_Port, nFGPA_CRESET_B_Pin, GPIO_PIN_SET);
- // 800uS for iCE40HX1K. 1200uS for HX4K according to Appendix A of
- // TN1248 - iCE40 Programming and Configuration. Note that the
- // earlier text of the document says 300uS.
- s2s_delay_us(1200); // Be generous
+ // 800uS for iCE40HX1K. tCR_SCK parameter in datasheet.
+ s2s_delay_us(800);
uint8_t* fpgaData = &_fpga_bitmap_start;
uint32_t fpgaBytes = (uint32_t) &_fpga_bitmap_size;
void s2s_fpgaReset()
{
HAL_GPIO_WritePin(FPGA_RST_GPIO_Port, FPGA_RST_Pin, GPIO_PIN_SET);
- s2s_delay_clocks(4);
+ s2s_delay_clocks(12);
HAL_GPIO_WritePin(FPGA_RST_GPIO_Port, FPGA_RST_Pin, GPIO_PIN_RESET);
}