/*
 * 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_dac.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

/* the source and target from hal_mds_remap.h. */

/* connection target. */
#define TRIGGER_OUT MDS_TRIGGER_OUT_DAC2_EXT_TRIGGER     /* select the target is ADC1 */
/* connection source. */
#define TRIGGER_IN_0 MDS_TRIGGER_IN_SW    /* select the software trigger as the trigger source. */


/* DEBUG UART. */
#define BOARD_DEBUG_UART_PORT        UART1
#define BOARD_DEBUG_UART_BAUDRATE    9600u
#define BOARD_DEBUG_UART_FREQ        CLOCK_APB2_FREQ
/* DAC .*/
#define BOARD_DAC_PORT 							 DAC
#define BOARD_DAC_CHANNEL            DAC_CHN_2

void BOARD_Init(void);
void BOARD_WaitTrigger(void);
#endif /* __BOARD_INIT_H__ */

