/*
 * Copyright 2022 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 <stdint.h>

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

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

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

/* SOFTI2C GPIO. */
#define BOARD_SOFTI2C_SCL_GPIO_PORT  GPIOC
#define BOARD_SOFTI2C_SCL_GPIO_PIN   GPIO_PIN_6
#define BOARD_SOFTI2C_SDA_GPIO_PORT  GPIOC
#define BOARD_SOFTI2C_SDA_GPIO_PIN   GPIO_PIN_7

#define BOARD_SOFTI2C_BPSDELAY       50
#define BOARD_SOFTI2C_TIMEOUT_DELAY  100

/* MPU6050. */
#define BOARD_MPU6050_ADDR           MPU6050_ADDRESS_AD0_LOW
#define BOARD_MPU6050_DELAY_MS_CNT   12000

void BOARD_Init(void);

#endif /* __BOARD_INIT_H__ */
