Method for driving MIO device under VxWorks operating system

By customizing the MIO device description file and driver registration function under the VxWorks operating system, online switching of MIO interface states was achieved, solving the problems of complex and error-prone switching in existing technologies and improving operational efficiency and accuracy.

CN116166328BActive Publication Date: 2025-12-23SUZHOU CHANGFENG AVIATION ELECTRONICS
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211701560.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-28
Publication Date
2025-12-23
Estimated Expiration
2042-12-28

AI Technical Summary

Technical Problem

In existing technologies, the MIO interface cannot efficiently switch functions under the VxWorks operating system, resulting in complex operation and a high risk of errors.

Method used

Under the VxWorks operating system, by customizing the MIO device description file and driver registration function prototype, writing compilation rules, registering and initializing the MIO device driver, and using the Ioctl function to change the interface state in real time, the online switching of the interface is realized.

Benefits of technology

It improves the efficiency and accuracy of MIO interface state switching, simplifies the operation process, and reduces the probability of errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116166328B_ABST
    Figure CN116166328B_ABST
Patent Text Reader

Abstract

The application provides a method for driving MIO equipment under VxWorks operating system, and belongs to the technical field of airborne display, and specifically comprises the following steps: obtaining a self-defined MIO equipment component description file and an MIO driving registration function prototype from an MIO equipment driving layer; registering the MIO equipment driving in a kernel layer according to a compiling rule, initializing the MIO equipment driving, and configuring MIO equipment resources; changing a current interface state in real time on an application layer, and reinitializing the changed interface in the kernel layer; confirming the current interface state by an Ioctl function in the MIO equipment driving layer, and initializing corresponding equipment of the current interface; and communicating with the outside through the corresponding interface after the initialization of the interface corresponding equipment is completed. Through the processing scheme, the interface state of the current MIO can be changed on line, and the efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of on-board display, in particular to a method for driving MIO device under VxWorks operating system. BACKGROUND

[0002] Feiteng X100 is a main CPU supporting chip, which mainly functions to realize GPU system and PCIE, USB, SATA and other high-speed interface expansion, and meanwhile realize power-on and power-off control of the whole system.

[0003] Feiteng 2000 / 4 platform is a high-performance general-purpose 4-core processor for desktop application. Each 2 cores constitute a processor core cluster (Cluster), and share L2 Cache. The processor core is connected with storage system and I / O system through on-chip high-speed interconnection network and related controller. The storage system includes Cache subsystem and DDR, and the I / O system includes PCIE, high-speed I / O subsystem, gigabit Ethernet GMAC and low-speed I / O system.

[0004] VxWorks is an embedded real-time operating system developed by the United States Wind River Company, which has high performance, high degree of tailoring and other characteristics, and can support various microprocessors such as PowerPC, X86, ARM, MIPS, etc. It can be widely applied in communication, military, aviation, aerospace and other high-precision technologies and fields with extremely high real-time requirements due to its good reliability and excellent real-time performance.

[0005] The MIO interface is named as MULTUSE IO in English, which is a multi-functional interface IO. It has three functions of I2C, PWM and UART through only two GPIO ports. And the three controllers have the same configuration space. Because the three have the same configuration space, they cannot be initialized at the same time, which leads to that every time another function needs to be used, the program must be modified and the system must be re-burned. The five operations are complex and inefficient, and prone to errors.

[0006] In view of this, the present application provides a method for driving MIO device under VxWorks operating system, which solves the problems in the prior art and can change the interface state of the current MIO online, improving the efficiency. SUMMARY

[0007] In view of this, the present application provides a method for driving MIO device under VxWorks operating system, which solves the problems in the prior art and can change the interface state of the current MIO online, improving the efficiency.

[0008] The method for driving MIO device under VxWorks operating system provided by the present application adopts the following technical scheme:

[0009] A method for driving MIO device under VxWorks operating system, characterized in that it comprises:

[0010] Step 1, obtaining self-defined MIO device component description file and MIO driver registration function prototype from MIO device driver layer;

[0011] Step 2, forming compiling rule of MIO driver according to self-defined MIO device component description file and MIO driver registration function prototype;

[0012] Step 3, registering MIO device driver to I / O subsystem of kernel layer through interface function iosDrvInstall and iOSDevAdd provided by kernel layer according to compiling rule, and initializing MIO device driver and configuring MIO device resource.

[0013] Step 4, changing current interface state in real time by application layer, and re-initializing device by kernel layer according to changed interface;

