CN103412841A - Driver and driving method for CPCI (Compact Peripheral Component Interconnect) bus RS422 communication module under VxWorks operating system - Google Patents

Driver and driving method for CPCI (Compact Peripheral Component Interconnect) bus RS422 communication module under VxWorks operating system Download PDF

Info

Publication number
CN103412841A
CN103412841A CN2013103890689A CN201310389068A CN103412841A CN 103412841 A CN103412841 A CN 103412841A CN 2013103890689 A CN2013103890689 A CN 2013103890689A CN 201310389068 A CN201310389068 A CN 201310389068A CN 103412841 A CN103412841 A CN 103412841A
Authority
CN
China
Prior art keywords
communication module
function
function interface
bus
plate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN2013103890689A
Other languages
Chinese (zh)
Other versions
CN103412841B (en
Inventor
潘大为
罗清华
王晓龙
李俊峰
彭宇
彭喜元
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Harbin Institute of Technology
Original Assignee
Harbin Institute of Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Harbin Institute of Technology filed Critical Harbin Institute of Technology
Priority to CN201310389068.9A priority Critical patent/CN103412841B/en
Publication of CN103412841A publication Critical patent/CN103412841A/en
Application granted granted Critical
Publication of CN103412841B publication Critical patent/CN103412841B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Transfer Systems (AREA)
  • Small-Scale Networks (AREA)

Abstract

A driver and a driving method for a CPCI (Compact Peripheral Component Interconnect) bus RS422 communication module under a VxWorks operating system relate to the technical field of drivers for CPCI bus RS422 communication, and solve the problems which are caused by the complex process that the implementation of the conventional CPCI bus RS422 communication driver under the VxWorks operating system requires the extraction of the data structure of a device before the device is created and the device driver is installed. The unit comprises a system resource allocation unit for initializing the RS422 communication module, a function interface unit for providing functional function interfaces and a driving unit for encapsulating user-oriented applications and driving the function interfaces. The method includes a system resource allocation step for initializing the RS422 communication module, a step for providing the functional function interfaces and a driving step for encapsulating the user-oriented applications and driving the function interfaces. The driver and the driving method are suitable for driving the RS422 communication module.

Description

Driver and the driving method of cpci bus RS422 communication module under VxWorks operating system
Technical field
The present invention relates to the Driving technique field of cpci bus RS422 communication.
Background technology
Under vxworks operating system, cpci bus RS-422 communication function module, as test module important in Auto-Test System, is applied in every field widely.Under traditional vxworks operating system based on the RS-422 communication module Driver Development of cpci bus, as required, realize corresponding power function interface, and be packaged into I/O interface (the I/O interface of seven standards of standard, open () for example, close (), read () etc.), be registered in the system drive list, be articulated under the I/O subsystem.In this process, drive the data structure that the developer need to take out equipment, the establishment of finishing equipment and the installation of device driver, this process more complicated, bring a lot of inconvenience for the driving developer.
Summary of the invention
At first the present invention need to take out the data structure of equipment for the realization that solves cpci bus RS422 communication drivers under existing vxworks operating system, the installation of the establishment of finishing equipment and device drives again, the problem that the process complexity causes, provide driver and the driving method of cpci bus RS422 communication module under a kind of vxworks operating system.
The driver of cpci bus RS422 communication module under a kind of vxworks operating system, it comprises:
System resource allocation device for initialization RS422 communication module;
For the function interface device of power function interface is provided;
For the encapsulation of user oriented application program, the drive unit of driving function interface.
Described system resource allocation device comprises:
For the device of acquisition based on each facility information of the RS422 communication module of cpci bus; This device comprises:
Vendor ID and Device ID according to each equipment of RS422 communication module, utilize function pciFindDevice () to carry out corresponding initialization functional unit to each equipment of RS422 communication module,
Each equipment Vendor ID, Device ID and serial number scanning bus according to the RS422 communication module, find out Bus number BUS No., device number Device No. and the function Func No. at each equipment place of RS422 communication module, according to Bus number BUS No., device number Device No. and function Func No., call again the device of pciConfigInLong () function and pciConfigInByte () function
Determine register base address and the interrupt number of each equipment, then by register base address and I/O mask bit phase with, obtain the device of internal register base address on final RS422 communication module plate;
For each equipment of RS422 communication module being carried out to the device of memory-mapped; This device comprises:
The device that distributes the memory headroom of PCI equipment with MMU,
Call function sysMmuMapAdd () is configured to memory headroom in the device of MMU;
Device for each device interrupt link to the RS422 communication module; This device comprises:
Under the VxWorks system, use pciIntConnect () function that the c program function of the interrupt vector of each equipment appointment and appointment is coupled together, and the address of pciIntConnect () function be stored in to the device in the interrupt vector of this appointment,
When an interrupt occurs, call the c program function of appointment, the device of break in service.
Described function interface device comprises:
Provide initialization RS422 communication module plate STATUS ComInit function interface, and to this function interface load driver program, the device of the communication board of initialization given plate number;
Provide and open RS422 communication module plate STATUS ComOpen function interface, by this function interface, open a certain dedicated tunnel of the communication board of given plate number, the device that the parameter of the row of channels of going forward side by side arranges;
Provide and close RS422 communication module plate STATUS ComClose function interface, by this function interface, close the communication board of given plate number, unloading communication board driver, can not be to the device of the operation of RS422 communication module plate except opening;
Provide and send data STATUS ComSendData function interface, by this function interface, the a-road-through road of RS422 communication module plate appointment is write the device of data to be sent;
Provide and receive to wait for STATUS ComRecvWait function interface, by this function interface, the plate number of RS422 communication module plate is specified, and etc. a-road-through road to be specified receive the device of the data ready in buffer memory;
Provide and receive data int ComRecvData function interface, by this function interface, the plate number of RS422 communication module plate is specified, and the a-road-through road that reads appointment receives the device of the data in buffer memory;
Provide communication board self check STATUS ComTest function interface, the device that the RS422 communication module plate of given plate number is carried out to self check by this function interface;
Real-Time Monitoring STATUS ComRTWatch function interface is provided, by this function interface, the RS422 communication module plate of given plate number is carried out the device of Real-Time Monitoring in place.
The driving method of cpci bus RS422 communication module under a kind of vxworks operating system, it comprises:
System resource allocation step for initialization RS422 communication module;
For the step of power function interface is provided;
For the encapsulation of user oriented application program, the actuation step of driving function interface.
Described system resource allocation step comprises:
For the step of acquisition based on each facility information of the RS422 communication module of cpci bus; This step comprises:
Vendor ID and Device ID according to each equipment of RS422 communication module, utilize function pciFindDevice () to carry out corresponding initialization function step to each equipment of RS422 communication module,
Each equipment Vendor ID, Device ID and serial number scanning bus according to the RS422 communication module, find out Bus number BUS No., device number Device No. and the function Func No. at each equipment place of RS422 communication module, according to Bus number BUS No., device number Device No. and function Func No., call again the step of pciConfigInLong () function and pciConfigInByte () function
Determine register base address and the interrupt number of each equipment, then by register base address and I/O mask bit phase with, obtain the step of internal register base address on final RS422 communication module plate;
For each equipment of RS422 communication module being carried out to the step of memory-mapped; This step comprises:
The step of distributing the memory headroom of PCI equipment with MMU,
Call function sysMmuMapAdd () is configured to memory headroom the step of MMU;
Step for each device interrupt link to the RS422 communication module; This step comprises:
Under the VxWorks system, use pciIntConnect () function that the c program function of the interrupt vector of each equipment appointment and appointment is coupled together, and the address of pciIntConnect () function be stored in to the step in the interrupt vector of this appointment,
When an interrupt occurs, call the c program function of appointment, the step of break in service.
Describedly be used to the step that the power function interface is provided, comprise:
Provide and open initialization RS422 communication module plate STATUS ComInit function interface, and to this function interface load driver program, the step of the communication board of initialization given plate number;
Provide and open RS422 communication module plate STATUS ComOpen function interface, by this function interface, open a certain dedicated tunnel of the communication board of given plate number, the step that the parameter of the row of channels of going forward side by side arranges;
Provide and close RS422 communication module plate STATUS ComClose function interface, by this function interface, close the communication board of given plate number, unloading communication board driver, can not be to the step of the operation of RS422 communication module plate except opening;
Provide and send data STATUS ComSendData function interface, by this function interface, the a-road-through road of RS422 communication module plate appointment is write the step of data to be sent;
Provide and receive to wait for STATUS ComRecvWait function interface, by this function interface, the plate number of RS422 communication module plate is specified, and etc. a-road-through road to be specified receive the step of the data ready in buffer memory;
Provide and receive data int ComRecvData function interface, by this function interface, the plate number of RS422 communication module plate is specified, and the a-road-through road that reads appointment receives the step of the data in buffer memory;
Provide communication board self check STATUS ComTest function interface, the step of the RS422 communication module plate of given plate number being carried out to self check by this function interface;
Real-Time Monitoring STATUS ComRTWatch function interface is provided, by this function interface, the RS422 communication module plate of given plate number is carried out the step of Real-Time Monitoring in place.
Advantage of the present invention: driver of the present invention or driving method are for cpci bus RS422 communication function module under vxworks operating system, new driving design and packing forms have been proposed, when realizing RS422 communication function module is effectively controlled, at decrease drive developer's development difficulty.
The present invention is according to the characteristics of RS422 communication function module, and a kind of driving interface encapsulation form of new RS422 communication function module is provided, and its application program-oriented method directly defines the form that drives interface, directly the encapsulation function interface function.In the process that drives exploitation, the design, the equipment that do not relate to the device data structure of traditional RS422 communication function module create and drive installation like this, the driving process of RS422 communication function module is become and be simple and easy to realize.
Driver of the present invention and driving method can be realized the effective control to RS422 communication function module; Its direct user oriented application program provides general driving function interface; Have independence and versatility, can be applicable to other design.
The accompanying drawing explanation
Fig. 1 is the configuration diagram of cpci bus RS422 communication module under vxworks operating system of the present invention;
Fig. 2 is the initialization function process flow diagram in the system resource allocation process;
Fig. 3 is RS422 communication major control process flow diagram;
Fig. 4 is RS422 communication board initialization flow process;
Fig. 5 is the implementation procedure process flow diagram of opening the function interface of RS422 communication module plate;
Fig. 6 is the implementation procedure process flow diagram of closing the function interface of RS422 communication module plate;
Fig. 7 is the process flow diagram that RS422 communication module plate sends data;
Fig. 8 is that RS422 communication module plate receives the process flow diagram of waiting for;
Fig. 9 is the process flow diagram that RS422 communication module plate receives data;
Figure 10 is the process flow diagram of RS422 communication module plate self check;
Figure 11 is the process flow diagram of RS422 communication module plate monitoring.
Embodiment
Embodiment one: below in conjunction with Fig. 1, present embodiment is described, the driver of cpci bus RS422 communication module under a kind of vxworks operating system, it comprises:
System resource allocation device for initialization RS422 communication module;
For the function interface device of power function interface is provided;
For the encapsulation of user oriented application program, the drive unit of driving function interface.
In present embodiment, the overall architecture of RS422 communication module as shown in Figure 1, following explaining is equally applicable to embodiment four: RS-422 communication function module operates in the CPCI cabinet, controls computing machine and realizes the read-write of RS-422 communication function module is controlled by cpci bus.Between cpci bus and RS-422 communication function circuit, need to realize the cpci bus interface controller, the cpci bus interface controller adopts the PCI9054 interface chip of PLX company to realize, cpci bus is transformed into to local bus.Complete compatible with PCI 2.2 standards of PCI9054 interface chip, and burst transfers of data speed is high, and the interface chip price is low simultaneously, and versatility is good, can effectively reduce development difficulty.PCI9054 local bus side is used FPGA to realize bus interface decoding, and simultaneously, FPGA indoor design control register, realize the control to RS-422 communication function circuit.The 8 passage RS-422 communication function circuit that RS-422 communication function part is comprised of light-coupled isolation chip, RS-422 driver, light-coupled isolation chip.The RS-422 communication differential signal RXDI+ of outside input, RXDI-is input to the FPGA programmable logic chip through the light-coupled isolation chip, thereby is transferred on cpci bus.And, from the transmitted signal of cpci bus, after the decoding of FPGA, by the light-coupled isolation chip, output to the output channel of RS-422.
The design of RS-422 communication function driver of modules
RS-422 communication function module is inserted in the CPCI cabinet to be moved, application program operates in to be controlled on computing machine, by cpci bus, realize the control to RS-422 communication function module, therefore need the driver of exploitation based on cpci bus RS-422 communication function module.The Driver Design of RS-422 communication function module mainly comprises initialization apparatus, the realization of power function interface and encapsulation.
Under the described a kind of vxworks operating system of embodiment two, this embodiment and embodiment one, the difference of the driver of cpci bus RS422 communication module is,
Described system resource allocation device comprises:
For the device of acquisition based on each facility information of the RS422 communication module of cpci bus; This device comprises:
Vendor ID and Device ID according to each equipment of RS422 communication module, utilize function pciFindDevice () to carry out corresponding initialization functional unit to each equipment of RS422 communication module,
Each equipment Vendor ID, Device ID and serial number scanning bus according to the RS422 communication module, find out Bus number BUS No., device number Device No. and the function Func No. at each equipment place of RS422 communication module, according to Bus number BUS No., device number Device No. and function Func No., call again the device of pciConfigInLong () function and pciConfigInByte () function
Determine register base address and the interrupt number of each equipment, then by register base address and I/O mask bit phase with, obtain the device of internal register base address on final RS422 communication module plate;
For each equipment of RS422 communication module being carried out to the device of memory-mapped; This device comprises:
The device that distributes the memory headroom of PCI equipment with MMU,
Call function sysMmuMapAdd () is configured to memory headroom in the device of MMU;
Device for each device interrupt link to the RS422 communication module; This device comprises:
Under the VxWorks system, use pciIntConnect () function that the c program function of the interrupt vector of each equipment appointment and appointment is coupled together, and the address of pciIntConnect () function be stored in to the device in the interrupt vector of this appointment,
When an interrupt occurs, call the c program function of appointment, the device of break in service.
Below the specific implementation of present embodiment is elaborated, following explaining is equally applicable to embodiment five:
Initialization apparatus
Initialization apparatus, as the important step of CPCI Development of device driver, is mainly to be the hardware distributing system resource, is mainly facility information, device memory mapping and the Break Link obtained based on the RS-422 communication function module of cpci bus here.
1) obtain the facility information based on the RS-422 communication function module of cpci bus
After the PCI device power, BIOS can PCI allocation equipment.The BIOS of target machine has the information such as interrupt number that the PCI equipment that finds and Vendor ID, Device ID, device type, distribution are listed in an interface when starting.
The initialization function first utilizes function pciFindDevice () to find corresponding equipment according to equipment Vendor ID and Device ID, according to Vendor ID, Device ID and identical device serial number (in a system, identical PCI equipment may be arranged), scan bus, find out BUS No., Device No. and the Func No. at equipment place.Then according to Bus number, device number and function number, call register base address and the interrupt number that pciConfigInLong () and pciConfigInByte () function are determined equipment.Again base address and I/O mask bit phase with obtain internal register base address on real plate.Initialization function flow process as shown in Figure 2.
2) device memory mapping
VxWorks provides the MMU(memory management unit of standard), the user can distribute with MMU the memory headroom of PCI equipment.After clear and definite base address and memory headroom size, call function sysMmuMapAdd () function can be configured to MMU by memory headroom.After having completed the device memory mapping of RS422 communication function module, can, by the access to device memory, realize the control to equipment.
3) Break Link
In vxworks operating system, use intConnect () link interruption service routine (ISR), but for CPCI equipment, the general pciIntConncet () that adopts articulates interruption, the main difference of it and intConnect () is that the interrupt vector that intConnect () is used monopolizes, and pciIntConncet () can make a plurality of external interrupt share an interrupt vector.PciIntConncet () is defined in pciIntLib.c, should comprise header file pciIntLib.h during use.Should notice that ventor is interrupt vector, need to be by the INUM_TO_IVEC acquisition that converts.
After under the VxWorks system, using pciIntConnect () function to interrupt and specifically c program couples together, this function interrelates the C function of appointment and the interrupt vector of appointment, and the address of function will be stored in this interrupt vector.When an interrupt occurs, system will be called this specific c program function, i.e. interrupt service routine.
Under the described a kind of vxworks operating system of embodiment three, this embodiment and embodiment one, the driver of cpci bus RS422 communication module, is characterized in that, described function interface device comprises:
Provide initialization RS422 communication module plate STATUS ComInit function interface, and to this function interface load driver program, the device of the communication board of initialization given plate number;
Provide and open RS422 communication module plate STATUS ComOpen function interface, by this function interface, open a certain dedicated tunnel of the communication board of given plate number, the device that the parameter of the row of channels of going forward side by side arranges;
Provide and close RS422 communication module plate STATUS ComClose function interface, by this function interface, close the communication board of given plate number, unloading communication board driver, can not be to the device of the operation of RS422 communication module plate except opening;
Provide and send data STATUS ComSendData function interface, by this function interface, the a-road-through road of RS422 communication module plate appointment is write the device of data to be sent;
Provide and receive to wait for STATUS ComRecvWait function interface, by this function interface, the plate number of RS422 communication module plate is specified, and etc. a-road-through road to be specified receive the device of the data ready in buffer memory;
Provide and receive data int ComRecvData function interface, by this function interface, the plate number of RS422 communication module plate is specified, and the a-road-through road that reads appointment receives the device of the data in buffer memory;
Provide communication board self check STATUS ComTest function interface, the device that the RS422 communication module plate of given plate number is carried out to self check by this function interface;
Real-Time Monitoring STATUS ComRTWatch function interface is provided, by this function interface, the RS422 communication module plate of given plate number is carried out the device of Real-Time Monitoring in place.
Below the specific implementation of present embodiment is elaborated, following explaining is equally applicable to embodiment six:
The realization of power function interface in present embodiment:
The realization of power function interface and encapsulation
1) realization of power function interface
The RS422 communication interface is totally 8 tunnels, can realize the selection of synchronous mode communication and asynchronous mode communication, in FPGA, realizes control register, controls the RS422 functional circuit.
In the inner control realized the RS422 communication module of FPGA, the major control flow process of RS422 module as shown in Figure 3.
The realization of above control flow, according to the driving hardware interface handbook that the hardware design personnel provide, the corresponding register of concrete operations, can realize the control to functional circuit.
To the operation of RS422 communication board, common are the board initialization, open passage, close board, send data, receive and wait for, receive data, self check and Real-Time Monitoring in place operation, each detailed design that drives interface function of RS422 plate is as follows:
1, communication board initialization, in Table 1:
Table 1
Figure BDA00003747041600081
Program circuit is as shown in Figure 4:
2, open passage, in Table 2
Table 2
Figure BDA00003747041600082
Program circuit as shown in Figure 5.
3, communication close plate, in Table 3
Table 3
Figure BDA00003747041600083
Figure BDA00003747041600091
The program realization flow as shown in Figure 6.
4, send data, in Table 4
Table 4
The program realization flow is illustrated in fig. 7 shown below:
5, receive and wait for, in Table 5
Table 5
Figure BDA00003747041600093
Figure BDA00003747041600101
Program circuit as shown in Figure 8.
6, receive data, in Table 6
Table 6
Figure BDA00003747041600102
Program circuit as shown in Figure 9.
7, communication board self check, in Table 7
Table 7
Figure BDA00003747041600103
Program circuit as shown in figure 10.
8, Real-Time Monitoring, in Table 8
Table 8 Real-Time Monitoring
Figure BDA00003747041600111
The program realization flow as shown in figure 11.
2) encapsulation of power function interface
According to the power function interface to RS-422 communication function module working control operation exploitation, directly user oriented application program encapsulation, provide the driving interface function.By the exploitation RS-422 communication function driver of modules direct compilation to the VxWorks system kernel, the user, only need be according to the concrete operations that will complete when developing application, direct invoking performance function interface, do not need further encapsulation, thereby reduced the difficulty of Driver Development.
Under embodiment four, a kind of vxworks operating system, the driving method of cpci bus RS422 communication module, is characterized in that, it comprises:
System resource allocation step for initialization RS422 communication module;
For the step of power function interface is provided;
For the encapsulation of user oriented application program, the actuation step of driving function interface.
Under embodiment five, this embodiment and the described VxWork s of embodiment one operating system, the difference of the driving method of cpci bus RS422 communication module is,
Described system resource allocation step comprises:
For the step of acquisition based on each facility information of the RS422 communication module of cpci bus; This step comprises:
Vendor ID and Device ID according to each equipment of RS422 communication module, utilize function pciFindDevice () to carry out corresponding initialization function step to each equipment of RS422 communication module,
Each equipment Vendor ID, Device ID and serial number scanning bus according to the RS422 communication module, find out Bus number BUS No., device number Device No. and the function Func No. at each equipment place of RS422 communication module, according to Bus number BUS No., device number Device No. and function Func No., call again the step of pciConfigInLong () function and pciConfigInByte () function
Determine register base address and the interrupt number of each equipment, then by register base address and I/O mask bit phase with, obtain the step of internal register base address on final RS422 communication module plate;
For each equipment of RS422 communication module being carried out to the step of memory-mapped; This step comprises:
The step of distributing the memory headroom of PCI equipment with MMU,
Call function sysMmuMapAdd () is configured to memory headroom the step of MMU;
Step for each device interrupt link to the RS422 communication module; This step comprises:
Under the VxWorks system, use pciIntConnect () function that the c program function of the interrupt vector of each equipment appointment and appointment is coupled together, and the address of pciIntConnect () function be stored in to the step in the interrupt vector of this appointment,
When an interrupt occurs, call the c program function of appointment, the step of break in service.
Under embodiment six, this embodiment and the described VxWork s of embodiment one operating system, the difference of the driving method of cpci bus RS422 communication module is, describedly be used to the step that the power function interface is provided, comprises:
Provide and open initialization RS422 communication module plate STATUS ComInit function interface, and to this function interface load driver program, the step of the communication board of initialization given plate number;
Provide and open RS422 communication module plate STATUS ComOpen function interface, by this function interface, open a certain dedicated tunnel of the communication board of given plate number, the step that the parameter of the row of channels of going forward side by side arranges;
Provide and close RS422 communication module plate STATUS ComClose function interface, by this function interface, close the communication board of given plate number, unloading communication board driver, can not be to the step of the operation of RS422 communication module plate except opening;
Provide and send data STATUS ComSendData function interface, by this function interface, the a-road-through road of RS422 communication module plate appointment is write the step of data to be sent;
Provide and receive to wait for STATUS ComRecvWait function interface, by this function interface, the plate number of RS422 communication module plate is specified, and etc. a-road-through road to be specified receive the step of the data ready in buffer memory;
Provide and receive data int ComRecvData function interface, by this function interface, the plate number of RS422 communication module plate is specified, and the a-road-through road that reads appointment receives the step of the data in buffer memory;
Provide communication board self check STATUS ComTest function interface, the step of the RS422 communication module plate of given plate number being carried out to self check by this function interface;
Real-Time Monitoring STATUS ComRTWatch function interface is provided, by this function interface, the RS422 communication module plate of given plate number is carried out the step of Real-Time Monitoring in place.

