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


C++ UART_PUT_CR函数代码示例

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


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

示例1: at91_console_setup

static int __init at91_console_setup(struct console *co, char *options)
{
	struct uart_port *port;
	int baud = 115200;
	int bits = 8;
	int parity = 'n';
	int flow = 'n';

	/*
	 * Check whether an invalid uart number has been specified, and
	 * if so, search for the first available port that does have
	 * console support.
	 */
	port = uart_get_console(at91_ports, AT91_NR_UART, co);

	/*
	 * Enable the serial console, in-case bootloader did not do it.
	 */
	at91_sys_write(AT91_PMC_PCER, 1 << port->irq);	/* enable clock */
	UART_PUT_IDR(port, -1);				/* disable interrupts */
	UART_PUT_CR(port, AT91_US_RSTSTA | AT91_US_RSTRX);
	UART_PUT_CR(port, AT91_US_TXEN | AT91_US_RXEN);

	if (options)
		uart_parse_options(options, &baud, &parity, &bits, &flow);
	else
		at91_console_get_options(port, &baud, &parity, &bits);

	return uart_set_options(port, co, baud, parity, bits, flow);
}
开发者ID:ena30,项目名称:snake-os,代码行数:30,代码来源:at91_serial.c

示例2: at91_set_mctrl

/*
 * Set state of the modem control output lines
 */
static void at91_set_mctrl(struct uart_port *port, u_int mctrl)
{
	unsigned int control = 0;

	/*
	 * Errata #39: RTS0 is not internally connected to PA21.  We need to drive
	 *  the pin manually.
	 */
	if (port->mapbase == AT91_VA_BASE_US0) {
		if (mctrl & TIOCM_RTS)
			at91_sys_write(AT91_PIOA + PIO_CODR, AT91_PA21_RTS0);
		else
			at91_sys_write(AT91_PIOA + PIO_SODR, AT91_PA21_RTS0);
	}

	if (mctrl & TIOCM_RTS)
		control |= AT91_US_RTSEN;
	else
		control |= AT91_US_RTSDIS;

	if (mctrl & TIOCM_DTR)
		control |= AT91_US_DTREN;
	else
		control |= AT91_US_DTRDIS;

	UART_PUT_CR(port,control);
}
开发者ID:ena30,项目名称:snake-os,代码行数:30,代码来源:at91_serial.c

示例3: pl010_startup

static int pl010_startup(struct uart_port *port)
{
	struct uart_amba_port *uap = (struct uart_amba_port *)port;
	int retval;

	/*
	 * Allocate the IRQ
	 */
	retval = request_irq(port->irq, pl010_int, 0, "uart-pl010", port);
	if (retval)
		return retval;

	/*
	 * initialise the old status of the modem signals
	 */
	uap->old_status = UART_GET_FR(port) & UART01x_FR_MODEM_ANY;

	/*
	 * Finally, enable interrupts
	 */
	UART_PUT_CR(port, UART01x_CR_UARTEN | UART010_CR_RIE |
			  UART010_CR_RTIE);

	return 0;
}
开发者ID:BackupTheBerlios,项目名称:tew632-brp-svn,代码行数:25,代码来源:amba-pl010.c

示例4: ambauart_enable_ms

static void ambauart_enable_ms(struct uart_port *port)
{
	unsigned int cr;

	cr = UART_GET_CR(port);
	cr |= AMBA_UARTCR_MSIE;
	UART_PUT_CR(port, cr);
}
开发者ID:niubl,项目名称:camera_project,代码行数:8,代码来源:amba.c

示例5: ambauart_stop_rx

static void ambauart_stop_rx(struct uart_port *port)
{
	unsigned int cr;

	cr = UART_GET_CR(port);
	cr &= ~(AMBA_UARTCR_RIE | AMBA_UARTCR_RTIE);
	UART_PUT_CR(port, cr);
}
开发者ID:niubl,项目名称:camera_project,代码行数:8,代码来源:amba.c

