• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ serial_putc函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: serial_putc_dev

static void serial_putc_dev(struct udevice *dev, char ch)
{
	struct dm_serial_ops *ops = serial_get_ops(cur_dev);
	int err;

	do {
		err = ops->putc(cur_dev, ch);
	} while (err == -EAGAIN);
	if (ch == '\n')
		serial_putc('\r');
}
开发者ID:test1954,项目名称:maxle-uboot-v3,代码行数:11,代码来源:serial-uclass.c


示例2: serial_putc

void serial_putc(const char c)
{
	if (c == '\n')
		serial_putc('\r');

	/* Wait for fifo to shift out some bytes */
	while (!((readb(&uart->lsr) & (UART_LSR_TDRQ | UART_LSR_TEMT)) == 0x60))
		;

	writeb((u8)c, &uart->rbr_thr_dllr);
}
开发者ID:IngenicC,项目名称:u-boot,代码行数:11,代码来源:jz_serial.c


示例3: serial_puts

void serial_puts (const char *s)
#endif
{
	while (*s) {
#if defined(CONFIG_SERIAL_MULTI)
		serial_putc_dev (dev_base, *s++);
#else
		serial_putc (*s++);
#endif
	}
}
开发者ID:Admetric,项目名称:android_u-boot_s5pv210,代码行数:11,代码来源:serial.c


示例4: uart_irq_callback

void uart_irq_callback(uint32_t id, SerialIrq event)
{
	serial_t *sobj = (void*)id;

	if(event == RxIrq) {
		acquire_wakelock(WAKELOCK_EXAMPLE);

		rc = serial_getc(sobj);

		if (rc == '\r' || rc == '\n') {
			serial_putc(sobj, '\r');
			serial_putc(sobj, '\n');
			serial_putc(sobj, '#');
			serial_putc(sobj, ' ');

			if (cmdbuf_index != 0) {

                /* NOTICE: If you don't want loss any data from treating UART signal as GPIO interrupt,
                 *         you can set FREERTOS_PMU_TICKLESS_PLL_RESERVED to 1 in "platform_opt.h".
                 *         It will reserved PLL clock in tickless and UART can receive the whole data.
                 *         But it also cost more power consumption.
                 **/

				// process command
				printf("cmd(%d): %s\r\n", cmdbuf_index, cmdbuf);

				// release wakelock and reset buf
				cmdbuf_index = 0;
				release_wakelock(WAKELOCK_EXAMPLE);
			}
		}

		if (!(rc == '\r' || rc == '\n' )) {
			// receive command
			serial_putc(sobj, rc);
			cmdbuf[cmdbuf_index] = rc;
			cmdbuf_index++;
			cmdbuf[cmdbuf_index] = '\0';
		}
	}
}
开发者ID:KuanYuChen,项目名称:ameba-sdk-gcc-make,代码行数:41,代码来源:main.c


示例5: handleSetSensorRange

void handleSetSensorRange(uint8_t sensorId, uint8_t measurementId, uint8_t range)
{
	if (sensorId < no_of_sensors_ && measurementId < sensors_[sensorId]->no_of_measurements)
	{
		sensors_[sensorId]->set_range(measurementId, range);

		serial_putc(OBJECT_START);
		serial_putc(CMD_SET_SENSOR_RANGE);
		serial_putc(DELIMITER);
		serial_putc('0' + sensorId);
		serial_putc(DELIMITER);
		serial_putc('0' + measurementId);
		serial_putc(DELIMITER);
		serial_putc('0' + sensors_[sensorId]->range[measurementId]);
		serial_putc(OBJECT_END);
	}
}
开发者ID:konstantinwerner,项目名称:sensors,代码行数:17,代码来源:sensors.c


示例6: serial_putc

/* write write out a single char */
extern void serial_putc (char ch)
{
	/* Stream-LF to CR+LF conversion */
	if (ch == 10)
		serial_putc ('\r');

	/* wait till safe to write next char */
	TxCharReady ();

	/* finally, write next char */
	p2_outl (UART_TXBUFFER_REG, ch);
}
开发者ID:Blagus,项目名称:STB8000-U-Boot,代码行数:13,代码来源:stm-asc.c


示例7: serial_printf

void serial_printf(const char* fmt, ...)
{
	char* line = malloc(82);
	va_list args;
	int linelen;

	va_start(args, fmt);
	if ((linelen = vsnprintf(line, 82, fmt, args)) >= 82)
	{
		va_end(args);
		va_start(args, fmt);
		free(line);
		line = malloc(linelen + 1);
		vsnprintf(line, linelen + 1, fmt, args);
	}
	serial_puts(line);
	va_end(args);
	free(line);
	serial_putc('\r');
	serial_putc('\n');
}
开发者ID:Tiger21820,项目名称:TempGBA,代码行数:21,代码来源:serial.c