Claims (6)

1. the driver of cpci bus RS422 communication module under a vxworks operating system, it is characterized in that: it comprises:
System resource allocation device for initialization RS422 communication module;
For the function interface device of power function interface is provided;
For the encapsulation of user oriented application program, the drive unit of driving function interface.
2. the driver of cpci bus RS422 communication module under a kind of vxworks operating system according to claim 1, is characterized in that,
Described system resource allocation device comprises:
For the device of acquisition based on each facility information of the RS422 communication module of cpci bus; This device comprises:
Vendor ID and Device ID according to each equipment of RS422 communication module, utilize function pciFindDevice () to carry out corresponding initialization functional unit to each equipment of RS422 communication module,
Each equipment Vendor ID, Device ID and serial number scanning bus according to the RS422 communication module, find out Bus number BUS No., device number Device No. and the function Func No. at each equipment place of RS422 communication module, according to Bus number BUS No., device number Device No. and function Func No., call again the device of pciConfigInLong () function and pciConfigInByte () function
Determine register base address and the interrupt number of each equipment, then by register base address and I/O mask bit phase with, obtain the device of internal register base address on final RS422 communication module plate;
For each equipment of RS422 communication module being carried out to the device of memory-mapped; This device comprises:
The device that distributes the memory headroom of PCI equipment with MMU,
Call function sysMmuMapAdd () is configured to memory headroom in the device of MMU;
Device for each device interrupt link to the RS422 communication module; This device comprises:
Under the VxWorks system, use pciIntConnect () function that the c program function of the interrupt vector of each equipment appointment and appointment is coupled together, and the address of pciIntConnect () function be stored in to the device in the interrupt vector of this appointment,
When an interrupt occurs, call the c program function of appointment, the device of break in service.
3. the driver of cpci bus RS422 communication module under vxworks operating system according to claim 2, is characterized in that, described function interface device comprises:
Provide initialization RS422 communication module plate STATUS ComInit function interface, and to this function interface load driver program, the device of the communication board of initialization given plate number;
Provide and open RS422 communication module plate STATUS ComOpen function interface, by this function interface, open a certain dedicated tunnel of the communication board of given plate number, the device that the parameter of the row of channels of going forward side by side arranges;
Provide and close RS422 communication module plate STATUS ComClose function interface, by this function interface, close the communication board of given plate number, unloading communication board driver, can not be to the device of the operation of RS422 communication module plate except opening;
Provide and send data STATUS ComSendData function interface, by this function interface, the a-road-through road of RS422 communication module plate appointment is write the device of data to be sent;
Provide and receive to wait for STATUS ComRecvWait function interface, by this function interface, the plate number of RS422 communication module plate is specified, and etc. a-road-through road to be specified receive the device of the data ready in buffer memory;
Provide and receive data int ComRecvData function interface, by this function interface, the plate number of RS422 communication module plate is specified, and the a-road-through road that reads appointment receives the device of the data in buffer memory;
Provide communication board self check STATUS ComTest function interface, the device that the RS422 communication module plate of given plate number is carried out to self check by this function interface;
Real-Time Monitoring STATUS ComRTWatch function interface is provided, by this function interface, the RS422 communication module plate of given plate number is carried out the device of Real-Time Monitoring in place.
4. the driving method of cpci bus RS422 communication module under a vxworks operating system, is characterized in that, it comprises:
System resource allocation step for initialization RS422 communication module;
For the step of power function interface is provided;
For the encapsulation of user oriented application program, the actuation step of driving function interface.
5. the driving method of cpci bus RS422 communication module under VxWork s operating system according to claim 4, is characterized in that,
Described system resource allocation step comprises:
For the step of acquisition based on each facility information of the RS422 communication module of cpci bus; This step comprises:
Vendor ID and Device ID according to each equipment of RS422 communication module, utilize function pciFindDevice () to carry out corresponding initialization function step to each equipment of RS422 communication module,
Each equipment Vendor ID, Device ID and serial number scanning bus according to the RS422 communication module, find out Bus number BUS No., device number Device No. and the function Func No. at each equipment place of RS422 communication module, according to Bus number BUS No., device number Device No. and function Func No., call again the step of pciConfigInLong () function and pciConfigInByte () function
Determine register base address and the interrupt number of each equipment, then by register base address and I/O mask bit phase with, obtain the step of internal register base address on final RS422 communication module plate;
For each equipment of RS422 communication module being carried out to the step of memory-mapped; This step comprises:
The step of distributing the memory headroom of PCI equipment with MMU,
Call function sysMmuMapAdd () is configured to memory headroom the step of MMU;
Step for each device interrupt link to the RS422 communication module; This step comprises:
Under the VxWorks system, use pciIntConnect () function that the c program function of the interrupt vector of each equipment appointment and appointment is coupled together, and the address of pciIntConnect () function be stored in to the step in the interrupt vector of this appointment,
When an interrupt occurs, call the c program function of appointment, the step of break in service.
6. the driving method of cpci bus CAN communication module under vxworks operating system according to claim 5, is characterized in that, describedly be used to the step that the power function interface is provided, comprises:
Provide and open initialization RS422 communication module plate STATUS ComInit function interface, and to this function interface load driver program, the step of the communication board of initialization given plate number;
Provide and open RS422 communication module plate STATUS ComOpen function interface, by this function interface, open a certain dedicated tunnel of the communication board of given plate number, the step that the parameter of the row of channels of going forward side by side arranges;
Provide and close RS422 communication module plate STATUS ComClose function interface, by this function interface, close the communication board of given plate number, unloading communication board driver, can not be to the step of the operation of RS422 communication module plate except opening;
Provide and send data STATUS ComSendData function interface, by this function interface, the a-road-through road of RS422 communication module plate appointment is write the step of data to be sent;
Provide and receive to wait for STATUS ComRecvWait function interface, by this function interface, the plate number of RS422 communication module plate is specified, and etc. a-road-through road to be specified receive the step of the data ready in buffer memory;
Provide and receive data int ComRecvData function interface, by this function interface, the plate number of RS422 communication module plate is specified, and the a-road-through road that reads appointment receives the step of the data in buffer memory;
Provide communication board self check STATUS ComTest function interface, the step of the RS422 communication module plate of given plate number being carried out to self check by this function interface;
Real-Time Monitoring STATUS ComRTWatch function interface is provided, by this function interface, the RS422 communication module plate of given plate number is carried out the step of Real-Time Monitoring in place.
CN201310389068.9A 2013-08-30 2013-08-30 The driver of cpci bus RS422 communication module and driving method under vxworks operating system Active CN103412841B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310389068.9A CN103412841B (en) 2013-08-30 2013-08-30 The driver of cpci bus RS422 communication module and driving method under vxworks operating system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310389068.9A CN103412841B (en) 2013-08-30 2013-08-30 The driver of cpci bus RS422 communication module and driving method under vxworks operating system

