亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? uart.c

?? yampp的MP3資料 非常好大家來(lái)看一看
?? C
字號(hào):


/*
  Jesper Hansen <jesperh@telia.com>
  
  Original Author: Volker Oth <volkeroth@gmx.de>
  
  This file is part of the yampp system.

  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License
  as published by the Free Software Foundation; either version 2
  of the License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software Foundation, 
  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

*/




//#define PELLENIKLAS 1




#ifdef PELLENIKLAS


#include <io.h>
#include <interrupt.h>
#include <signal.h>
#include <progmem.h>
#include "types.h"
#include "uart.h"

/* UART global variables */
volatile u08   UART_Ready;
volatile u08   UART_ReceivedChar;
         u08   UART_RxChar;
         u08*  pUART_Buffer;

/* end-of-line string = 'Line End' + 'Line Feed' character */
prog_char UART_pszEndOfLine[3] = {0x0d,0x0a,0};

/* UART Transmit Complete Interrupt Function */
SIGNAL(SIG_UART_TRANS)      
{
    /* Test if a string is being sent */
    if (pUART_Buffer!=0)
    {
        /* Go to next character in string */
        pUART_Buffer++;
        /* Test if the end of string has been reached */
        if (PRG_RDB(pUART_Buffer)==0)
        {
            /* String has been sent */
            pUART_Buffer = 0;
            /* Indicate that the UART is now ready to send */
            UART_Ready   = 1;
            return;
        }
        /* Send next character in string */
        outp( PRG_RDB(pUART_Buffer), UDR );
        return;
    }
    /* Indicate that the UART is now ready to send */
    UART_Ready = 1;
}

/* UART Receive Complete Interrupt Function */
SIGNAL(SIG_UART_RECV)      
{
    /* Indicate that the UART has received a character */
    UART_ReceivedChar = 1;
    /* Store received character */
    UART_RxChar = inp(UDR);
}

void UART_SendByte(u08 Data)
{   
    /* wait for UART to become available */
    while(!UART_Ready);
    
    UART_Ready = 0;
    /* Send character */
    outp( Data, UDR );
}

u08 UART_ReceiveByte(void)
{
    /* wait for UART to indicate that a character has been received */
    while(!UART_ReceivedChar);
    UART_ReceivedChar = 0;
    /* read byte from UART data buffer */
    return UART_RxChar;
}

void UART_PrintfProgStr(u08* pBuf)
{
    /* wait for UART to become available */
    while(!UART_Ready);
    UART_Ready = 0;
    /* Indicate to ISR the string to be sent */
    pUART_Buffer = pBuf;
    /* Send first character */
    outp( PRG_RDB(pUART_Buffer), UDR );
}

void UART_PrintfEndOfLine(void)
{
    /* wait for UART to become available */
    while(!UART_Ready);
    UART_Ready = 0;
    /* Indicate to ISR the string to be sent */
    pUART_Buffer = UART_pszEndOfLine;
    /* Send first character */
    outp( PRG_RDB(pUART_Buffer), UDR );
}

void UART_PrintfU4(u08 Data)
{
    /* Send 4-bit hex value */
    u08 Character = Data&0x0f;
    if (Character>9)
    {
        Character+='A'-10;
    }
    else
    {
        Character+='0';
    }
    UART_SendByte(Character);
}

void UART_Printfu08(u08 Data)
{
    /* Send 8-bit hex value */
    UART_PrintfU4(Data>>4);
    UART_PrintfU4(Data);
}

void UART_Printfu16(u16 Data)
{
    /* Send 16-bit hex value */
    UART_Printfu08(Data>>8);
    UART_Printfu08(Data);
}

void UART_Printfu32(u32 Data)
{
    /* Send 32-bit hex value */
    UART_Printfu16(Data>>16);
    UART_Printfu16(Data);
}

void UART_Init(void)
{
    UART_Ready        = 1;
    UART_ReceivedChar = 0;
    pUART_Buffer      = 0;
    /* enable RxD/TxD and interrupts */
    outp(BV(RXCIE)|BV(TXCIE)|BV(RXEN)|BV(TXEN),UCR);
    /* set baud rate */
    outp( (u08)UART_BAUD_SELECT, UBRR);  
    /* enable interrupts */
    sei();
}