[0014] Step 5, confirming current interface state by MIO device driver layer through Ioctl function, and initializing corresponding device of current interface;

[0015] Step 6, communicating with outside through corresponding interface after initialization of interface corresponding device is completed.

[0016] Optionally, MIO device driver layer comprises MIO device and MIO driver unit;

[0017] User-defined MIO device component description file and MIO driver registration function prototype are arranged in MIO driver unit;

[0018] MIO driver registration function prototype comprises MIO driver initialization function and MIO driver service function;

[0019] MIO driver initialization function comprises setting MIO global control register base address, reading MIO version number and reading current MIO function state.

[0020] Optionally, compiling rule is stored in MIO driver unit in the form of Makefile file.

[0021] Optionally, MIO driver registration function code is written according to compiling rule and stored in MIO driver unit.

[0022] Optionally, in the step 5, the Ioctl function is set as follows: judging the parameter for reading, if the parameter is 0x0, the current MIO function is controlled to be I2C, after reading the MIO function state to confirm the I2C function, the initialization of the I2C device is performed; if the parameter is 1, the current MIO function is controlled to be UART, after reading the MIO function state to confirm the UART function, the initialization of the UART device is performed; if the parameter is 2, the current MIO function is controlled to be PWM, after reading the MIO function state to confirm the PWM function, the initialization of the PWM device is performed.

[0023] Optionally, in the step 4, the ioctl function or input command is set on the application layer to change the interface state of the current MIO online.

[0024] In summary, the present application includes the following beneficial technical effects:

[0025] The present application establishes a custom MIO device description file under VxWorks, then writes the compilation rule of the MIO driver, registers the MIO driver and initializes the MIO driver, then designs the Ioctl function in the MIO driver, finally the current state of the MIO interface can be controlled by the ioctl function on the application layer, so as to achieve the purpose of real-time switching of the interface. BRIEF DESCRIPTION OF DRAWINGS

[0026] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor on the basis of these drawings.

[0027] Figure 1 The flow chart of the MIO driver device implementation method under Vxworks of the present application is shown in the figure.

[0028] Figure 2 The specific design flow chart of the MIO driver device under VxWorks of the present application is shown in the figure. DETAILED DESCRIPTION

[0029] The embodiments of the present application will be described in detail below with reference to the drawings.

[0030] Following make specific reference, which set forth a brief description of embodiments of the application. Those of ordinary skill in the art will appreciate that the embodiments described below are illustrative of the application and are not meant to limit the scope of the application as set forth in the claims. Furthermore, the connection is only a partial connection, and not all embodiments of the connection. The application can also be implemented or applied in other different specific embodiments, the details of the application in various aspects can be based on different points of view and applications, without departing from the spirit of the application to make various modifications or changes. Note that the following examples and features in the examples can be combined with each other without conflict. Based on the embodiments of the application, all other embodiments obtained by those of ordinary skill in the art without creative labor are within the scope of the application.

[0031] It is to be understood that the following description describes various aspects of embodiments within the scope of the appended claims. It will be apparent to one of ordinary skill in the art that aspects described herein can be implemented differently, and any particular structure and / or function described herein is merely illustrative. Based on the present application, those skilled in the art should understand that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, an apparatus and / or a method can be implemented using any number of the aspects set forth herein. In addition, this apparatus and / or method can be implemented using other structures and / or functionality in addition to or instead of one or more of the aspects set forth herein.

[0032] It should also be noted that the drawings provided in the following embodiments are only schematically illustrate the basic idea of the application, and only show the components related to the application in the drawings, not according to the number, shape and size of the components when actually implemented, the actual implementation of each component type, quantity and proportion can be a kind of arbitrary change, and its component layout type may be more complex.

[0033] In addition, in the following description, specific details are provided in order to facilitate a thorough understanding of the examples. However, those skilled in the art will understand that the aspects described can be practiced without these specific details.

[0034] The embodiment of the application provides a method for driving MIO device under VxWorks operating system.

[0035] As shown in Figure 1 and Figure 2 A method for driving MIO device under VxWorks operating system, comprising:

[0036] Step 1, obtaining self-defined MIO device component description file and MIO driver registration function prototype from MIO device driver layer; MIO device driver layer includes MIO device and MIO driver unit; in the MIO driver unit, there are user-defined MIO device component description file and MIO driver registration function prototype; MIO driver registration function prototype includes MIO driver initialization function (such as xxxDrv, xxxDevCreate) and MIO driver service function (such as xxxOpen, xxxRead, xxxWrite, etc.); MIO driver initialization function includes setting MIO global control register base address, reading MIO version number, and reading current MIO function status.

