/* board_init.h */
#ifndef __BOARD_INIT_H__
#define __BOARD_INIT_H__

#include <stdio.h>
#include <stdint.h>

#include "hal_common.h"
#include "hal_rcc.h"
#include "hal_uart.h"
#include "hal_qspi.h"

#include "clock_init.h"
#include "pin_init.h"

#include "x25q.h"

/* DEBUG UART. */
#define BOARD_DEBUG_UART_PORT        UART1
#define BOARD_DEBUG_UART_BAUDRATE    9600u
#define BOARD_DEBUG_UART_FREQ        CLOCK_APB2_FREQ

/* QSPI. */
#define BOARD_QSPI_PORT                 QSPI
#define BOARD_QSPI_SCKDIV               4u
#define BOARD_QSPI_CS_HIGH_CYCLE        2u
#define BOARD_QSPI_RX_SAMPLE_DELAY      1u
#define BOARD_QSPI_DIRECT_CMD_BUSWIDTH  QSPI_BusWidth_1b
#define BOARD_QSPI_DIRECT_CMD_VALUE     X25Q_Cmd_FaseReadQuad
#define BOARD_QSPI_DIRECT_ADR_BUSWIDTH  QSPI_BusWidth_1b
#define BOARD_QSPI_DIRECT_ADR_WORDWIDTH QSPI_WordWidth_24b
#define BOARD_QSPI_DIRECT_DMY_CYCLES    8u
#define BOARD_QSPI_DIRECT_DAT_BUSWIDTH  QSPI_BusWidth_4b

void BOARD_Init(void);

#endif /* __BOARD_INIT_H__ */
