Example #1
0
void __sub_Uart0_RxInt(void)
{
    if(RdURXH0()!='\r') 
    {
    	Uart_Printf("%c",RdURXH0());
    	*uart0RxStr++ =(char)RdURXH0();
    }
    else
    {
    	isRxInt=0;
    	*uart0RxStr='\0';
    	Uart_Printf("\n");
    }
}
Example #2
0
//====================================================================
char Uart_GetKey(void)
{
    if(whichUart==0)
    {       
        if(rUTRSTAT0 & 0x1)    //Receive data ready
            return RdURXH0();
        else
            return 0;
    }
    else if(whichUart==1)
    {
        if(rUTRSTAT1 & 0x1)    //Receive data ready
            return RdURXH1();
        else
            return 0;
    }
    else if(whichUart==2)
    {       
        if(rUTRSTAT2 & 0x1)    //Receive data ready
            return RdURXH2();
        else
            return 0;
    }
    return 0;    
}
Example #3
0
static void __irq Uart0RxInt(void)
{
    ClearSubPending(BIT_SUB_RXD0); //rSUBSRCPND = BIT_SUB_RXD0;          //Clear pending bit (Requested)
    ClearPending(BIT_UART0);

    *temp ++= RdURXH0();
}
Example #4
0
int peekchar(void)
{
    if(rUTRSTAT0 & 0x1) {
        return RdURXH0();
    }
    return 0;
}
Example #5
0
char Uart_Get_Char()
{
	while(!(rUTRSTAT0 & 0x1));
	return RdURXH0();	
	//return *(volatile unsigned char *)URXH0;
	 
}
Example #6
0
void __sub_Uart0_RxFifo(void)
{
    while((rUFSTAT0&0x100)||(rUFSTAT0&0xf))	//During the Rx FIFO is not empty
    {
	rx_point++;
	if(rx_point<5)
		rx_filesize |= (RdURXH0()<<(8*(rx_point-1))); // First 4-bytes mean file size
	else if(rx_point>(rx_filesize-2))	
	{
		rx_dncs |= (RdURXH0()<<(8*(1-(rx_filesize-rx_point)))); //Last 2-bytes mean checksum.
		if(rx_point==rx_filesize) rx_isdone=0;
	}
	else
		rx_checksum+=RdURXH0();
    }
}
Example #7
0
char Uart_Get_Pressed(void)
{
    if(rUTRSTAT0 & 0x1)
    {
    	return RdURXH0();
    }
    else return 0;
}
Example #8
0
void Uart0_RxInt(void)
{
    
    keyBuf[keyBufWrPt++]=RdURXH0(); // leer byte e insertar en el buffer
     
    if(keyBufWrPt==KEY_BUFLEN) 		// mantener comportamiento circular 
		keyBufWrPt=0;
	
	rI_ISPC=BIT_URXD0;		        // finalizar interrupciĆ³n
}
Example #9
0
char Uart_Getch(void)
{
    if(whichUart==0)
    {	    
		while(!(rUTRSTAT0 & 0x1)); //Receive data read
		return RdURXH0();
    }
    else
    {
		while(!(rUTRSTAT1 & 0x1)); //Receive data ready
		return	rURXH1;
    }
}
Example #10
0
char Uart_Getch(void)
{

#ifdef UART_INT 
    if (keyBufRdPt == KEY_BUFLEN)      // buffer circular
	   keyBufRdPt=0;

    while (keyBufWrPt == keyBufRdPt);  // esperar a que haya caracteres nuevos
    return keyBuf[keyBufRdPt++];	   // devolver el caracter
#else
    while (!(rUTRSTAT0 & 0x1));        // esperar a que el buffer contenga datos
	return RdURXH0();		   		   // devolver el caracter  
#endif
}
Example #11
0
// UART0 RX isr
void UART0_RX_ISR(void)
{
    //if (!(rUTRSTAT0 & USTAT_ERROR)) // if error
    //{
        if (RxQQ.wptr + 1 != RxQQ.rptr)   // enough space of buffer?
        {
            RxQQ.buff[RxQQ.wptr++] = RdURXH0(); // read from urxh0

            if(RxQQ.wptr == QMAXSIZE)    // verify ptr
            {
                RxQQ.wptr = 0; /*loop back*/
            }
        }
    //}
    //printf("read int\n");
}
Example #12
0
char Uart_GetKey(void)
{
    if(whichUart==0)
    {	    
		if(rUTRSTAT0 & 0x1)    //Receive data ready
    	    return RdURXH0();
		else
		    return 0;
    }
    else
    {
		if(rUTRSTAT1 & 0x1)    //Receive data ready
		    return rURXH1;
		else
		    return 0;
    }
}
Example #13
0
//=====================================================================
char Uart_Getch(void)
{
    if(whichUart==0)
    {       
        while(!(rUTRSTAT0 & 0x1)); //Receive data ready
        return RdURXH0();
    }
    else if(whichUart==1)
    {       
        while(!(rUTRSTAT1 & 0x1)); //Receive data ready
        return RdURXH1();
    }
    else if(whichUart==2)
    {
        while(!(rUTRSTAT2 & 0x1)); //Receive data ready
        return RdURXH2();
    }
    return 0;
}
Example #14
0
int getchar(void)
//int usart_getc(void)
{
	while(!(rUTRSTAT0 & 0x1)); //Receive data ready
	return RdURXH0();
}
Example #15
0
char Uart0_Getch(void)
{
    while (!(rUTRSTAT0 & 0x1));        // esperar a que el buffer contenga datos
	return RdURXH0();		   		   // devolver el caracter
}
Example #16
0
void uart_read(acoral_char *ch){
	while(!(rUTRSTAT0 & 0x1));
	*ch=RdURXH0();
}