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

C++ sirdev_set_dtr_rts函数代码示例

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

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



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

示例1: litelink_reset

/*
 * Function litelink_reset (task)
 *
 *      Reset the Litelink type dongle.
 *
 */
static int litelink_reset(struct sir_dev *dev)
{
	IRDA_DEBUG(2, "%s()\n", __func__);

	/* probably the power-up can be dropped here, but with only
	 * 15 usec delay it's not worth the risk unless somebody with
	 * the hardware confirms it doesn't break anything...
	 */

	/* Power on dongle */
	sirdev_set_dtr_rts(dev, TRUE, TRUE);

	/* Sleep a minimum of 15 us */
	udelay(MIN_DELAY);

	/* Clear RTS to reset dongle */
	sirdev_set_dtr_rts(dev, TRUE, FALSE);

	/* Sleep a minimum of 15 us */
	udelay(MIN_DELAY);

	/* Go back to normal mode */
	sirdev_set_dtr_rts(dev, TRUE, TRUE);

	/* Sleep a minimum of 15 us */
	udelay(MIN_DELAY);

	dev->speed = 115200;

	return 0;
}
开发者ID:magnusjjj,项目名称:android_kernel_huawei_rle,代码行数:37,代码来源:litelink-sir.c


示例2: actisys_reset

static int actisys_reset(struct sir_dev *dev)
{
	/* Reset the dongle : set DTR low for 10 us */
	sirdev_set_dtr_rts(dev, FALSE, TRUE);
	udelay(MIN_DELAY);

	/* Go back to normal mode */
	sirdev_set_dtr_rts(dev, TRUE, TRUE);
	
	dev->speed = 9600;	/* That's the default */

	return 0;
}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:13,代码来源:actisys-sir.c


示例3: ma600_change_speed

static int ma600_change_speed(struct sir_dev *dev, unsigned speed)
{
	u8	byte;
	
	IRDA_DEBUG(2, "%s(), speed=%d (was %d)\n", __FUNCTION__,
		speed, dev->speed);

	/* dongle already reset, dongle and port at default speed (9600) */

	/* Set RTS low for 1 ms */
	sirdev_set_dtr_rts(dev, TRUE, FALSE);
	mdelay(1);

	/* Write control byte */
	byte = get_control_byte(speed);
	sirdev_raw_write(dev, &byte, sizeof(byte));

	/* Wait at least 10ms: fake wait_until_sent - 10 bits at 9600 baud*/
	set_current_state(TASK_UNINTERRUPTIBLE);
	schedule_timeout(msecs_to_jiffies(15));		/* old ma600 uses 15ms */

#if 1
	/* read-back of the control byte. ma600 is the first dongle driver
	 * which uses this so there might be some unidentified issues.
	 * Disable this in case of problems with readback.
	 */

	sirdev_raw_read(dev, &byte, sizeof(byte));
	if (byte != get_control_byte(speed))  {
		WARNING("%s(): bad control byte read-back %02x != %02x\n",
			__FUNCTION__, (unsigned) byte,
			(unsigned) get_control_byte(speed));
		return -1;
	}
	else
		IRDA_DEBUG(2, "%s() control byte write read OK\n", __FUNCTION__);
#endif

	/* Set DTR, Set RTS */
	sirdev_set_dtr_rts(dev, TRUE, TRUE);

	/* Wait at least 10ms */
	set_current_state(TASK_UNINTERRUPTIBLE);
	schedule_timeout(msecs_to_jiffies(10));

	/* dongle is now switched to the new speed */
	dev->speed = speed;

	return 0;
}
开发者ID:Antonio-Zhou,项目名称:Linux-2.6.11,代码行数:50,代码来源:ma600-sir.c


示例4: ma600_reset