[0037] Step 2, forming MIO driver compilation rule according to self-defined MIO device component description file and MIO driver registration function prototype; the compilation rule is stored in the MIO driver unit in the form of Makefile file.

[0038] Step 3, writing MIO driver registration function code according to the compilation rule and storing it in the MIO driver unit, and registering MIO device driver to the kernel layer I / O subsystem according to the compilation rule, providing interface function iosDrvInstall and iOSDevAdd in the kernel layer (IOSLib) to initialize MIO device driver and configure MIO device resources.

[0039] Step 4, the application layer changes the current interface state in real time online, and the kernel layer reinitializes the device according to the changed interface. The application layer changes the current MIO interface state online by setting ioctl function or input command in the application program.

[0040] Step 5, MIO device driver layer confirms the current interface state through ioctl function and initializes the corresponding device of the current interface.

[0041] Specifically, ioctl function is set as follows: judging the parameters: if the parameter is 0x0, controlling the current MIO function as I2C, reading the MIO function state to confirm I2C function, and then initializing I2C device; if the parameter is 1, controlling the current MIO function as UART, reading the MIO function state to confirm UART function, and then initializing UART device; if the parameter is 2, controlling the current MIO function as PWM, reading the current MIO function as PWM, and then initializing PWM device.

[0042] Step 6, after the initialization of the interface corresponding device is completed, the corresponding interface (one of I2C, UART, PWM) communicates with the outside world.

[0043] The application establishes a self-defined MIO device description file under VxWorks, then writes a compiling rule of MIO driver, registers and initializes the MIO driver, designs an Ioctl function in the MIO driver, and finally controls the current state of the MIO interface by the ioctl function in the application layer, so as to achieve the purpose of real-time switching of the interface.

[0044] The above merely describes the specific embodiments of the present application, but the protection scope of the present application is not limited to this. Any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A method for driving MIO devices under the VxWorks operating system, characterized in that, include: Step 1: Obtain the custom MIO device component description file and MIO driver registration function prototype from the MIO device driver layer; Step 2: Based on the custom MIO device component description file and the MIO driver registration function prototype, formulate the compilation rules for the MIO driver; Step 3: According to the compilation rules, register the MIO device driver with the kernel layer's I / O subsystem using the kernel layer's interface functions iosDrvInstall and iOSDevAdd, and perform MIO device initialization. The MIO device initialization includes initializing the MIO device driver and configuring MIO device resources. Step 4: The application layer changes the current interface state online in real time, and the kernel layer re-initializes the MIO device for the changed interface. Step 5: The MIO device driver layer confirms the current interface status through the Ioctl function and initializes the corresponding device for the current interface. It then determines the following based on the read parameters: If the parameter is 0x0, the current MIO function is controlled as I2C; after confirming the MIO function status as I2C, the I2C device is initialized. If the parameter is 1, the current MIO function is controlled as UART; after confirming the MIO function status as UART, the UART device is initialized. If the parameter is 2, the current MIO function is controlled as PWM; after confirming the current MIO function as PWM, the PWM device is initialized. Step 6: After the device corresponding to the interface is initialized, it communicates with the outside world through the corresponding interface.

2. The method for driving MIO devices under the VxWorks operating system according to claim 1, characterized in that, The MIO device driver layer includes MIO devices and MIO driver units; The MIO driver unit contains user-defined MIO device component description files and MIO driver registration function prototypes. The prototype of the MIO driver registration function includes the MIO driver initialization function and the MIO driver service function. The MIO driver initialization function includes setting the base address of the MIO global control register, reading the MIO version number, and reading the current MIO functional status.

3. The method for driving MIO devices under the VxWorks operating system according to claim 2, characterized in that, The compilation rules are stored in the MIO driver unit as a Makefile.

4. The method for driving MIO devices under the VxWorks operating system according to claim 3, characterized in that, Write the MIO driver registration function code according to the compilation rules and store it in the MIO driver unit.

5. The method for driving MIO devices under the VxWorks operating system according to claim 1, characterized in that, In step 4, the application layer changes the current MIO interface state online by setting the Ioctl function or entering commands in the application.

Citation Information

Patent Citations

  • Method and system for implementing driving on SPI equipment under VxWorks operating system

    CN104965700A

  • Device driver calling method, device and system

    CN114237725A