当前位置: 首页>>代码示例>>C++>>正文


C++ UART_PUT_CHAR函数代码示例

本文整理汇总了C++中UART_PUT_CHAR函数的典型用法代码示例。如果您正苦于以下问题:C++ UART_PUT_CHAR函数的具体用法?C++ UART_PUT_CHAR怎么用?C++ UART_PUT_CHAR使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了UART_PUT_CHAR函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: omahauart_console_write

static void omahauart_console_write(struct console *co, const char *s, u_int count)
{
	struct uart_port *port = omaha_ports + co->index;
	unsigned int status;
	int i;

	/*
	 *	First save the CR then disable the interrupts
	 */

	/*
	 *	Now, do each character
	 */
	for (i = 0; i < count; i++) {
		do {
			status = UART_GET_FR(port);
		} while ((status & OMAHA_UTX_EMPTY) == 0);
		UART_PUT_CHAR(port, s[i]);
		if (s[i] == '\n') {
			do {
				status = UART_GET_FR(port);
			} while ((status & OMAHA_UTX_EMPTY) == 0);
			UART_PUT_CHAR(port, '\r');
		}
	}

	/*
	 *	Finally, wait for transmitter to become empty
	 *	and restore the TCR
	 */
	do {
		status = UART_GET_FR(port);
	} while ((status & OMAHA_UTX_EMPTY) == 0);
}
开发者ID:jhbsz,项目名称:actiontec_opensource_mi424wr-rev-acd-56-0-10-14-4,代码行数:34,代码来源:omaha.c

示例2: apbuart_tx_chars

static void apbuart_tx_chars(struct uart_port *port)
{
	struct circ_buf *xmit = &port->state->xmit;
	int count;

	if (port->x_char) {
		UART_PUT_CHAR(port, port->x_char);
		port->icount.tx++;
		port->x_char = 0;
		return;
	}

	if (uart_circ_empty(xmit) || uart_tx_stopped(port)) {
		apbuart_stop_tx(port);
		return;
	}

	/* amba: fill FIFO */
	count = port->fifosize >> 1;
	do {
		UART_PUT_CHAR(port, xmit->buf[xmit->tail]);
		xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
		port->icount.tx++;
		if (uart_circ_empty(xmit))
			break;
	} while (--count > 0);

	if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
		uart_write_wakeup(port);

	if (uart_circ_empty(xmit))
		apbuart_stop_tx(port);
}
开发者ID:19Dan01,项目名称:linux,代码行数:33,代码来源:apbuart.c

示例3: uart00_tx_chars

static void uart00_tx_chars(struct uart_port *port)
{
	struct circ_buf *xmit = &port->info->xmit;
	int count;

	if (port->x_char) {
		while ((UART_GET_TSR(port) & UART_TSR_TX_LEVEL_MSK) == 15)
			barrier();
		UART_PUT_CHAR(port, port->x_char);
		port->icount.tx++;
		port->x_char = 0;
		return;
	}
	if (uart_circ_empty(xmit) || uart_tx_stopped(port)) {
		uart00_stop_tx(port, 0);
		return;
	}

	count = port->fifosize >> 1;
	do {
		while ((UART_GET_TSR(port) & UART_TSR_TX_LEVEL_MSK) == 15)
			barrier();
		UART_PUT_CHAR(port, xmit->buf[xmit->tail]);
		xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
		port->icount.tx++;
		if (uart_circ_empty(xmit))
			break;
	} while (--count > 0);

	if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
		uart_write_wakeup(port);

	if (uart_circ_empty(xmit))
		uart00_stop_tx(port, 0);
}
开发者ID:jameshilliard,项目名称:actiontec_opensrc_mi424wr-rev-ef_fw-20-19-8,代码行数:35,代码来源:uart00.c

示例4: at91_tx_chars

/*
 * Transmit characters (called from interrupt handler)
 */
static void at91_tx_chars(struct uart_port *port)
{
	struct circ_buf *xmit = &port->info->xmit;

	if (port->x_char) {
		UART_PUT_CHAR(port, port->x_char);
		port->icount.tx++;
		port->x_char = 0;
		return;
	}
	if (uart_circ_empty(xmit) || uart_tx_stopped(port)) {
		at91_stop_tx(port);
		return;
	}

	while (UART_GET_CSR(port) & AT91_US_TXRDY) {
		UART_PUT_CHAR(port, xmit->buf[xmit->tail]);
		xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
		port->icount.tx++;
		if (uart_circ_empty(xmit))
			break;
	}

	if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
		uart_write_wakeup(port);

	if (uart_circ_empty(xmit))
		at91_stop_tx(port);
}
开发者ID:ena30,项目名称:snake-os,代码行数:32,代码来源:at91_serial.c

示例5: ambauart_tx_chars