int ma600_reset(struct sir_dev *dev)
{
	IRDA_DEBUG(2, "%s()\n", __func__);

	/* Reset the dongle : set DTR low for 10 ms */
	sirdev_set_dtr_rts(dev, FALSE, TRUE);
	msleep(10);

	/* Go back to normal mode */
	sirdev_set_dtr_rts(dev, TRUE, TRUE);
	msleep(10);

	dev->speed = 9600;      /* That's the dongle-default */

	return 0;
}
开发者ID:E-LLP,项目名称:n900,代码行数:16,代码来源:ma600-sir.c


示例5: toim3232_close

static int toim3232_close(struct sir_dev *dev)
{
	/* Power off dongle */
	sirdev_set_dtr_rts(dev, FALSE, FALSE);

	return 0;
}
开发者ID:020gzh,项目名称:linux,代码行数:7,代码来源:toim3232-sir.c


示例6: actisys_close

static int actisys_close(struct sir_dev *dev)
{
	/* Power off the dongle */
	sirdev_set_dtr_rts(dev, FALSE, FALSE);

	return 0;
}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:7,代码来源:actisys-sir.c


示例7: girbil_reset

static int girbil_reset(struct sir_dev *dev)
{
    unsigned state = dev->fsm.substate;
    unsigned delay = 0;
    u8 control = GIRBIL_TXEN | GIRBIL_RXEN;
    int ret = 0;

    IRDA_DEBUG(2, "%s()\n", __FUNCTION__);

    switch (state) {
    case SIRDEV_STATE_DONGLE_RESET:
        /* Reset dongle */
        sirdev_set_dtr_rts(dev, TRUE, FALSE);
        /* Sleep at least 5 ms */
        delay = 20;
        state = GIRBIL_STATE_WAIT1_RESET;
        break;

    case GIRBIL_STATE_WAIT1_RESET:
        /* Set DTR and clear RTS to enter command mode */
        sirdev_set_dtr_rts(dev, FALSE, TRUE);
        delay = 20;
        state = GIRBIL_STATE_WAIT2_RESET;
        break;

    case GIRBIL_STATE_WAIT2_RESET:
        /* Write control byte */
        sirdev_raw_write(dev, &control, 1);
        delay = 20;
        state = GIRBIL_STATE_WAIT3_RESET;
        break;

    case GIRBIL_STATE_WAIT3_RESET:
        /* Go back to normal mode */
        sirdev_set_dtr_rts(dev, TRUE, TRUE);
        dev->speed = 9600;
        break;

    default:
        IRDA_ERROR("%s(), undefined state %d\n", __FUNCTION__, state);
        ret = -1;
        break;
    }
    dev->fsm.substate = state;
    return (delay > 0) ? delay : ret;
}
开发者ID:274914765,项目名称:C,代码行数:46,代码来源:girbil-sir.c


示例8: tekram_reset

static int tekram_reset(struct sir_dev *dev)
{
	/* Clear DTR, Set RTS */
	sirdev_set_dtr_rts(dev, FALSE, TRUE); 

	/* Should sleep 1 ms */
	msleep(1);

	/* Set DTR, Set RTS */
	sirdev_set_dtr_rts(dev, TRUE, TRUE);
	
	/* Wait at least 50 us */
	udelay(75);

	dev->speed = 9600;

	return 0;
}
开发者ID:020gzh,项目名称:linux,代码行数:18,代码来源:tekram-sir.c


示例9: tekram_close

static int tekram_close(struct sir_dev *dev)
{
	IRDA_DEBUG(2, "%s()\n", __func__);

	/*                  */
	sirdev_set_dtr_rts(dev, FALSE, FALSE);

	return 0;
}
开发者ID:romanbb,项目名称:android_kernel_lge_d851,代码行数:9,代码来源:tekram-sir.c


示例10: girbil_close

static int girbil_close(struct sir_dev *dev)
{
    IRDA_DEBUG(2, "%s()\n", __FUNCTION__);

    /* Power off dongle */
    sirdev_set_dtr_rts(dev, FALSE, FALSE);

    return 0;
}
开发者ID:274914765,项目名称:C,代码行数:9,代码来源:girbil-sir.c


