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

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

?? serial.c

?? FreeRTOS V4.2.1,增加了AVR32 UC3 和 LPC2368 的支持
?? C
字號(hào):
/*
	FreeRTOS.org V4.2.1 - Copyright (C) 2003-2007 Richard Barry.

	This file is part of the FreeRTOS.org distribution.

	FreeRTOS.org 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.

	FreeRTOS.org 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 FreeRTOS.org; if not, write to the Free Software
	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

	A special exception to the GPL can be applied should you wish to distribute
	a combined work that includes FreeRTOS.org, without being obliged to provide
	the source code for any proprietary components.  See the licensing section
	of http://www.FreeRTOS.org for full details of how and when the exception
	can be applied.

	***************************************************************************
	See http://www.FreeRTOS.org for documentation, latest information, license
	and contact details.  Please ensure to read the configuration and relevant
	port sections of the online documentation.

	Also see http://www.SafeRTOS.com for an IEC 61508 compliant version along
	with commercial development and support options.
	***************************************************************************
*/

/*
	BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR UART0.
*/


/*-----------------------------------------------------------
 * Components that can be compiled to either ARM or THUMB mode are
 * contained in this file.c  The ISR routines, which can only be compiled
 * to ARM mode, are contained in serialISR.c.
 *----------------------------------------------------------*/



/* Library includes. */
#include "75x_uart.h"
#include "75x_gpio.h"
#include "75x_eic.h"
#include "75x_mrcc.h"

/* Scheduler includes. */
#include "FreeRTOS.h"
#include "queue.h"

/* Demo application includes. */
#include "serial.h"

#define serINVALID_QUEUE				( ( xQueueHandle ) 0 )
#define serNO_BLOCK						( ( portTickType ) 0 )

/*-----------------------------------------------------------*/

/* Queues used to hold received characters, and characters waiting to be
transmitted. */
static xQueueHandle xRxedChars;
static xQueueHandle xCharsForTx;

static volatile portBASE_TYPE xQueueEmpty = pdTRUE;

/*-----------------------------------------------------------*/

/* The interrupt service routine - called from the assembly entry point. */
void vSerialISR( void );
void vConfigureQueues( xQueueHandle xQForRx, xQueueHandle xQForTx, volatile portBASE_TYPE *pxEmptyFlag );

/*-----------------------------------------------------------*/

/*
 * See the serial2.h header file.
 */
xComPortHandle xSerialPortInitMinimal( unsigned portLONG ulWantedBaud, unsigned portBASE_TYPE uxQueueLength )
{
xComPortHandle xReturn;
UART_InitTypeDef UART_InitStructure;
GPIO_InitTypeDef GPIO_InitStructure;
EIC_IRQInitTypeDef  EIC_IRQInitStructure;	

	/* Create the queues used to hold Rx and Tx characters. */
	xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) );
	xCharsForTx = xQueueCreate( uxQueueLength + 1, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) );

	/* If the queues were created correctly then setup the serial port
	hardware. */
	if( ( xRxedChars != serINVALID_QUEUE ) && ( xCharsForTx != serINVALID_QUEUE ) )
	{
	
		vConfigureQueues( xRxedChars, xCharsForTx, &xQueueEmpty );
	
		portENTER_CRITICAL();
		{
			/* Enable the UART0 Clock. */
			MRCC_PeripheralClockConfig( MRCC_Peripheral_UART0, ENABLE );
			
			/* Configure the UART0_Tx as alternate function */
			GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
			GPIO_InitStructure.GPIO_Pin =  GPIO_Pin_11;
			GPIO_Init(GPIO0, &GPIO_InitStructure);
			
			/* Configure the UART0_Rx as input floating */
			GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
			GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;
			GPIO_Init(GPIO0, &GPIO_InitStructure);
			
			/* Configure UART0. */
			UART_InitStructure.UART_WordLength = UART_WordLength_8D;
			UART_InitStructure.UART_StopBits = UART_StopBits_1;
			UART_InitStructure.UART_Parity = UART_Parity_No;
			UART_InitStructure.UART_BaudRate = ulWantedBaud;
			UART_InitStructure.UART_HardwareFlowControl = UART_HardwareFlowControl_None;
			UART_InitStructure.UART_Mode = UART_Mode_Tx_Rx;
			UART_InitStructure.UART_TxFIFOLevel = UART_FIFOLevel_1_2; /* FIFO size 16 bytes, FIFO level 8 bytes */
			UART_InitStructure.UART_RxFIFOLevel = UART_FIFOLevel_1_2; /* FIFO size 16 bytes, FIFO level 8 bytes */
			UART_Init(UART0, &UART_InitStructure);

			/* Enable the UART0 */
			UART_Cmd(UART0, ENABLE);

			/* Configure the IEC for the UART interrupts. */			
			EIC_IRQInitStructure.EIC_IRQChannelCmd = ENABLE;
			EIC_IRQInitStructure.EIC_IRQChannel = UART0_IRQChannel;
			EIC_IRQInitStructure.EIC_IRQChannelPriority = 1;
			EIC_IRQInit(&EIC_IRQInitStructure);
			
			xQueueEmpty = pdTRUE;
			UART_ITConfig( UART0, UART_IT_Transmit | UART_IT_Receive, ENABLE );
		}
		portEXIT_CRITICAL();
	}
	else
	{
		xReturn = ( xComPortHandle ) 0;
	}

	/* This demo file only supports a single port but we have to return
	something to comply with the standard demo header file. */
	return xReturn;
}
/*-----------------------------------------------------------*/

signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed portCHAR *pcRxedChar, portTickType xBlockTime )
{
	/* The port handle is not required as this driver only supports one port. */
	( void ) pxPort;

	/* Get the next character from the buffer.  Return false if no characters
	are available, or arrive before xBlockTime expires. */
	if( xQueueReceive( xRxedChars, pcRxedChar, xBlockTime ) )
	{
		return pdTRUE;
	}
	else
	{
		return pdFALSE;
	}
}
/*-----------------------------------------------------------*/

void vSerialPutString( xComPortHandle pxPort, const signed portCHAR * const pcString, unsigned portSHORT usStringLength )
{
signed portCHAR *pxNext;

	/* A couple of parameters that this port does not use. */
	( void ) usStringLength;
	( void ) pxPort;

	/* NOTE: This implementation does not handle the queue being full as no
	block time is used! */

	/* The port handle is not required as this driver only supports UART0. */
	( void ) pxPort;

	/* Send each character in the string, one at a time. */
	pxNext = ( signed portCHAR * ) pcString;
	while( *pxNext )
	{
		xSerialPutChar( pxPort, *pxNext, serNO_BLOCK );
		pxNext++;
	}
}
/*-----------------------------------------------------------*/

signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed portCHAR cOutChar, portTickType xBlockTime )
{
portBASE_TYPE xReturn;

	/* Place the character in the queue of characters to be transmitted. */
	portENTER_CRITICAL();
	{
		if( xQueueEmpty == pdTRUE )
		{
			UART0->DR = cOutChar;
			xReturn = pdPASS;
		}
		else
		{
			if( xQueueSend( xCharsForTx, &cOutChar, xBlockTime ) != pdPASS )
			{
				xReturn = pdFAIL;
			}			
			else
			{
				xReturn = pdPASS;				
			}
		}
		
		xQueueEmpty = pdFALSE;
	}
	portEXIT_CRITICAL();

	return xReturn;
}
/*-----------------------------------------------------------*/