static void ambauart_tx_chars(struct uart_info *info)
{
	struct uart_port *port = info->port;
	int count;

	if (port->x_char) {
		UART_PUT_CHAR(port, port->x_char);
		port->icount.tx++;
		port->x_char = 0;
		return;
	}
	if (info->xmit.head == info->xmit.tail
	    || info->tty->stopped
	    || info->tty->hw_stopped) {
		ambauart_stop_tx(port, 0);
		return;
	}

	count = port->fifosize >> 1;
	do {
		UART_PUT_CHAR(port, info->xmit.buf[info->xmit.tail]);
		info->xmit.tail = (info->xmit.tail + 1) & (UART_XMIT_SIZE - 1);
		port->icount.tx++;
		if (info->xmit.head == info->xmit.tail)
			break;
	} while (--count > 0);

	if (CIRC_CNT(info->xmit.head, info->xmit.tail, UART_XMIT_SIZE) <
			WAKEUP_CHARS)
		uart_event(info, EVT_WRITE_WAKEUP);

	if (info->xmit.head == info->xmit.tail)
		ambauart_stop_tx(info->port, 0);
}
开发者ID:niubl,项目名称:camera_project,代码行数:34,代码来源:amba.c

示例6: ssauart_tx_chars

static void ssauart_tx_chars (struct uart_port *port)
{
   struct circ_buf *xmit = &port->info->xmit;
   int count;

   if (port->x_char)
   {
      UART_PUT_CHAR(port, port->x_char);
      port->x_char = 0;
      port->icount.tx++;
      return;
   }

   if (uart_circ_empty (xmit) || uart_tx_stopped (port))
   {
      ssauart_stop_tx (port, 0);
      return;
   }

   /*
      Write upto (port->fifosize) to the UART from the SW Tx buffer.
      Stops early if the SW Tx Buffer has no more data.

      Warning: Does NOT stop early if there is no space in the UART Tx fifo.
               (ie we assume that port->fifosize is correct !!)
   */

   count = port->fifosize;

   do
   {
      UART_PUT_CHAR(port, xmit->buf[xmit->tail]);
      xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
      port->icount.tx++;
      if (uart_circ_empty (xmit))
         break;
   }
   while (--count > 0);

   /*
      If the number of bytes remaining in the SW Tx circular buffer is less
      than WAKEUP_CHARS, wake up tasks trying to write to the UART device.
   */

   if (uart_circ_chars_pending (xmit) < WAKEUP_CHARS)
   {
      uart_write_wakeup (port);

      /*
         If there are no more bytes to transmit, disable Tx interrupts.
         (We don't need to refill the UART Tx fifo when it next becomes empty).
      */

      if (uart_circ_empty (xmit))
         ssauart_stop_tx (port, 0);
   }
}
开发者ID:SimonKagstrom,项目名称:mci500h-linux-2.4.27,代码行数:57,代码来源:ssa.c

示例7: ks8695_console_putchar

static void ks8695_console_putchar(struct uart_port *port, int ch)
{
	while (!(UART_GET_LSR(port) & URLS_URTHRE))
		barrier();

	UART_PUT_CHAR(port, ch);
}
开发者ID:AppEngine,项目名称:linux-2.6,代码行数:7,代码来源:serial_ks8695.c

示例8: send_buf

static void send_buf(struct serial_dev *devp)
{
	UART_DIB_WIRQ(devp->index);//disable recvive irq
	while(devp->send_rd_point != devp->send_wr_point)
	{
		if(!UART_PUT_RSR(devp->index))	
		{
			UART_PUT_CHAR(devp->index, devp->send_buf[devp->send_rd_point++]);
			if(devp->send_rd_point >= MAX_BUF_LEN)
			{
				devp->send_rd_point = 0;
			}
			devp->send_full_flag = 0;
		}
		else
		{
			break;
		}
	}

	if(devp->send_rd_point == devp->send_wr_point)
	{
	//	UART_DIB_WIRQ(devp->index);
		return;
	}
	UART_ENB_WIRQ(devp->index);
}
开发者ID:shangdawei,项目名称:tft-lcd,代码行数:27,代码来源:fpga_serial.c

示例9: sa1100_console_putchar

static void sa1100_console_putchar(struct uart_port *port, int ch)
{
	struct sa1100_port *sport = (struct sa1100_port *)port;

	while (!(UART_GET_UTSR1(sport) & UTSR1_TNF))
		barrier();
	UART_PUT_CHAR(sport, ch);
}
开发者ID:openube,项目名称:android_kernel_sony_c2305,代码行数:8,代码来源:sa1100.c

示例10: apbuart_console_putchar

static void apbuart_console_putchar(struct uart_port *port, int ch)
{
	unsigned int status;
	do {
		status = UART_GET_STATUS(port);
	} while (!UART_TX_READY(status));
	UART_PUT_CHAR(port, ch);
}
开发者ID:mikuhatsune001,项目名称:linux2.6.32,代码行数:8,代码来源:apbuart.c

示例11: early_serial_putc