Publications (2)

Publication Number Publication Date
CN103412841A true CN103412841A (en) 2013-11-27
CN103412841B CN103412841B (en) 2016-04-27

Family

ID=49605854

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310389068.9A Active CN103412841B (en) 2013-08-30 2013-08-30 The driver of cpci bus RS422 communication module and driving method under vxworks operating system

Country Status (1)

Country Link
CN (1) CN103412841B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103677856A (en) * 2014-01-07 2014-03-26 哈尔滨工业大学 Method for designing CPCI bus switching-value output function unit driving program under the VxWorks operating system
CN103761199A (en) * 2014-01-03 2014-04-30 哈尔滨工业大学 CPCI bus digital-analog input module hardware architecture under VxWorks and CPCI bus digital-analog input timing-configurable driving method under VxWorks
CN104965700A (en) * 2015-06-09 2015-10-07 航天科工深圳(集团)有限公司 Method and system for implementing driving on SPI equipment under VxWorks operating system
CN106371847A (en) * 2016-09-07 2017-02-01 湖北三江航天万峰科技发展有限公司 Method and system for driving RS422 communication of CPCI (Compact Peripheral Component Interconnect) bus in Windows xp system
CN107346296A (en) * 2016-05-05 2017-11-14 研祥智能科技股份有限公司 A kind of driving method and device
CN108628784A (en) * 2018-04-28 2018-10-09 湖南大学 Serial communicator and serial communication system
CN109766308A (en) * 2019-01-15 2019-05-17 湖南泽天智航电子技术有限公司 A kind of multichannel onewire communication system based on localbus bus
CN111737180A (en) * 2020-06-08 2020-10-02 湖北三江航天万峰科技发展有限公司 Serial port driving system based on PCI bus

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107783921B (en) * 2016-08-29 2019-04-19 江苏金陵智造研究院有限公司 Highly reliable and low-cost multichannel RS-422 telecommunication circuit

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102999381A (en) * 2011-09-09 2013-03-27 中国航天科工集团第三研究院第八三五七研究所 Compact peripheral component interconnect (CPCI) device interrupt multiplexing method for improving realtime performance of VxWorks

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102999381A (en) * 2011-09-09 2013-03-27 中国航天科工集团第三研究院第八三五七研究所 Compact peripheral component interconnect (CPCI) device interrupt multiplexing method for improving realtime performance of VxWorks

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103761199A (en) * 2014-01-03 2014-04-30 哈尔滨工业大学 CPCI bus digital-analog input module hardware architecture under VxWorks and CPCI bus digital-analog input timing-configurable driving method under VxWorks
CN103677856A (en) * 2014-01-07 2014-03-26 哈尔滨工业大学 Method for designing CPCI bus switching-value output function unit driving program under the VxWorks operating system
CN104965700A (en) * 2015-06-09 2015-10-07 航天科工深圳(集团)有限公司 Method and system for implementing driving on SPI equipment under VxWorks operating system
CN104965700B (en) * 2015-06-09 2018-07-03 航天科工深圳(集团)有限公司 The method and system of driving SPI equipment is realized under vxworks operating system
CN107346296A (en) * 2016-05-05 2017-11-14 研祥智能科技股份有限公司 A kind of driving method and device
CN107346296B (en) * 2016-05-05 2022-01-18 研祥智能科技股份有限公司 Driving method and device
CN106371847A (en) * 2016-09-07 2017-02-01 湖北三江航天万峰科技发展有限公司 Method and system for driving RS422 communication of CPCI (Compact Peripheral Component Interconnect) bus in Windows xp system
CN108628784A (en) * 2018-04-28 2018-10-09 湖南大学 Serial communicator and serial communication system
CN109766308A (en) * 2019-01-15 2019-05-17 湖南泽天智航电子技术有限公司 A kind of multichannel onewire communication system based on localbus bus
CN111737180A (en) * 2020-06-08 2020-10-02 湖北三江航天万峰科技发展有限公司 Serial port driving system based on PCI bus