示例6: ambauart_stop_tx

static void ambauart_stop_tx(struct uart_port *port, u_int from_tty)
{
	unsigned int cr;

	cr = UART_GET_CR(port);
	cr &= ~AMBA_UARTCR_TIE;
	UART_PUT_CR(port, cr);
}
开发者ID:niubl,项目名称:camera_project,代码行数:8,代码来源:amba.c

示例7: pl010_start_tx

static void pl010_start_tx(struct uart_port *port)
{
	unsigned int cr;

	cr = UART_GET_CR(port);
	cr |= UART010_CR_TIE;
	UART_PUT_CR(port, cr);
}
开发者ID:BackupTheBerlios,项目名称:tew632-brp-svn,代码行数:8,代码来源:amba-pl010.c

示例8: pl010_stop_rx

static void pl010_stop_rx(struct uart_port *port)
{
	unsigned int cr;

	cr = UART_GET_CR(port);
	cr &= ~(UART010_CR_RIE | UART010_CR_RTIE);
	UART_PUT_CR(port, cr);
}
开发者ID:BackupTheBerlios,项目名称:tew632-brp-svn,代码行数:8,代码来源:amba-pl010.c

示例9: pl010_enable_ms

static void pl010_enable_ms(struct uart_port *port)
{
	unsigned int cr;

	cr = UART_GET_CR(port);
	cr |= UART010_CR_MSIE;
	UART_PUT_CR(port, cr);
}
开发者ID:BackupTheBerlios,项目名称:tew632-brp-svn,代码行数:8,代码来源:amba-pl010.c

示例10: pl010_stop_tx

static void pl010_stop_tx(struct uart_port *port, unsigned int tty_stop)
{
	unsigned int cr;

	cr = UART_GET_CR(port);
	cr &= ~UART010_CR_TIE;
	UART_PUT_CR(port, cr);
}
开发者ID:earthGavinLee,项目名称:hg556a_source,代码行数:8,代码来源:amba-pl010.c

示例11: ambauart_start_tx

static void ambauart_start_tx(struct uart_port *port, unsigned int tty_start)
{
	unsigned int cr;

	cr = UART_GET_CR(port);
	cr |= AMBA_UARTCR_TIE;
	UART_PUT_CR(port, cr);
}
开发者ID:jameshilliard,项目名称:actiontec_opensrc_mi424wr-rev-ef_fw-20-19-8,代码行数:8,代码来源:amba.c

示例12: ambauart_start_tx

static void ambauart_start_tx(struct uart_port *port, u_int nonempty, u_int from_tty)
{
	if (nonempty) {
		unsigned int cr;

		cr = UART_GET_CR(port);
		cr |= AMBA_UARTCR_TIE;
		UART_PUT_CR(port, cr);
	}
}
开发者ID:niubl,项目名称:camera_project,代码行数:10,代码来源:amba.c

示例13: atmel_startup

/*
 * Perform initialization and enable port for reception
 */
static int atmel_startup(struct uart_port *port)
{
	struct atmel_uart_port *atmel_port = (struct atmel_uart_port *) port;
	int retval;

	/*
	 * Ensure that no interrupts are enabled otherwise when
	 * request_irq() is called we could get stuck trying to
	 * handle an unexpected interrupt
	 */
	UART_PUT_IDR(port, -1);

	/*
	 * Allocate the IRQ
	 */
	retval = request_irq(port->irq, atmel_interrupt, IRQF_SHARED, "atmel_serial", port);
	if (retval) {
		printk("atmel_serial: atmel_startup - Can't get irq\n");
		return retval;
	}

	/*
	 * If there is a specific "open" function (to register
	 * control line interrupts)
	 */
	if (atmel_open_hook) {
		retval = atmel_open_hook(port);
		if (retval) {
			free_irq(port->irq, port);
			return retval;
		}
	}

	/*
	 * Finally, enable the serial port
	 */
	UART_PUT_CR(port, ATMEL_US_RSTSTA | ATMEL_US_RSTRX);
	UART_PUT_CR(port, ATMEL_US_TXEN | ATMEL_US_RXEN);		/* enable xmit & rcvr */

	UART_PUT_IER(port, ATMEL_US_RXRDY);		/* enable receive only */

	return 0;
}
开发者ID:cilynx,项目名称:dd-wrt,代码行数:46,代码来源:atmel_serial.c

示例14: at91_rx_chars

/*
 * Characters received (called from interrupt handler)
 */
static void at91_rx_chars(struct uart_port *port, struct pt_regs *regs)
{
	struct tty_struct *tty = port->info->tty;
	unsigned int status, ch, flg;

	status = UART_GET_CSR(port) & port->read_status_mask;
	while (status & (AT91_US_RXRDY)) {
		ch = UART_GET_CHAR(port);

		port->icount.rx++;

		flg = TTY_NORMAL;

		/*
		 * note that the error handling code is
		 * out of the main execution path
		 */
		if (unlikely(status & (AT91_US_PARE | AT91_US_FRAME | AT91_US_OVRE))) {
			UART_PUT_CR(port, AT91_US_RSTSTA);	/* clear error */
			if (status & (AT91_US_PARE))
				port->icount.parity++;
			if (status & (AT91_US_FRAME))
				port->icount.frame++;
			if (status & (AT91_US_OVRE))
				port->icount.overrun++;

			if (status & AT91_US_PARE)
				flg = TTY_PARITY;
			else if (status & AT91_US_FRAME)
				flg = TTY_FRAME;
			if (status & AT91_US_OVRE) {
				/*
				 * overrun does *not* affect the character
				 * we read from the FIFO
				 */
				tty_insert_flip_char(tty, ch, flg);
				ch = 0;
				flg = TTY_OVERRUN;
			}
#ifdef SUPPORT_SYSRQ
			port->sysrq = 0;
#endif
		}

		if (uart_handle_sysrq_char(port, ch, regs))
			goto ignore_char;

		tty_insert_flip_char(tty, ch, flg);

	ignore_char:
		status = UART_GET_CSR(port) & port->read_status_mask;
	}

	tty_flip_buffer_push(tty);
}
开发者ID:ena30,项目名称:snake-os,代码行数:58,代码来源:at91_serial.c

示例15: at91_startup

/*
 * Perform initialization and enable port for reception
 */
static int at91_startup(struct uart_port *port)
{
	int retval;

	/*
	 * Ensure that no interrupts are enabled otherwise when
	 * request_irq() is called we could get stuck trying to
	 * handle an unexpected interrupt
	 */
	UART_PUT_IDR(port, -1);

	/*
	 * Allocate the IRQ
	 */
	retval = request_irq(port->irq, at91_interrupt, SA_SHIRQ, "at91_serial", port);
	if (retval) {
		printk("at91_serial: at91_startup - Can't get irq\n");
		return retval;
	}

	/*
	 * If there is a specific "open" function (to register
	 * control line interrupts)
	 */
	if (at91_open) {
		retval = at91_open(port);
		if (retval) {
			free_irq(port->irq, port);
			return retval;
		}
	}

	port->read_status_mask = AT91_US_RXRDY | AT91_US_TXRDY | AT91_US_OVRE
			| AT91_US_FRAME | AT91_US_PARE | AT91_US_RXBRK;
	/*
	 * Finally, enable the serial port
	 */
	UART_PUT_CR(port, AT91_US_RSTSTA | AT91_US_RSTRX);
	UART_PUT_CR(port, AT91_US_TXEN | AT91_US_RXEN);		/* enable xmit & rcvr */
	UART_PUT_IER(port, AT91_US_RXRDY);			/* do receive only */
	return 0;
}
开发者ID:ena30,项目名称:snake-os,代码行数:45,代码来源:at91_serial.c


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