You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
93 lines
2.7 KiB
93 lines
2.7 KiB
#include "bsp_config.h"
|
|
#include "../msp/UART0.h"
|
|
#include "../msp/eeprom.h"
|
|
|
|
////////////////////////////////////////////////////////////////////////////
|
|
///@copyright Copyright (c) 2018, 传控科技 All rights reserved.
|
|
///-------------------------------------------------------------------------
|
|
/// @file bsp_func.c
|
|
/// @brief bsp @ fuctiong ; io复用选择等,和cpu型号息息相关
|
|
///-------------------------------------------------------------------------
|
|
/// @version 1.0
|
|
/// @author CC
|
|
/// @date 20180308
|
|
/// @note cc_AS_stc02
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
//struct _s_sysclk s_sysclk;
|
|
|
|
//==========================================================
|
|
//系统定时器回调
|
|
//初始化为NULL,timer0_isr中判断为NULL则不调用
|
|
//==========================================================
|
|
|
|
|
|
void L0_board_config(void)
|
|
{
|
|
//LED
|
|
D_stdIO_P0_ALL();
|
|
D_stdIO_P1_ALL();
|
|
D_stdIO_P2_ALL();
|
|
D_stdIO_P3_ALL();
|
|
D_stdIO_P4_ALL();
|
|
D_stdIO_P5_ALL();
|
|
|
|
//uart0
|
|
#if (PIN_UART0_Rxd_30_Txd_31 == D_PIN_UART0)
|
|
BITN_0(P_SW1 ,BITN7);//
|
|
BITN_0(P_SW1 ,BITN6);// rxd p3.0 txd p3.1
|
|
#elif (PIN_UART0_Rxd_36_Txd_37 == D_PIN_UART0)
|
|
BITN_0(P_SW1 ,BITN7);//
|
|
BITN_1(P_SW1 ,BITN6);// rxd p3.6 txd p3.7
|
|
#elif (PIN_UART0_Rxd_16_Txd_17 == D_PIN_UART0)
|
|
BITN_1(P_SW1 ,BITN7);//
|
|
BITN_0(P_SW1 ,BITN6);// rxd p1.6 txd p1.7
|
|
#elif (PIN_UART0_Rxd_43_Txd_44 == D_PIN_UART0)
|
|
BITN_1(P_SW1 ,BITN7);//
|
|
BITN_1(P_SW1 ,BITN6);// rxd p4.3 txd p4.4
|
|
#else
|
|
BITN_0(P_SW1 ,BITN7);//
|
|
BITN_0(P_SW1 ,BITN6);// rxd p3.0 txd p3.1
|
|
#endif
|
|
|
|
//uart2
|
|
#if (PIN_UART2_Rxd_10_Txd_11 == D_PIN_UART2)
|
|
BITN_0(P_SW2 ,BITN0);// rxd2 p1.0 txd2 p1.1
|
|
#elif (PIN_UART2_Rxd_46_Txd_47 == D_PIN_UART2)
|
|
BITN_1(P_SW2 ,BITN0);// rxd2 p4.06 txd2 p4.7
|
|
#else
|
|
BITN_0(P_SW2 ,BITN0);// rxd2 p1.0 txd2 p1.1
|
|
#endif
|
|
|
|
//uart3
|
|
#if (PIN_UART3_Rxd_00_Txd_01 == D_PIN_UART3)
|
|
BITN_0(P_SW2 ,BITN1);// rxd2 p1.0 txd2 p1.1
|
|
#elif (PIN_UART3_Rxd_50_Txd_51 == D_PIN_UART3)
|
|
BITN_1(P_SW2 ,BITN1);// rxd2 p4.06 txd2 p4.7
|
|
#else
|
|
BITN_0(P_SW2 ,BITN1);// rxd2 p1.0 txd2 p1.1
|
|
#endif
|
|
|
|
//uart4
|
|
#if (PIN_UART4_Rxd_02_Txd_03 == D_PIN_UART4)
|
|
BITN_0(P_SW2 ,BITN2);// rxd2 p1.0 txd2 p1.1
|
|
#elif (PIN_UART4_Rxd_52_Txd_53 == D_PIN_UART4)
|
|
BITN_1(P_SW2 ,BITN2);// rxd2 p4.06 txd2 p4.7
|
|
#else
|
|
BITN_0(P_SW2 ,BITN2);// rxd2 p1.0 txd2 p1.1
|
|
#endif
|
|
|
|
//485 RE/DE 配置推完输出 P00,P01
|
|
D_HighI_P0(BITN0);
|
|
D_HighI_P0(BITN1);
|
|
|
|
//WDT
|
|
#if (TYPE_WDT_ENABLE == D_WDT_STATUS)
|
|
WDT_CONTR = 0x27; //使能看门狗,22M时钟下溢出时间约为5s,请注意添加喂狗程序
|
|
#else
|
|
WDT_CONTR = 0x00;
|
|
#endif
|
|
|
|
//Lp0_Sys_timer_extern_handler被timer0中断调用
|
|
//Lp0_Sys_timer_extern_handler = L1_Sys_timer_extern_handler;
|
|
}
|
|
|