[BACK]Return to sausart.c CVS log [TXT][DIR] Up to [local] / funnyos / arch / sam7s64 / dev

File: [local] / funnyos / arch / sam7s64 / dev / sausart.c (download)

Revision 1.1, Sat Nov 24 15:04:49 2007 UTC (16 years, 6 months ago) by nbrk
Branch: MAIN

u[s]art functions; usart_early_putchar() for now

/*
 * $Id: sausart.c,v 1.1 2007/11/24 15:04:49 nbrk Exp $
 */
#include <sys/types.h>
#include <sys/device.h>

#include <arch/sam7s64/dev/at91sam7.h>

/*
 * driver for USART.
 */

void
sausart_early_putchar(char ch)
{
	/*
	 * Put a character into an unconfigured console.
	 * Note that USART0 (DBGU) should be already configured (clocks/un-pio, etc.).
	 * Such configuration is done in config_machineinit().
	 */

	/* wait for previous character to transmit */
	while( ((*AT91C_US0_CSR) & AT91C_US_TXRDY) == 0)
		;

	/* put current character into Transmit Hold Register */
	*AT91C_US0_THR = ((uint32_t)ch & 0x1ff);
}