uart_test.c

来自「8051 UART firmware communicate with Hype」· C语言 代码 · 共 48 行

C
48
字号
#include "AT89X52.h"
#include "INTRINS.H"
#include "DEF.h"
#include <stdio.h>
#include "table.h"
#include "interrupt.h"
#include "SIGWave.h"


BYTE Command = 0xff;
BYTE State   = 0xff;
#define     STATE_NOGO  1
#define     STATE_GO    2

// 4K for code/program
//60K for stimulation table


//===================================================================
//    F: MCU_Init()
//===================================================================
void MCU_Init(void)
{
    IE = 0;              //Disable all interrupt
    IP = 0;              //Interrupt priority is same
    
    IT0 = 0;             //External interrupt 0 level trigger
    IT1 = 0;             //External interrupt 1 level trigger
    

    PCON = 0x00;         //Init Power control

   
    P0 = 0xFF;           //PortX init value
    P1 = 0xFF;
    P2 = 0xFF;
    P3 = 0xFF;
}



//===================================================================
//    F: UART_Init()
//===================================================================
void UART_Init(void)
{

    //

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?