unsigned char UART_HasChar(void)
{
	return UART_ReceivedChar;
}


void UART_Puts(u08* pBuf)
{
	while (*pBuf)
		UART_SendByte(*pBuf++);
}

void UART_Putsln(u08* pBuf)
{
	UART_Puts(pBuf);
	UART_PrintfEndOfLine();
}



// Print a number in the given base 
/*
void print_number (int base, int unsigned_p, long n)
{
  	static char chars[16] = "0123456789abcdef";
  	char *p, buf[32];
  	unsigned long x;

  	if (!unsigned_p && n < 0)
    {
      	UART_SendByte('-');
      	x = -n;
    }
  	else
    	x = n;

  	p = buf + sizeof (buf);
  	*--p = '\0';
  	do
    {
      	*--p = chars[x % base];
      	x /= base;
    }
  	while (x != 0);

	while (*p)
		UART_SendByte(*p++);
}


*/

#else












/*
  Jesper Hansen <jesperh@telia.com>
  
  Original Author: Volker Oth <volkeroth@gmx.de>
  
  This file is part of the yampp system.

  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License
  as published by the Free Software Foundation; either version 2
  of the License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software Foundation, 
  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

*/


#include <io.h>
#include <interrupt.h>
#include <signal.h>
#include <progmem.h>
#include "types.h"
#include "uart.h"

/* UART global variables */
volatile u08   UART_Ready;
volatile u08   UART_ReceivedChar;
         u08   UART_RxChar;
         u08*  pUART_Buffer;

/* end-of-line string = 'Line End' + 'Line Feed' character */
//prog_char UART_pszEndOfLine[3] = {0x0d,0x0a,0};

/* UART Transmit Complete Interrupt Function */
SIGNAL(SIG_UART_TRANS)      
{
    /* Test if a string is being sent */
    if (pUART_Buffer!=0)
    {
        /* Go to next character in string */
        pUART_Buffer++;
        /* Test if the end of string has been reached */
        if (PRG_RDB(pUART_Buffer)==0)
        {
            /* String has been sent */
            pUART_Buffer = 0;
            /* Indicate that the UART is now ready to send */
            UART_Ready   = 1;
            return;
        }
        /* Send next character in string */
        outp( PRG_RDB(pUART_Buffer), UDR );
        return;
    }
    /* Indicate that the UART is now ready to send */
    UART_Ready = 1;
}

/* UART Receive Complete Interrupt Function */
SIGNAL(SIG_UART_RECV)      
{
    /* Indicate that the UART has received a character */
    UART_ReceivedChar = 1;
    /* Store received character */
    UART_RxChar = inp(UDR);
}

void UART_SendByte(u08 Data)
{   
	while ((inp(USR) & 0x20) != 0x20);

    /* wait for UART to become available */
//    while(!UART_Ready);
//    UART_Ready = 0;

    /* Send character */
    outp( Data, UDR );
}

u08 UART_ReceiveByte(void)
{
    /* wait for UART to indicate that a character has been received */
    while(!UART_ReceivedChar);
    UART_ReceivedChar = 0;
    /* read byte from UART data buffer */
    return UART_RxChar;
}

void UART_PrintfProgStr(u08* pBuf)
{
	unsigned char b;

    pUART_Buffer = pBuf;
	
	do {
		b = PRG_RDB(pUART_Buffer);
		pUART_Buffer++;
		if (b) 
			UART_SendByte(b);    
	} while (b);

#ifdef HUGO	
    /* wait for UART to become available */
    while(!UART_Ready);
    UART_Ready = 0;
    /* Indicate to ISR the string to be sent */
    pUART_Buffer = pBuf;
    /* Send first character */
    outp( PRG_RDB(pUART_Buffer), UDR );
#endif    

}

void UART_PrintfEndOfLine(void)
{
	UART_SendByte(0x0d);
	UART_SendByte(0x0a);
}

void UART_PrintfU4(u08 Data)
{
    /* Send 4-bit hex value */
    u08 Character = Data&0x0f;
    if (Character>9)
    {
        Character+='A'-10;
    }
    else
    {
        Character+='0';
    }
    UART_SendByte(Character);
}

void UART_Printfu08(u08 Data)
{
    /* Send 8-bit hex value */
    UART_PrintfU4(Data>>4);
    UART_PrintfU4(Data);
}

void UART_Printfu16(u16 Data)
{
    /* Send 16-bit hex value */
    UART_Printfu08(Data>>8);
    UART_Printfu08(Data);
}

void UART_Printfu32(u32 Data)
{
    /* Send 32-bit hex value */
    UART_Printfu16(Data>>16);
    UART_Printfu16(Data);
}

void UART_Init(void)
{
    UART_Ready        = 1;
    UART_ReceivedChar = 0;
    pUART_Buffer      = 0;

    /* enable RxD/TxD and interrupts */
    outp(BV(RXCIE)|/*BV(TXCIE)|*/BV(RXEN)|BV(TXEN),UCR);

    /* set baud rate */
    outp( (u08)UART_BAUD_SELECT, UBRR);  

    /* enable interrupts */
    sei();
}

unsigned char UART_HasChar(void)
{
	return UART_ReceivedChar;
}


void UART_Puts(u08* pBuf)
{
	while (*pBuf)
	{
		if (*pBuf == '\n')
			UART_SendByte('\r'); // for stupid terminal program
		UART_SendByte(*pBuf++);
	}
}

void UART_Putsln(u08* pBuf)
{
	UART_Puts(pBuf);
	UART_PrintfEndOfLine();
}


