#include "bsp_config.h" #include "../msp/msp_UART0.h" // #include "../msp/eeprom.h" #include "../msp/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) { #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 BITN_0(P_SW2 ,BITN0);// rxd2 p1.0 txd2 p1.1 //BITN_1(P_SW2 ,BITN0);// rxd2 p4.0 txd2 p4.2 //uart3 // P_SW2 = 0x00;// RXD3 P0.0, TXD3 P0.1 BITN_0(P_SW2 ,BITN1); //uart4 //BITN_1(P_SW2 ,BITN2);// rxd4 p5.2 txd4 p5.3 //BITN_0(P_SW2 ,BITN2);// rxd4 p0.2 txd4 p0.3 //485 RE/DE 配置推完输出 P55 //BITN_0(P5M1,BITN5);BITN_1(P5M0,BITN5); //LED //D_stdIO_P1(BITN7); //D_stdIO_P5(BITN5); //IO D_stdIO_P1(BITN0); D_stdIO_P1(BITN1); D_stdIO_P1(BITN2); //D_OpenD_P0(BITN0); //D_OpenD_P0(BITN1); D_stdIO_P0(BITN0); D_stdIO_P0(BITN1); D_stdIO_P1(BITN6); // D_stdIO_P3(BITN2); D_HighR_P3(BITN2); D_HighR_P3(BITN3); D_stdIO_P3(BITN4); D_stdIO_P3(BITN5); D_stdIO_P3(BITN6); D_stdIO_P3(BITN7); D_stdIO_P2(BITN7); D_stdIO_P2(BITN6); //D_HighI_P5(BITN5); D_stdIO_P0(BITN2); D_OpenD_P5(BITN5); D_HighR_P4(BITN0); D_HighI_P3(BITN4); D_HighI_P5(BITN0); D_HighI_P0(BITN5); P05 = 0; #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; }