示例11: ma600_reset

int ma600_reset(struct sir_dev *dev)
{
	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);

	/* Reset the dongle : set DTR low for 10 ms */
	sirdev_set_dtr_rts(dev, FALSE, TRUE);
	set_current_state(TASK_UNINTERRUPTIBLE);
	schedule_timeout(msecs_to_jiffies(10));

	/* Go back to normal mode */
	sirdev_set_dtr_rts(dev, TRUE, TRUE);
	set_current_state(TASK_UNINTERRUPTIBLE);
	schedule_timeout(msecs_to_jiffies(10));

	dev->speed = 9600;      /* That's the dongle-default */

	return 0;
}
开发者ID:Antonio-Zhou,项目名称:Linux-2.6.11,代码行数:18,代码来源:ma600-sir.c


示例12: tekram_reset

static int tekram_reset(struct sir_dev *dev)
{
	IRDA_DEBUG(2, "%s()\n", __func__);

	
	sirdev_set_dtr_rts(dev, FALSE, TRUE); 

	
	msleep(1);

	
	sirdev_set_dtr_rts(dev, TRUE, TRUE);
	
	
	udelay(75);

	dev->speed = 9600;

	return 0;
}
开发者ID:DirtyDroidX,项目名称:android_kernel_htc_m8ul,代码行数:20,代码来源:tekram-sir.c


示例13: mcp2120_close

static int mcp2120_close(struct sir_dev *dev)
{
	IRDA_DEBUG(2, "%s()\n", __func__);

	/* Power off dongle */
        /* reset and inhibit mcp2120 */
	sirdev_set_dtr_rts(dev, TRUE, TRUE);
	// sirdev_set_dtr_rts(dev, FALSE, FALSE);

	return 0;
}
开发者ID:nos1609,项目名称:Chrono_Kernel-1,代码行数:11,代码来源:mcp2120-sir.c


示例14: tekram_reset

static int tekram_reset(struct sir_dev *dev)
{
	IRDA_DEBUG(2, "%s()\n", __FUNCTION__);

	/* Clear DTR, Set RTS */
	sirdev_set_dtr_rts(dev, FALSE, TRUE); 

	/* Should sleep 1 ms */
	set_current_state(TASK_UNINTERRUPTIBLE);
	schedule_timeout(MSECS_TO_JIFFIES(1));

	/* Set DTR, Set RTS */
	sirdev_set_dtr_rts(dev, TRUE, TRUE);
	
	/* Wait at least 50 us */
	udelay(75);

	dev->speed = 9600;

	return 0;
}
开发者ID:wxlong,项目名称:Test,代码行数:21,代码来源:tekram-sir.c


示例15: toim3232_reset

static int toim3232_reset(struct sir_dev *dev)
{
	/* Switch off both DTR and RTS to switch off dongle */
	sirdev_set_dtr_rts(dev, FALSE, FALSE);

	/* Should sleep a while. This might be evil doing it this way.*/
	set_current_state(TASK_UNINTERRUPTIBLE);
	schedule_timeout(msecs_to_jiffies(50));

	/* Set DTR, Set RTS (data mode) */
	sirdev_set_dtr_rts(dev, TRUE, TRUE);

	/* Wait at least 10 ms for power to stabilize again */
	set_current_state(TASK_UNINTERRUPTIBLE);
	schedule_timeout(msecs_to_jiffies(10));

	/* Speed should now be 9600 */
	dev->speed = 9600;

	return 0;
}
开发者ID:020gzh,项目名称:linux,代码行数:21,代码来源:toim3232-sir.c


示例16: actisys_change_speed