#endif

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品国产欧美一区二区成人| 色诱视频网站一区| 日韩精品一区二区三区在线播放| 日韩av一二三| 日韩丝袜美女视频| 国产精品香蕉一区二区三区| 国产免费观看久久| 91精品1区2区| 免费观看在线色综合| 久久久久久久久久久久电影| 成人午夜在线播放| 一区二区三区欧美日| 日韩视频一区二区| 国产成a人亚洲| 亚洲影院免费观看| 日韩欧美中文字幕公布| 国产乱码精品一区二区三区忘忧草| 国产精品美女久久久久aⅴ| 色婷婷激情一区二区三区| 亚洲一区中文在线| 久久久久久综合| 色综合视频一区二区三区高清| 亚洲成av人片| 久久精品免视看| 在线精品视频一区二区| 精品午夜久久福利影院| 中文字幕一区二区三区不卡 | 欧美美女一区二区在线观看| 看电影不卡的网站| 中文字幕佐山爱一区二区免费| 欧美午夜精品久久久久久超碰| 久久精品国产精品亚洲红杏| 中文字幕一区二区三中文字幕| 欧美日韩一区在线观看| 国产一区中文字幕| 亚洲国产精品自拍| 国产精品乱码久久久久久| 5月丁香婷婷综合| 99久久精品国产观看| 另类小说综合欧美亚洲| 亚洲品质自拍视频网站| 久久综合av免费| 欧美日韩精品专区| 99国产精品久| 国产剧情av麻豆香蕉精品| 午夜精品久久久久影视| 国产精品第一页第二页第三页| 欧美xxxxx牲另类人与| 欧美视频日韩视频| 92精品国产成人观看免费| 精品一区二区三区蜜桃| 午夜精品福利视频网站| 亚洲免费av高清| 国产精品污网站| 欧美一区二区观看视频| 欧美午夜精品一区二区蜜桃| 成人午夜大片免费观看| 国内成+人亚洲+欧美+综合在线| 五月天婷婷综合| 亚洲一级二级在线| 中文字幕一区视频| 国产色一区二区| 久久久99精品免费观看| 日韩一区二区三区免费看| 在线免费观看日韩欧美| 99在线精品免费| 成人一区二区三区中文字幕| 国产一本一道久久香蕉| 国产原创一区二区| 精品一区二区三区蜜桃| 美女视频黄久久| 另类欧美日韩国产在线| 亚洲h动漫在线| 午夜不卡在线视频| 香蕉乱码成人久久天堂爱免费| 一卡二卡欧美日韩| 一区二区免费看| 亚洲自拍偷拍网站| 亚洲国产日产av| 日日嗨av一区二区三区四区| 午夜精品视频在线观看| 日本特黄久久久高潮| 天天色天天操综合| 蜜臀av国产精品久久久久| 蜜臀av一区二区| 国模冰冰炮一区二区| 国产一区二区三区久久久| 国产精品99久久久久久久女警 | 成人h版在线观看| 精品视频一区 二区 三区| 欧美日韩高清不卡| 91精品国产欧美一区二区成人| 精品久久久久久久人人人人传媒 | 91首页免费视频| 在线观看一区二区视频| 欧美日韩三级在线| 欧美一级欧美三级在线观看| 久久综合999| 亚洲精品高清在线| 日韩vs国产vs欧美| 国产精品 日产精品 欧美精品| 91在线观看美女| 91精品国产综合久久精品性色| 日韩精品一区二区在线| 国产精品福利影院| 午夜精品久久久久久久久久 | 成人精品视频一区| 色成年激情久久综合| 3atv在线一区二区三区| 精品国产免费人成在线观看| 国产精品午夜久久| 日韩精品欧美精品| 国产一区二区久久| 欧美视频中文一区二区三区在线观看| 69久久夜色精品国产69蝌蚪网 | 国产精品家庭影院| 日韩国产欧美在线观看| 高清成人免费视频| 欧美丰满少妇xxxbbb| 久久综合九色综合久久久精品综合| 国产精品久久久久久亚洲伦| 午夜亚洲国产au精品一区二区| 国产精品中文欧美| 欧美丝袜第三区| 国产精品久久一卡二卡| 麻豆精品在线看| 色噜噜久久综合| 久久天天做天天爱综合色| 亚洲一区二区三区四区五区中文| 国产精品一区二区免费不卡 | 欧美日韩一级视频| 国产女人水真多18毛片18精品视频| 亚洲一区日韩精品中文字幕| 国产成人精品亚洲日本在线桃色| 欧美日韩不卡在线| 中文字幕亚洲在| 国内久久婷婷综合| 日韩欧美高清在线| 亚欧色一区w666天堂| 91小视频免费看| 久久久99久久精品欧美| 日本欧美肥老太交大片| 欧美中文字幕一二三区视频| 亚洲国产精品av| 狠狠色丁香久久婷婷综合_中| 欧美日韩一区国产| 亚洲另类一区二区| 波多野结衣欧美| 久久久久国产精品麻豆| 美日韩一区二区三区| 欧美亚洲国产一区二区三区va| 中文字幕一区二区三区不卡| 国产精品1区2区3区在线观看| 中文字幕一区二区三区乱码在线| 久久99国内精品| 日韩精品一区二区三区四区 | 久久久精品中文字幕麻豆发布| 日韩电影在线看| 欧美日韩久久久一区| 亚洲亚洲精品在线观看| 色天使色偷偷av一区二区| 中文字幕av一区二区三区高| 国产精品88av| 国产欧美日韩视频一区二区| 韩国成人精品a∨在线观看| 日韩精品一区二区三区四区| 久久av资源网| wwwwxxxxx欧美| 日韩福利电影在线| 韩国三级电影一区二区| 欧美不卡一区二区| 日韩你懂的电影在线观看| 91福利小视频| 久久精品久久精品| 精品制服美女丁香| 国产亚洲福利社区一区| 欧美日韩在线免费视频| 亚洲一区二区在线观看视频| 91精品婷婷国产综合久久| 国产精一区二区三区| 午夜日韩在线观看| 中文字幕一区二区视频| 日韩女同互慰一区二区| 久久精品在这里| 欧美中文字幕久久| 成人性生交大片免费看视频在线 | 久久精品日产第一区二区三区高清版 | 午夜精品久久久久久久久| 91精品午夜视频| 国产99久久久国产精品免费看| 亚洲精品欧美激情| 国产精品久久99| 中文字幕不卡在线播放| 久久亚洲一区二区三区明星换脸| 欧美午夜一区二区三区| 色婷婷综合久久久中文字幕| www.亚洲精品| 欧美日韩精品三区| 91年精品国产| 欧美日韩久久久一区|