PUBLIC void vUtils_DisplayBytes(uint8 *pcOutString, uint8 u8Num)
{
uint8 chr;
    while(u8Num--)
    {
        chr=(*pcOutString >> 4)+0x30;
        if(chr > 0x39)
        {
            chr+=0x07;
        }
        vAHI_UartWriteData(UTILS_UART,chr);
        while ((u8AHI_UartReadLineStatus(UTILS_UART) & 0x20) == 0);
        chr=(*pcOutString & 0x0f)+0x30;
        if(chr > 0x39)
        {
            chr+=0x07;
        }
        vAHI_UartWriteData(UTILS_UART,chr);
        while ((u8AHI_UartReadLineStatus(UTILS_UART) & 0x20) == 0);
        vAHI_UartWriteData(UTILS_UART,' ');
        while ((u8AHI_UartReadLineStatus(UTILS_UART) & 0x20) == 0);
        pcOutString++;
    }
    vAHI_UartWriteData(UTILS_UART, '\r');
    while ((u8AHI_UartReadLineStatus(UTILS_UART) & 0x20) == 0);
    vAHI_UartWriteData(UTILS_UART, '\n');
    while ((u8AHI_UartReadLineStatus(UTILS_UART) & 0x20) == 0);
}
PUBLIC void vUtils_DebugNoZero(char *pcMessage)
{
    vUtils_String(pcMessage);
    //vAHI_UartWriteData(UTILS_UART, '\r');
    while ((u8AHI_UartReadLineStatus(UTILS_UART) & 0x20) == 0);
    //vAHI_UartWriteData(UTILS_UART, '\n');
    while ((u8AHI_UartReadLineStatus(UTILS_UART) & 0x20) == 0);
}
PUBLIC void vUtils_Debug_uint(uint8 input)
{

    vAHI_UartWriteData(UTILS_UART, input);
    vAHI_UartWriteData(UTILS_UART, '\r');
    while ((u8AHI_UartReadLineStatus(UTILS_UART) & 0x20) == 0);
    vAHI_UartWriteData(UTILS_UART, '\n');
    while ((u8AHI_UartReadLineStatus(UTILS_UART) & 0x20) == 0);
}
Esempio n. 4
0
void uart0_writeb(unsigned char c)
{
  while(!(u8AHI_UartReadLineStatus(E_AHI_UART_0)&E_AHI_UART_LS_THRE))
      ; /* wait for transmit buffer to empty */

  vAHI_UartWriteData(E_AHI_UART_0, c);
}
/****************************************************************************
 *
 * NAME: vUtils_String
 *
 * DESCRIPTION:
 * Sends a string to UART0 using the hardware API without CR
 *
 * PARAMETERS:      Name            RW  Usage
 *                  pcMessage       R   Null-terminated message to send
 *
 * RETURNS:
 * void
 *
 ****************************************************************************/
PUBLIC void vUtils_String(char *pcMessage)
{
    while (*pcMessage)
    {
        while ((u8AHI_UartReadLineStatus(UTILS_UART) & 0x20) == 0);
        vAHI_UartWriteData(UTILS_UART, *pcMessage);
        pcMessage++;
    }
}
PUBLIC void vDebug(char *pcMessage)
{
  while (*pcMessage)
	{
    while ((u8AHI_UartReadLineStatus(0) & 0x20) == 0);
		vAHI_UartWriteData(0, *pcMessage);
		pcMessage++;
	}
}
Esempio n. 7
0
/****************************************************************************
 *
 * NAME: vUART_StartTx
 *
 * DESCRIPTION:
 *
 * PARAMETERS:      Name            RW  Usage
 * None.
 *
 * RETURNS:
 * None.
 *
 * NOTES:
 * None.
 ****************************************************************************/
PUBLIC void vUART_StartTx(void)
{
    /* Has interrupt driven transmit stalled (tx fifo is empty) */
    if (u8AHI_UartReadLineStatus(u8Uart) & E_AHI_UART_LS_THRE)
    {
        if(!bSerialQ_Empty(TX_QUEUE))
        {
            vAHI_UartWriteData(u8Uart, u8SerialQ_RemoveItem(TX_QUEUE));
        }
    }
}
/****************************************************************************
 *
 * NAME: vUtils_String
 *
 * DESCRIPTION:
 * Sends a string to UART0 using the hardware API without CR
 *
 * PARAMETERS:      Name            RW  Usage
 *                  pcMessage       R   Null-terminated message to send
 *
 * RETURNS:
 * void
 *
 ****************************************************************************/
PUBLIC void vUtils_Char(uint8 u8char)
{
    while ((u8AHI_UartReadLineStatus(UTILS_UART) & 0x20) == 0);
    vAHI_UartWriteData(UTILS_UART, u8char);
}
Esempio n. 9
0
static void irq(unsigned int irqsrc, unsigned int map)
{
  while (u8AHI_UartReadLineStatus(E_AHI_UART_0)&E_AHI_UART_LS_DR)
    uart0_input(u8AHI_UartReadData(E_AHI_UART_0));
}