示例8: serial_puts

/*==============================================================================
 * - serial_puts()
 *
 * - send a string
 */
int serial_puts(const char *s)
{
    int i = 0;

    SERIAL_FIFO_LOCK();
    while (*s) {
        serial_putc(*s++);
        i++;
    }
    SERIAL_FIFO_UNLOCK();
    return i;
}
开发者ID:WangDongfang,项目名称:DfewOS,代码行数:17,代码来源:serial.c


示例9: serial_putc

void serial_putc (const char c)
{
	__REG(UART_PHYS + UTXD) = c;

	/* wait for transmitter to be ready */
	while (!(__REG(UART_PHYS + UTS) & UTS_TXEMPTY))
		WATCHDOG_RESET();

	/* If \n, also do \r */
	if (c == '\n')
		serial_putc ('\r');
}
开发者ID:Aorjoa,项目名称:bootloader,代码行数:12,代码来源:serial_mxc.c


示例10: serial_put_hex

SPL_STATIC_FUNC
void serial_put_hex(unsigned int data,unsigned bitlen)
{
	int i;
    for (i=bitlen-4;i>=0;i-=4){
        if((data>>i)==0)
        {
            serial_putc(0x30);
            continue;
        }

        unsigned char s = (data>>i)&0xf;
        if (s<10)
            serial_putc(0x30+s);
        else
            serial_putc(0x61+s-10);
    }

	serial_wait_tx_empty();

}
开发者ID:alpha-it,项目名称:u-boot,代码行数:21,代码来源:serial.c


示例11: serial_putc

void serial_putc (const char c)
{
    volatile u8 *uart_lsr = (volatile u8 *)(UART_BASE + OFF_LSR);
    volatile u8 *uart_tdr = (volatile u8 *)(UART_BASE + OFF_TDR);

    if (c == '\n') serial_putc ('\r');

    /* Wait for fifo to shift out some bytes */
    while ( !((*uart_lsr & (UART_LSR_TDRQ | UART_LSR_TEMT)) == 0x60) );

    *uart_tdr = (u8)c;
}
开发者ID:yindian,项目名称:dingoo-linux,代码行数:12,代码来源:serial.c


示例12: serial_putc

/* Send a character */
void serial_putc(const char c)
{
	/* Wait for room in TX FIFO */
	while (REG_RD(DBGUART_BASE + UARTDBGFR) & TXFF)
		;

	/* Write the data byte */
	REG_WR(DBGUART_BASE + UARTDBGDR, c);

	if (c == '\n')
		serial_putc('\r');
}
开发者ID:AvalueAES,项目名称:rev-sa01,代码行数:13,代码来源:stmp3xxx_dbguart.c


示例13: serial_putc

void serial_putc (const char c)
{
	volatile u32 *uart_lsr = (volatile u32*)(UART0_ADDR+UART_LSR);
	volatile u32 *uart_tx = (volatile u32*)(UART0_ADDR+UART_TX);

	if (c == '\n') serial_putc ('\r');

	/* Wait for fifo to shift out some bytes */
	while((*uart_lsr&UART_LSR_THRE)==0);

	*uart_tx = (u32)c;
}
开发者ID:qwerty1023,项目名称:wive-rtnl-firmware,代码行数:12,代码来源:au1x00_serial.c


示例14: serial_putb

void serial_putb (unsigned int d) {
    unsigned int m;
    for (m = 0x80000000; m != 0x00800000; m >>= 1) serial_putc(m & d ? '1' : '0');
    serial_putc(' ');
    for (m = 0x00800000; m != 0x00008000; m >>= 1) serial_putc(m & d ? '1' : '0');
    serial_putc(' ');
    for (m = 0x00008000; m != 0x00000080; m >>= 1) serial_putc(m & d ? '1' : '0');
    serial_putc(' ');
    for (m = 0x00000080; m != 0x00000000; m >>= 1) serial_putc(m & d ? '1' : '0');
}
开发者ID:yindian,项目名称:dingoo-linux,代码行数:10,代码来源:serial.c


示例15: ameba_uart_putc

static int ameba_uart_putc (struct rt_serial_device *serial, char c)
{
    struct device_uart* uart;

    uart = serial->parent.user_data;

    /* FIFO status, contain valid data */
    /* write data */
    serial_putc(&uart->serial, c);

    return (1);
}
开发者ID:DigFarmer,项目名称:rt-thread,代码行数:12,代码来源:drv_uart.c


示例16: serial_putc

/*
 * Output a single byte to the serial port.
 */