/*
 * Function actisys_change_speed (task)
 *
 *    Change speed of the ACTiSYS IR-220L and IR-220L+ type IrDA dongles.
 *    To cycle through the available baud rates, pulse RTS low for a few us.
 *
 *	First, we reset the dongle to always start from a known state.
 *	Then, we cycle through the speeds by pulsing RTS low and then up.
 *	The dongle allow us to pulse quite fast, se we can set speed in one go,
 * which is must faster ( < 100 us) and less complex than what is found
 * in some other dongle drivers...
 *	Note that even if the new speed is the same as the current speed,
 * we reassert the speed. This make sure that things are all right,
 * and it's fast anyway...
 *	By the way, this function will work for both type of dongles,
 * because the additional speed is at the end of the sequence...
 */
static int actisys_change_speed(struct sir_dev *dev, unsigned speed)
{
	int ret = 0;
	int i = 0;

        IRDA_DEBUG(4, "%s(), speed=%d (was %d)\n", __FUNCTION__,
        	speed, dev->speed);

	/* dongle was already resetted from irda_request state machine,
	 * we are in known state (dongle default)
	 */

	/* 
	 * Now, we can set the speed requested. Send RTS pulses until we
         * reach the target speed 
	 */
	for (i = 0; i < MAX_SPEEDS; i++) {
		if (speed == baud_rates[i]) {
			dev->speed = speed;
			break;
		}
		/* Set RTS low for 10 us */
		sirdev_set_dtr_rts(dev, TRUE, FALSE);
		udelay(MIN_DELAY);

		/* Set RTS high for 10 us */
		sirdev_set_dtr_rts(dev, TRUE, TRUE);
		udelay(MIN_DELAY);
	}

	/* Check if life is sweet... */
	if (i >= MAX_SPEEDS) {
		actisys_reset(dev);
		ret = -EINVAL;  /* This should not happen */
	}

	/* Basta lavoro, on se casse d'ici... */
	return ret;
}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:56,代码来源:actisys-sir.c


示例17: mcp2120_reset

static int mcp2120_reset(struct sir_dev *dev)
{
	unsigned state = dev->fsm.substate;
	unsigned delay = 0;
	int ret = 0;

	IRDA_DEBUG(2, "%s()\n", __func__);

	switch (state) {
	case SIRDEV_STATE_DONGLE_RESET:
;
		/* Reset dongle by setting RTS*/
		sirdev_set_dtr_rts(dev, TRUE, TRUE);
		state = MCP2120_STATE_WAIT1_RESET;
		delay = 50;
		break;

	case MCP2120_STATE_WAIT1_RESET:
;
                /* clear RTS and wait for at least 30 ms. */
		sirdev_set_dtr_rts(dev, FALSE, FALSE);
		state = MCP2120_STATE_WAIT2_RESET;
		delay = 50;
		break;

	case MCP2120_STATE_WAIT2_RESET:
;
		/* Go back to normal mode */
		sirdev_set_dtr_rts(dev, FALSE, FALSE);
		break;

	default:
		IRDA_ERROR("%s(), undefined state %d\n", __func__, state);
		ret = -EINVAL;
		break;
	}
	dev->fsm.substate = state;
	return (delay > 0) ? delay : ret;
}
开发者ID:nos1609,项目名称:Chrono_Kernel-1,代码行数:39,代码来源:mcp2120-sir.c


示例18: tekram_open

static int tekram_open(struct sir_dev *dev)
{
	struct qos_info *qos = &dev->qos;

	sirdev_set_dtr_rts(dev, TRUE, TRUE);

	qos->baud_rate.bits &= IR_9600|IR_19200|IR_38400|IR_57600|IR_115200;
	qos->min_turn_time.bits = 0x01; /* Needs at least 10 ms */	
	irda_qos_bits_to_value(qos);

	/* irda thread waits 50 msec for power settling */

	return 0;
}
开发者ID:020gzh,项目名称:linux,代码行数:14,代码来源:tekram-sir.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ sit函数代码示例发布时间:2022-05-30
下一篇:
C++ sipTypeAsPyTypeObject函数代码示例发布时间: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