void vSerialClose( xComPortHandle xPort )
{
	/* Not supported as not required by the demo application. */
}
/*-----------------------------------------------------------*/





	

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
毛片av一区二区| 国产成人自拍在线| 国产女主播视频一区二区| 欧美最新大片在线看| 欧美性极品少妇| 国产精品综合网| 五月综合激情婷婷六月色窝| 中文在线一区二区| 日韩欧美一区在线观看| 91热门视频在线观看| 国产一区二区在线观看免费| 丝袜美腿亚洲综合| 亚洲日本丝袜连裤袜办公室| 久久精品视频一区二区三区| 在线播放亚洲一区| 色婷婷国产精品| 成人免费毛片a| 国产毛片精品国产一区二区三区| 五月天国产精品| 亚洲韩国精品一区| 国产精品三级电影| 久久精品亚洲麻豆av一区二区| 欧美精品v国产精品v日韩精品 | 中文字幕乱码日本亚洲一区二区| 91精品在线麻豆| 欧洲一区二区三区在线| 91在线观看下载| 国产精品一区在线| 国产伦精一区二区三区| 久久精品国产精品亚洲综合| 日本美女一区二区三区视频| 亚洲大片精品永久免费| 亚洲激情网站免费观看| 综合亚洲深深色噜噜狠狠网站| 久久久久久久久伊人| 精品日韩99亚洲| 日韩欧美一区中文| 日韩亚洲欧美在线观看| 亚洲精品高清视频在线观看| 国产精品传媒入口麻豆| 欧美国产精品一区二区| 国产欧美一区二区精品秋霞影院 | 青青草成人在线观看| 亚洲第一福利视频在线| 亚洲蜜臀av乱码久久精品蜜桃| 国产精品久久久久永久免费观看 | 国产iv一区二区三区| 国产激情一区二区三区| 国产成人h网站| 成人激情校园春色| 91一区二区在线| 欧美在线观看一区二区| 欧美日韩精品欧美日韩精品一| 欧美午夜精品一区二区三区| 欧美日精品一区视频| 欧美高清性hdvideosex| 91精品国产色综合久久| 日韩欧美国产高清| 国产色综合久久| 亚洲天堂免费看| 亚洲午夜日本在线观看| 蜜桃视频一区二区| 国产一区二区成人久久免费影院| 成人网页在线观看| 色综合一个色综合亚洲| 这里只有精品99re| 久久女同性恋中文字幕| 国产精品视频麻豆| 亚洲成人自拍偷拍| 久久精品久久久精品美女| 国产精品18久久久| 日本道在线观看一区二区| 欧美一二三在线| 国产偷v国产偷v亚洲高清| 亚洲美女屁股眼交| 日韩电影免费一区| 国产.欧美.日韩| 欧美久久一二区| 久久久www免费人成精品| 亚洲乱码国产乱码精品精的特点| 日韩av在线免费观看不卡| 国产一区二区电影| 欧美性猛交xxxx黑人交| 久久精品亚洲精品国产欧美kt∨ | 亚洲成人免费在线| 国内不卡的二区三区中文字幕| 成人小视频免费在线观看| 欧美伊人久久大香线蕉综合69| 欧美精品一区二区不卡| 一区二区三区资源| 国产毛片精品国产一区二区三区| 色婷婷综合在线| 国产亚洲成av人在线观看导航| 亚洲一区视频在线| 成人午夜在线播放| 日韩亚洲国产中文字幕欧美| 中文字幕亚洲欧美在线不卡| 免费成人结看片| 在线一区二区三区四区| 日本一区二区三区国色天香| 免费在线视频一区| 色婷婷久久久久swag精品| 久久婷婷国产综合精品青草| 亚洲高清免费观看| 91蜜桃网址入口| 久久嫩草精品久久久精品一| 天天操天天色综合| 色综合一区二区三区| 国产网红主播福利一区二区| 日韩1区2区3区| 欧美性色黄大片手机版| 中文字幕亚洲一区二区av在线| 国精产品一区一区三区mba视频 | 亚洲综合久久久| 成人一级片网址| 精品av久久707| 欧美午夜精品一区二区蜜桃 | 日韩福利视频导航| 色综合婷婷久久| 国产精品国产三级国产| 国产精品亚洲成人| 精品久久久久久久久久久久久久久久久 | 欧美日韩高清一区| 亚洲综合久久av| 91网址在线看| 国产精品久久99| 波多野结衣一区二区三区| 国产婷婷一区二区| 国产乱子伦一区二区三区国色天香| 欧美一区二区成人| 麻豆freexxxx性91精品| 日韩亚洲欧美在线| 久久国产欧美日韩精品| 欧美一区二区福利在线| 蜜芽一区二区三区| 日韩欧美一二三四区| 久久国产精品99精品国产| 精品久久久久久无| 国产黄色91视频| 国产欧美日韩精品a在线观看| 国产精品中文字幕欧美| 中文av一区特黄| 99精品欧美一区二区三区小说| 综合网在线视频| 欧美综合一区二区| 日本视频在线一区| 精品对白一区国产伦| 国产精品一区在线| 国产精品的网站| 在线看国产日韩| 天天色天天操综合| 精品国产自在久精品国产| 国产精品69久久久久水密桃| 国产精品美日韩| 色婷婷av一区二区三区之一色屋| 成人免费观看视频| 亚洲少妇最新在线视频| 精品视频1区2区3区| 蜜桃一区二区三区在线观看| 久久免费视频色| 91啪在线观看| 日本不卡的三区四区五区| 久久久国产综合精品女国产盗摄| 成人毛片在线观看| 亚洲成人激情自拍| 精品福利一二区| 色综合色狠狠综合色| 天天av天天翘天天综合网色鬼国产| 精品久久久久久久人人人人传媒| 国产不卡视频一区二区三区| 亚洲一区二区三区四区在线观看| 欧美一级视频精品观看| 国产传媒日韩欧美成人| 一区二区三区视频在线看| 日韩精品一区二区三区四区| 成人丝袜视频网| 亚洲18色成人| 国产精品免费视频一区| 在线不卡的av| 成人sese在线| 欧美aⅴ一区二区三区视频| 中文字幕不卡三区| 欧美高清激情brazzers| 国产99久久久国产精品潘金网站| 亚洲福利视频三区| 国产色一区二区| 91精品国产手机| 97se亚洲国产综合自在线不卡| 日本女优在线视频一区二区| 亚洲视频你懂的| 26uuu国产日韩综合| 欧美日韩一区成人| 不卡影院免费观看| 精品中文字幕一区二区小辣椒 | 狠狠狠色丁香婷婷综合激情 | 亚洲成av人片| 国产精品网友自拍| 欧美一区日本一区韩国一区| 99精品久久免费看蜜臀剧情介绍| 精品在线播放午夜|