void serial_putc (const char c)
{
	volatile unsigned char *fifo;

	/* If \n, also do \r */
	if (c == '\n')
		serial_putc ('\r');

	fifo = (volatile unsigned char *) &(serial_reg_ch1->fifo);
	TXWAITRDY (serial_reg_ch1);
	*fifo = c;
}
开发者ID:A1DEVS,项目名称:lenovo_a1_07_uboot,代码行数:15,代码来源:serial_netarm.c


示例17: debug_read_reg

STATIC_PREFIX void debug_read_reg(int argc, char * argv[])
{
    unsigned  reg;
    if(argc<2)
    {
        serial_puts("FAIL:Wrong read reg command\n");
        return;
    }
    if(get_dword(argv[1],&reg))
    {
        serial_puts("FAIL:Wrong reg addr=");
        serial_puts(argv[1]);
        serial_putc('\n');
        return;
    }
    serial_puts("OK:Read ");
    serial_put_hex(reg,32);
    serial_putc('=');
    serial_put_hex(readl(reg),32);
    serial_putc('\n');
}
开发者ID:rofehr,项目名称:uboot-amlogic,代码行数:21,代码来源:debug_rom.c


示例18: checkboard

int checkboard (void)
{
    vpd_packet_t *packet;
    int i;

    packet = vpd_find_packet(VPD_PID_PID);
    for (i=0; i<packet->size; i++) {
        serial_putc (packet->data[i]);
    }
    packet = vpd_find_packet(VPD_PID_MT);
    for (i=0; i<packet->size; i++) {
        serial_putc (packet->data[i]);
    }
    serial_putc ('(');
    packet = vpd_find_packet(VPD_PID_FAN);
    for (i=0; i<packet->size; i++) {
        serial_putc (packet->data[i]);
    }
    serial_putc (')');

    if (!(MBX_CSR2 & SR2_BATGD))
        printf("\n         *** Warning: Low Battery Status - On-Board Battery ***");
    if (!(MBX_CSR2 & SR2_NVBATGD))
        printf("\n         *** Warning: Low Battery Status - NVRAM Battery ***");

    serial_putc ('\n');

    return (1);
}
开发者ID:beyonwiz,项目名称:openplisvn,代码行数:29,代码来源:mbx8xx.c


示例19: draw_print_buffer

void draw_print_buffer() {
#ifdef DRAW_DEBUG
uns8	inv_y, x , y,
		 byte_loc, bit_loc;
uns16	 buffer_loc;

	for(y = 0 ; y < DRAW_PIXELS_HIGH ; y++) {
		inv_y = DRAW_PIXELS_HIGH - 1 - y; // need to print out from the top
		if (inv_y < 10) {
			serial_putc('0');
		}
		serial_print_int(inv_y);
		serial_putc(' ');
		serial_print_int_hex(inv_y * DRAW_PIXELS_WIDE / DRAW_PIXELS_PER_BYTE);
		serial_putc('|');
		for(x = 0 ; x < DRAW_PIXELS_WIDE  ; x++) {
			buffer_loc = inv_y * DRAW_PIXELS_WIDE + x;
			byte_loc = buffer_loc / DRAW_PIXELS_PER_BYTE;
			bit_loc = buffer_loc & (DRAW_PIXELS_PER_BYTE -1);

			//if (bit_loc == 0) {
			//	serial_putc(' ');
			//	serial_print_int_hex(byte_loc);
			//	serial_putc(' ');
			//}	
			
			if (test_bit(draw_buffer0[byte_loc], bit_loc)) {
				
					serial_putc('1');
					
			} else {
				serial_putc('0');
			}
		}
		
		serial_print_str("|\n");
		
	}
#endif	
}			
开发者ID:MotionReality,项目名称:picpack,代码行数:40,代码来源:draw.c


示例20: checkboard

int checkboard (void)
{
	vpd_packet_t *packet;
	int i;
	const char *const fmt =
		"\n	 *** Warning: Low Battery Status - %s Battery ***";

	puts ("Board: ");

	packet = vpd_find_packet (VPD_PID_PID);
	for (i = 0; i < packet->size; i++) {
		serial_putc (packet->data[i]);
	}
	packet = vpd_find_packet (VPD_PID_MT);
	for (i = 0; i < packet->size; i++) {
		serial_putc (packet->data[i]);
	}
	serial_putc ('(');
	packet = vpd_find_packet (VPD_PID_FAN);
	for (i = 0; i < packet->size; i++) {
		serial_putc (packet->data[i]);
	}
	serial_putc (')');

	if (!(MBX_CSR2 & SR2_BATGD))
		printf (fmt, "On-Board");
	if (!(MBX_CSR2 & SR2_NVBATGD))
		printf (fmt, "NVRAM");

	serial_putc ('\n');

	return (0);
}
开发者ID:Brian1013,项目名称:u-boot,代码行数:33,代码来源:mbx8xx.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ serial_puts函数代码示例发布时间:2022-05-30
下一篇:
C++ serial_printf函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap