24 lines
658 B
C
24 lines
658 B
C
#include "peripherals.h"
|
|
|
|
#include "board.h"
|
|
|
|
QSPI_HandleTypeDef hqspi;
|
|
|
|
void BOARD_InitBootPeripherals(void) {
|
|
BOARD_InitQUADSPI();
|
|
}
|
|
|
|
void BOARD_InitQUADSPI(void) {
|
|
hqspi.Instance = QUADSPI;
|
|
hqspi.Init.ClockPrescaler = 2;
|
|
hqspi.Init.FifoThreshold = 24;
|
|
hqspi.Init.SampleShifting = QSPI_SAMPLE_SHIFTING_HALFCYCLE;
|
|
hqspi.Init.FlashSize = 22;
|
|
hqspi.Init.ChipSelectHighTime = QSPI_CS_HIGH_TIME_3_CYCLE;
|
|
hqspi.Init.ClockMode = QSPI_CLOCK_MODE_0;
|
|
hqspi.Init.DualFlash = QSPI_DUALFLASH_DISABLE;
|
|
if (HAL_QSPI_Init(&hqspi) != HAL_OK) {
|
|
Error_Handler();
|
|
}
|
|
}
|