static __init void early_serial_putc(struct uart_port *port, int ch)
{
	unsigned timeout = 0xffff;
	struct bfin_serial_port *uart = (struct bfin_serial_port *)port;

	while ((!(UART_GET_LSR(uart) & THRE)) && --timeout)
		cpu_relax();
	UART_PUT_CHAR(uart, ch);
}
开发者ID:johnny,项目名称:CobraDroidBeta,代码行数:9,代码来源:bfin_5xx.c

示例12: bfin_serial_poll_put_char

static void bfin_serial_poll_put_char(struct uart_port *port, unsigned char chr)
{
	struct bfin_serial_port *uart = (struct bfin_serial_port *)port;

	while (!(UART_GET_LSR(uart) & THRE))
		cpu_relax();

	UART_CLEAR_DLAB(uart);
	UART_PUT_CHAR(uart, (unsigned char)chr);
}
开发者ID:johnny,项目名称:CobraDroidBeta,代码行数:10,代码来源:bfin_5xx.c

示例13: ssauart_tx_one_char

/* Called with interrupts off only from start_tx() */
static void ssauart_tx_one_char (struct uart_port *port)
{
   struct circ_buf *xmit = &port->info->xmit;

   /* The Fifo may already contain data in which case, our work is
    * done since when it drains it will trigger an interrupt.
    */
   if ((UART_GET_LSR(port) & (1 << 6)) == 0)
      return;

   if (port->x_char)
   {
      UART_PUT_CHAR(port, port->x_char);
      port->x_char = 0;
      port->icount.tx++;
      return;
   }

   if (uart_circ_empty (xmit) || uart_tx_stopped (port))
      return;

   UART_PUT_CHAR(port, xmit->buf[xmit->tail]);
   xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
   port->icount.tx++;

   /*
      If the number of bytes remaining in the SW Tx circular buffer is less
      than WAKEUP_CHARS, wake up tasks trying to write to the UART device.
   */

   if (uart_circ_chars_pending (xmit) < WAKEUP_CHARS)
   {
      uart_write_wakeup (port);

      /*
         If there are no more bytes to transmit, disable Tx interrupts.
         (We don't need to refill the UART Tx fifo when it next becomes empty).
      */

      if (uart_circ_empty (xmit))
         ssauart_stop_tx (port, 0);
   }
}
开发者ID:SimonKagstrom,项目名称:mci500h-linux-2.4.27,代码行数:44,代码来源:ssa.c

示例14: apbuart_scan_fifo_size

static int apbuart_scan_fifo_size(struct uart_port *port, int portnumber)
{
	int ctrl, loop = 0;
	int status;
	int fifosize;
	unsigned long flags;

	ctrl = UART_GET_CTRL(port);


	local_irq_save(flags);

	UART_PUT_CTRL(port, ctrl | UART_CTRL_TE);

	while (!UART_TX_READY(UART_GET_STATUS(port)))
		loop++;


	UART_PUT_CTRL(port, ctrl & ~(UART_CTRL_TE));

	fifosize = 1;
	UART_PUT_CHAR(port, 0);


	status = UART_GET_STATUS(port);
	while (((status >> 20) & 0x3F) == fifosize) {
		fifosize++;
		UART_PUT_CHAR(port, 0);
		status = UART_GET_STATUS(port);
	}

	fifosize--;

	UART_PUT_CTRL(port, ctrl);
	local_irq_restore(flags);

	if (fifosize == 0)
		fifosize = 1;

	return fifosize;
}
开发者ID:DirtyDroidX,项目名称:android_kernel_htc_m8ul,代码行数:41,代码来源:apbuart.c

示例15: sa1100_tx_chars

static void sa1100_tx_chars(struct sa1100_port *sport)
{
	struct circ_buf *xmit = &sport->port.state->xmit;

	if (sport->port.x_char) {
		UART_PUT_CHAR(sport, sport->port.x_char);
		sport->port.icount.tx++;
		sport->port.x_char = 0;
		return;
	}

	/*
	 * Check the modem control lines before
	 * transmitting anything.
	 */
	sa1100_mctrl_check(sport);

	if (uart_circ_empty(xmit) || uart_tx_stopped(&sport->port)) {
		sa1100_stop_tx(&sport->port);
		return;
	}

	/*
	 * Tried using FIFO (not checking TNF) for fifo fill:
	 * still had the '4 bytes repeated' problem.
	 */
	while (UART_GET_UTSR1(sport) & UTSR1_TNF) {
		UART_PUT_CHAR(sport, xmit->buf[xmit->tail]);
		xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
		sport->port.icount.tx++;
		if (uart_circ_empty(xmit))
			break;
	}

	if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
		uart_write_wakeup(&sport->port);

	if (uart_circ_empty(xmit))
		sa1100_stop_tx(&sport->port);
}
开发者ID:openube,项目名称:android_kernel_sony_c2305,代码行数:40,代码来源:sa1100.c


注:本文中的UART_PUT_CHAR函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。