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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? uart.c

?? yampp mp3 reference
?? C
字號:


/*
  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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美性色黄大片手机版| 欧美亚洲综合一区| 亚洲男同1069视频| 欧洲av一区二区嗯嗯嗯啊| 日本一区二区成人在线| 欧美亚洲综合在线| 国产伦精品一区二区三区在线观看| 国产精品免费aⅴ片在线观看| 一本大道久久a久久精品综合| 视频一区二区中文字幕| 国产日本欧洲亚洲| 欧美日韩一区成人| 丰满放荡岳乱妇91ww| 国产精品高潮久久久久无| 欧美日韩另类一区| 成人午夜在线免费| 日韩av一区二区在线影视| 国产精品国产三级国产有无不卡| 欧美天堂一区二区三区| 国产成人三级在线观看| 成人精品高清在线| 久久99国产精品麻豆| 亚洲欧洲综合另类| 久久久久久**毛片大全| 精品视频色一区| 成人18视频日本| 久久草av在线| 亚洲欧美综合在线精品| 91精品办公室少妇高潮对白| 国产精品69毛片高清亚洲| 性做久久久久久免费观看欧美| 久久久亚洲欧洲日产国码αv| 欧美色偷偷大香| 99re这里都是精品| 美国欧美日韩国产在线播放| 亚洲精品久久久蜜桃| 国产日产欧美一区二区三区| 日韩一二三四区| 欧美中文一区二区三区| 色综合天天做天天爱| 成人动漫视频在线| 九九九久久久精品| 午夜一区二区三区在线观看| 夜夜亚洲天天久久| 中文字幕综合网| 国产精品国产自产拍高清av王其 | 亚洲免费电影在线| 久久精品一区四区| 久久在线观看免费| 欧美电影一区二区| 欧美性大战久久久久久久蜜臀| 99在线精品观看| 高清不卡一区二区| 国产一区不卡在线| 国产精品一区二区三区99| 精品一区二区三区在线视频| 青青草97国产精品免费观看无弹窗版| 日韩一区日韩二区| 亚洲精品中文字幕在线观看| 国产精品国产三级国产aⅴ入口| 在线播放/欧美激情| 91精品久久久久久久91蜜桃| 日韩午夜中文字幕| 欧美xxxx在线观看| 日韩欧美国产麻豆| 久久这里只有精品视频网| 久久久久青草大香线综合精品| 久久久久久久综合| 国产亚洲成年网址在线观看| 国产亚洲欧美色| 国产欧美视频一区二区三区| 久久久久国产一区二区三区四区 | 亚洲一区二区美女| 91在线看国产| 91色|porny| 欧洲生活片亚洲生活在线观看| 欧美日韩综合在线| 91精品国产色综合久久不卡蜜臀 | 日韩一区二区精品| 欧美不卡在线视频| 中文字幕不卡在线播放| 中文字幕视频一区| 亚洲成av人片观看| 一本色道亚洲精品aⅴ| 欧美日韩国产美女| 国产精品的网站| 日本成人在线电影网| 97超碰欧美中文字幕| 精品国产乱码久久久久久夜甘婷婷| 国产精品高清亚洲| 极品瑜伽女神91| 欧美影片第一页| 国产精品久久看| 久久精品免费看| 欧美亚洲一区二区三区四区| 久久九九99视频| 强制捆绑调教一区二区| 91久久精品一区二区三| 欧美激情一区二区三区全黄| 免费在线观看视频一区| 91久久香蕉国产日韩欧美9色| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 精彩视频一区二区| 欧美色电影在线| 国产精品久久久久久久久久久免费看| 日本不卡一区二区三区高清视频| 色八戒一区二区三区| 国产日韩v精品一区二区| 蜜桃av一区二区三区电影| 欧美三级在线看| 亚洲美女区一区| fc2成人免费人成在线观看播放| 欧美一级在线观看| 亚洲成人精品影院| 在线区一区二视频| 亚洲精品中文字幕乱码三区| 成人免费视频一区| 久久精品视频免费| 国产一区91精品张津瑜| 精品美女一区二区| 日韩av高清在线观看| 欧美丰满少妇xxxbbb| 亚洲一区在线观看免费| 91污在线观看| 国产精品精品国产色婷婷| 福利一区二区在线| 中文在线资源观看网站视频免费不卡| 国产一区二区中文字幕| 精品第一国产综合精品aⅴ| 强制捆绑调教一区二区| 91精品国产品国语在线不卡| 日韩精品五月天| 欧美一二三在线| 久久99九九99精品| 久久综合九色综合97婷婷| 国产又黄又大久久| 国产欧美精品一区二区色综合| 国产一区二区三区在线观看精品| 美女视频一区二区三区| 日韩欧美一二三四区| 久久99久国产精品黄毛片色诱| 精品国产一区二区三区久久影院| 精品在线免费观看| 国产亚洲自拍一区| 91免费观看在线| 亚洲国产精品嫩草影院| 欧美日韩精品二区第二页| 日本最新不卡在线| 久久久电影一区二区三区| 99久久精品免费观看| 亚洲一区视频在线| 欧美成人高清电影在线| 国产精品一二三四区| 国产精品免费久久| 欧美综合久久久| 蜜臀久久99精品久久久画质超高清| 精品国产一区久久| 不卡的av在线| 香蕉av福利精品导航| 久久婷婷国产综合精品青草| 成人av资源在线观看| 亚洲综合丝袜美腿| 欧美tickling网站挠脚心| 成人性生交大片免费| 亚洲v精品v日韩v欧美v专区| 欧美成人激情免费网| a4yy欧美一区二区三区| 天堂久久一区二区三区| 国产视频视频一区| 欧美性受xxxx黑人xyx性爽| 久久国产夜色精品鲁鲁99| 中文字幕中文字幕在线一区 | 国产大片一区二区| 亚洲美女视频在线观看| 日韩你懂的在线播放| 99视频一区二区| 蜜臀va亚洲va欧美va天堂| 亚洲四区在线观看| 日韩三级中文字幕| 91欧美一区二区| 欧美电视剧免费全集观看| 99国产精品国产精品久久| 美女mm1313爽爽久久久蜜臀| 中文字幕中文字幕在线一区 | 精品成人在线观看| 色综合久久88色综合天天免费| 加勒比av一区二区| 一区二区三区高清在线| 久久久天堂av| 91精品蜜臀在线一区尤物| 99精品国产热久久91蜜凸| 精品一区二区三区免费播放| 亚洲伦理在线精品| 久久九九影视网| 欧美一级在线视频| 欧美亚洲尤物久久| 91在线你懂得| 成人在线视频一区| 国产在线国偷精品免费看| 日本一道高清亚洲日美韩|