2022-05-31 11:53:56 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2006-2022, RT-Thread Development Team
|
|
|
|
* Copyright (c) 2022, Xiaohua Semiconductor Co., Ltd.
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
|
|
|
* 2022-04-28 CDT first version
|
2022-06-29 00:00:58 +08:00
|
|
|
* 2022-06-16 lianghongquan use macro definition config adc pin.
|
|
|
|
* 2022-06-28 lianghongquan add PWM_TMRA pin define.
|
2022-05-31 11:53:56 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __BOARD_CONFIG_H__
|
|
|
|
#define __BOARD_CONFIG_H__
|
|
|
|
|
|
|
|
#include <rtconfig.h>
|
|
|
|
#include "hc32_ll.h"
|
|
|
|
#include "drv_config.h"
|
|
|
|
|
|
|
|
|
|
|
|
/************************ USART port **********************/
|
|
|
|
#if defined(BSP_USING_UART1)
|
|
|
|
#define USART1_RX_PORT (GPIO_PORT_C)
|
|
|
|
#define USART1_RX_PIN (GPIO_PIN_04)
|
|
|
|
|
|
|
|
#define USART1_TX_PORT (GPIO_PORT_A)
|
|
|
|
#define USART1_TX_PIN (GPIO_PIN_07)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(BSP_USING_UART2)
|
|
|
|
#define USART2_RX_PORT (GPIO_PORT_A)
|
2022-06-08 14:55:28 +08:00
|
|
|
#define USART2_RX_PIN (GPIO_PIN_03)
|
2022-05-31 11:53:56 +08:00
|
|
|
|
|
|
|
#define USART2_TX_PORT (GPIO_PORT_A)
|
|
|
|
#define USART2_TX_PIN (GPIO_PIN_02)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(BSP_USING_UART3)
|
|
|
|
#define USART3_RX_PORT (GPIO_PORT_C)
|
|
|
|
#define USART3_RX_PIN (GPIO_PIN_13)
|
|
|
|
|
|
|
|
#define USART3_TX_PORT (GPIO_PORT_H)
|
|
|
|
#define USART3_TX_PIN (GPIO_PIN_02)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(BSP_USING_UART4)
|
|
|
|
#define USART4_RX_PORT (GPIO_PORT_B)
|
|
|
|
#define USART4_RX_PIN (GPIO_PIN_09)
|
|
|
|
|
|
|
|
#define USART4_TX_PORT (GPIO_PORT_E)
|
|
|
|
#define USART4_TX_PIN (GPIO_PIN_06)
|
|
|
|
#endif
|
|
|
|
|
2022-06-08 12:10:58 +08:00
|
|
|
/*********** CAN configure *********/
|
|
|
|
#if defined(BSP_USING_CAN1)
|
|
|
|
#define CAN1_TX_PORT (GPIO_PORT_B)
|
|
|
|
#define CAN1_TX_PIN (GPIO_PIN_07)
|
|
|
|
#define CAN1_TX_PIN_FUNC (GPIO_FUNC_50)
|
|
|
|
|
|
|
|
#define CAN1_RX_PORT (GPIO_PORT_B)
|
|
|
|
#define CAN1_RX_PIN (GPIO_PIN_06)
|
|
|
|
#define CAN1_RX_PIN_FUNC (GPIO_FUNC_51)
|
|
|
|
|
2022-06-21 11:12:35 +08:00
|
|
|
#define CAN1_STB_FUNC_ENABLE
|
2022-06-08 12:10:58 +08:00
|
|
|
#define CAN_STB_PORT (GPIO_PORT_D)
|
|
|
|
#define CAN_STB_PIN (GPIO_PIN_15)
|
|
|
|
#endif
|
|
|
|
|
2022-06-13 21:13:51 +08:00
|
|
|
/*********** ADC configure *********/
|
|
|
|
#if defined(BSP_USING_ADC1)
|
|
|
|
#define ADC1_CH10_PORT (GPIO_PORT_C)
|
|
|
|
#define ADC1_CH10_PIN (GPIO_PIN_00)
|
|
|
|
|
|
|
|
#define ADC1_CH12_PORT (GPIO_PORT_C)
|
|
|
|
#define ADC1_CH12_PIN (GPIO_PIN_02)
|
|
|
|
|
|
|
|
#define ADC1_CH13_PORT (GPIO_PORT_C)
|
|
|
|
#define ADC1_CH13_PIN (GPIO_PIN_03)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(BSP_USING_ADC2)
|
|
|
|
//ADC2 has 7 channels CH0-CH7. ADC12_IN4-ADC12_IN11 means ADC2 CH0-CH7
|
|
|
|
#define ADC2_CH7_PORT (GPIO_PORT_C)
|
|
|
|
#define ADC2_CH7_PIN (GPIO_PIN_01)
|
|
|
|
#endif
|
|
|
|
|
2022-06-29 00:00:58 +08:00
|
|
|
/*********** PWM_TMRA configure *********/
|
|
|
|
#if defined(BSP_USING_PWM_TMRA_4)
|
|
|
|
#define PWM_TMRA_4_CH7_PORT (GPIO_PORT_H)
|
|
|
|
#define PWM_TMRA_4_CH7_PIN (GPIO_PIN_02)
|
|
|
|
#define PWM_TMRA_4_CH7_PIN_FUNC (GPIO_FUNC_4)
|
|
|
|
|
|
|
|
#define PWM_TMRA_4_CH8_PORT (GPIO_PORT_C)
|
|
|
|
#define PWM_TMRA_4_CH8_PIN (GPIO_PIN_13)
|
|
|
|
#define PWM_TMRA_4_CH8_PIN_FUNC (GPIO_FUNC_4)
|
|
|
|
#endif
|
|
|
|
|
2022-05-31 11:53:56 +08:00
|
|
|
#endif
|