/*
 * Copyright 2021 MindMotion Microelectronics Co., Ltd.
 * All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#ifndef __BOARD_INIT_H__
#define __BOARD_INIT_H__

#include <stdio.h>

#include "hal_common.h"
#include "hal_gpio.h"
#include "hal_uart.h"
#include "hal_rcc.h"
#include "clock_init.h"
#include "pin_init.h"

#include "hal_mds_remap.h"
#include "hal_mds.h"

/* MDS */
#define BOARD_MDS_PORT MDS


/* connection target. */
#define CONN_OUT MDS_CONN_OUT_MDS_OUT1     /* the target from hal_mds_remap.h. */
#define CONN_CLU_IN MDS_CONN_IN_CLU0     /* select clu0 as the clu in. */
/* connection source. */
#define CONN_IN_0 MDS_CONN_IN_MDS_IN1    /* the source from hal_mds_remap.h. */
#define CONN_IN_1 MDS_CONN_IN_MDS_IN2
#define CONN_IN_2 MDS_CONN_IN_LOGIC_0
#define CONN_IN_3 MDS_CONN_IN_LOGIC_0

/* the CLU 4 input invert, true means the source is taken invert as the input to the CLU, flase means not. */
#define CLU_IN_INVERT_MASK 0x100 /* the clu input 0 invert.*/

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

void BOARD_Init(void);

#endif /* __BOARD_INIT_H__ */