Also Published As

Publication number Publication date
CN103412841B (en) 2016-04-27

Similar Documents

Publication Publication Date Title
CN103412841B (en) The driver of cpci bus RS422 communication module and driving method under vxworks operating system
CN103309830A (en) Driver of CPCI bus CAN communicating module under VxWorks operating system and driving method
US7835897B2 (en) Apparatus and method for connecting hardware to a circuit simulation
KR101035832B1 (en) Simulation circuit of pci express endpoint and downstream port for a pci express switch
CN106648896B (en) Method for dual-core sharing of output peripheral by Zynq chip under heterogeneous-name multiprocessing mode
CN103282881A (en) Direct sharing of smart devices through virtualization
CN105681145A (en) FPGA-based FlexRay communication module
CN103399830B (en) The Apparatus and method for of computer physics internal memory is read by PCI Express bus
CN110968352B (en) Reset system and server system of PCIE equipment
CN114818599A (en) Chip simulation verification system
CN103677855A (en) Design method for driver of CPCI (Compact Peripheral Component Interconnect) bus DAC (digital-to-analog conversion) function unit under VxWorks operating system
EP2639703A1 (en) Device for booting soc chip and soc chip
CN103412833A (en) CPCI (Compact Peripheral Component Interconnect) bus scanning ADC (Analog-to-Digital Converter) function module driver under VxWorks operating system and control method thereof
CN102104508A (en) M module low-level (LL) driver layer realization method for M module-based local area network (LAN)-based extensions for instrumentation (LXI) equipment
CN1333333C (en) Code flow broadcast card and driving method of code flow collection card
CN117278890A (en) Optical module access method, device and system, electronic equipment and readable storage medium
CN101739284B (en) Computer and information processing method
CN108153624B (en) Test circuit board suitable for NGFF slot
CN103713908A (en) Method for designing digital quantity input functional unit driving program of CPCI (compact peripheral component interface) bus under VxWorks operating system
CN102176589A (en) Concentrator for universal serial bus (USB)-8 serial port RS422
CN103412840B (en) Cpci bus GPS time service positioning function device and driving method thereof and driving means under vxworks operating system
CN203838541U (en) FPGA apparatus, embedded control system and medical equipment control system
CN200941208Y (en) Device to operate USB interface
CN109783407B (en) Device and method for realizing PC and display card bridging based on FPGA
CN102194403A (en) Microblaze soft core technology-based LED (Light Emitting Diode) large-screen asynchronous control system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant