⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme

📁 linux下的RS485的驱动 值得一看
💻
字号:
ul_drv - uLan RS-485 communication driverCopyright (C) 1999 Pavel Pisa  (pisa@cmp.felk.cvut.cz)uLan provides 9-bit message oriented communication protocol,which is transfered over RS-485 link. Characters are transferedsame way as for RS-232 asynchronous transfer except paritybit, which is used to distinguish between data charactersand protocol control information. Physical layer consistof one twisted pair of leads and RS-485 transceivers.ul_drv is Linux device driver designed to access uLan network. Latest versions of the ul_drv can be compiled from same source into Windows NT KMD driver too (try to use ul_drv.mak).Today supported hardware is i82510 RS-485 card or simpleactive converter dongle for standard PC RS-232 ports.This version of driver was compiled and tested with Linux 2.2.4 kernel. Header file k_compat.h should enablecompilation for most of 2.0.xx, 2.1.xx and 2.2.xx kernels,but tweaking of k_compat.h may be necessary for some2.1.xx kernel versions.Makefile is link to Makefile-mod to compile driver withyour kernel configuration. Makefile-mod expect, thatkernel sources are in "/usr/src/linux" directoryand that kernel sources and its configuration are of same version as current running kernel.Enter next command in ul_drv directory to compile andinstall the module    make installModule is installed into "/lib/modules/x.y.z/misc" directory.Driver can control up to four devices, but only checkfor 0x3e8 port number is default behavior after "insmod ul_drv".Because of driver controls same hardware as Linux serialdriver, it is necessary to disable default kernel driverfor same port in case of conflict. It can be done for example by    setserial /dev/ttyS2 uart nonePort numbers and others parameters can be defined by module parameters. To access driver from programs special characterdevice files must be created. Suggested names are    mknod /dev/ulan0 c 248 0    mknod /dev/ulan1 c 248 1    ln -sf /dev/ulan0 /dev/ulan"/dev/ulan" is default name for client programs.Major number 248 is in experimental range and willbe changed in future. Number is defined in ul_hdep.h.If defined as zero, dynamic number is assigned after insmod.ul_drv module parameters  port=<iop>{,<iop> ...}	up to four IO port numbers separated by comas        for up to four uLan devices  irq=<int>{,<int> ...}	select for every defined device corresponding	IRQ number. Value 0 means autoprobe.  baud=<spd>{,<spd> ...}	defines transfer baud-rate for every device	default value is 9600  my_adr=<adr>{,<adr> ...}	address of every computer interface as seen	from uLan network 	range is from 1 to 64	default value is 2 for all interfacesBellow are example parameters for dongle converter pluggedto regular COM2 port.    setserial /dev/ttyS1 uart none    insmod ul_drv port=0x2f8 irq=3 baud=9600 my_adr=2Add next lines to /etc/modules.conf to enable on-demandmodule loading    alias    char-major-248 ul_drv    options    ul_drv port=0x2f8 irq=3 baud=9600 my_adr=2    pre-install ul_drv /sbin/setserial /dev/ttyS1 uart none

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -