CN106528153A - Embedded software modular construction method and device - Google Patents

Embedded software modular construction method and device Download PDF

Info

Publication number
CN106528153A
CN106528153A CN201610987977.6A CN201610987977A CN106528153A CN 106528153 A CN106528153 A CN 106528153A CN 201610987977 A CN201610987977 A CN 201610987977A CN 106528153 A CN106528153 A CN 106528153A
Authority
CN
China
Prior art keywords
function
equipment
management module
software
output
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.)
Pending
Application number
CN201610987977.6A
Other languages
Chinese (zh)
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.)
CHENGDU ZHONGQIAN AUTOMATION ENGINEERING Co Ltd
Original Assignee
CHENGDU ZHONGQIAN AUTOMATION ENGINEERING Co Ltd
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 CHENGDU ZHONGQIAN AUTOMATION ENGINEERING Co Ltd filed Critical CHENGDU ZHONGQIAN AUTOMATION ENGINEERING Co Ltd
Priority to CN201610987977.6A priority Critical patent/CN106528153A/en
Publication of CN106528153A publication Critical patent/CN106528153A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/76Adapting program code to run in a different environment; Porting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code

Abstract

The invention discloses an embedded software modular construction method and device. The method comprises the following steps of: constructing a middle layer between an embedded operating system of an embedded system and a user application program; constructing a software database having multiple storage spaces in the middle layer; performing functional classification on software in the embedded system; constructing a source code for each type of software, and storing a management module composed of the source codes in the corresponding storage space; according to user requirements, calling the software source codes in the corresponding storage spaces; and outputting the software source codes to corresponding hardware equipment. By means of the embedded software modular construction method and device disclosed by the invention, the middle layer is constructed between the embedded operating system and the user application program; and thus, a software module having relatively high universality in the embedded system is provided for users.

Description

A kind of construction method and device of plug in software module
Technical field
The invention belongs to embedded computer technology field, more particularly to a kind of structure side of plug in software module Method and device.
Background technology
Because there is larger difference in various Embedded Application targets so that embedded hardware and operating system also each not phase Together, even if the application program of exploitation said function, it is also desirable to for being programmed on specific embedded platform;User is caused to exist Require a great deal of time in the exploitation of application software and energy, and the application software for developing can't be transplanted to which His Embedded Hardware Platform;Therefore, the code of embedded application software does not possess reusability, and this is that embedded development faces Maximum bottleneck.
Embedded system is primarily present following some problem at present:
1. the maximum feature of embedded system is exactly otherness, is applied to the embedded product and equipment of different occasions, nothing By being from form or functionally, to be all very different.
2., in the development process of routine, user arranges needs and proceeds by Software for Design and written in code, from actual feelings From the point of view of condition, due to the changes in demand that vary and may occur at any time of demand, personal code work there is no reusability, this If just meaning demand occurs certain change, whole code all can may be write again, and this not only delays opening for user The progress of sending out, and the robustness and reliability of code are have impact on, it is that the functional realiey of user equipment brings huge risk.
3. the exploitation of built-in system software is closely related with the device driver of bottom.User will realize setting hardware Standby operation just must be completed by device driver, be all directly to carry out device drives by user program in conventional exploitation Program is called, and this mode requires that the developer of application program needs the driving journey of the hardware design to bottom and the equipment Sequence has enough understandings;In addition, when the access of device driver is carried out, the software interface that driver is provided is not general Property, user is very inconvenient in application call.
4. device driver can be defined as a good inside programming interface, and the work of complete concealing device is thin Section, the operation of user be by one group it is standardized call performing, these are called to be mapped to and are acted on by device driver In the peculiar operation of equipment of actual hardware.This is one and seems perfect invoked procedure, but actually due to the thousand of hardware device Differ from ten thousand other and distinct program person programmings to be accustomed to, for same equipment, the driver that different programmers writes out can Can different style, there is provided operate interface may be not quite similar.This does not obviously have versatility for user operation, when with When the application program that family is write needs call driver function, user must also consider to use which function performance, pass Which parameter is passed, the detailed problems such as return value whether are needed, it is clear that the development rate and versatility of software code is have impact on.
The content of the invention
In order to solve the above problems, the present invention proposes a kind of construction method and device of plug in software module, Between embedded OS and user application build an intermediate layer, provide the user in embedded systems with compared with The software module of strong versatility, makes exploitation and the simpler convenience of operating process.
To reach above-mentioned purpose, the technical solution used in the present invention is:
A kind of construction method of plug in software module, including step:
A middle layer software module is built between the embedded OS and user application of embedded system;
The software database with multiple memory spaces is built in the software module;
The software of embedded system is carried out into functional category;
Software building code to each class, and the management module that code is constituted is stored in corresponding memory space;
Software code in respective stored space is called according to user's request;
Output software code is to corresponding hardware device.
It is further that the management module includes separate industrial bus communication management module, network service pipe Reason module, simulation I/O device management module, digital I/O device management module, LED device management module, buzzer equipment control mould Block, date and time management module, house dog device management module, PWM device management modules and high-resolution timer equipment pipe Reason module.
The function that these software modules are commonly used in covering substantially embedded design exploitation, provides the user the exploitation of standard Interface, is that user develops the means provided convenience, and user can concentrate one's energy to carry out setting for system overall logic function Count and be not entangled with the realization of individual module function.
It is further that the industrial bus communication management module encapsulation meets the operation of serial-port letter of serial communication function Number;For the serial communication of embedded system;
It is described to call operation of serial-port function to include:Serial ports handling function is opened and initializes, this function is opened and initialized Serial port function;Read data function from serial ports;To serial ports write data function;Serial ports closes function.
User only need to correctly call the function in storehouse, you can realize general Embedded Serial Communication, without being concerned about string The concrete operating principle and mode of operation of mouth;So as to greatly save development time and reduction development difficulty based on serial ports.
Further that the network service management module includes TCP dynamic bases and UDP dynamic bases, be respectively directed to towards Connection and disconnected network service demand;For the network service of embedded system;
The TCP dynamic bases include:Client computer contiguous function:Connection is sent to server for client computer;Send data Function:For sending data to TCP sockets;Receiving data function:For from TCP socket receiving datas;Server is set For listening mode function:For server end is set to listening mode;Server receives connection request function:Wait from server Client connection request is taken out in queue;Close socket function;
The UDP dynamic bases include:Set up Datagram Socket function;Set up server side socket function:Initialization Server socket structure address, binding server port numbers;Initialization server address structure function:Send to server end Data;Initialization server address structure function:From server receiving data;Close socket function;Subsidiary system function Ⅰ:For sending data;Subsidiary system function II:For receiving data.
This dynamic base is not to be packaged the system function used in all of TCP/UDP protocol communications, but is Raising programming efficiency, some are loaded down with trivial details such as to socket addresses structure initialization and associated transceiving data etc Problem encapsulated.
It is further that the simulation I/O device management module includes meeting the input/output function letter of simulation I/O device Number;Including ADC device input/output function function and DAC equipment input/output function functions;For the simulation of embedded system I/O device is managed;
The ADC device input/output function function includes:Equipment opens function;Equipment closes function;ADC device is configured Function;Obtain ADC device and be currently configured function;Read ADC device sampled value;Conversion sampling value function;
The DAC equipment input/output function function includes:Equipment opens function;Equipment closes function;Number is exported to DAC According to function.
User only need to correctly call the function in storehouse, you can that realizes general embedded system simulates beating for I/O device Open and close are closed and basic input/output function, the concrete operating principle and mode of operation without being concerned about the simulation I/O device, section The development time of simulation I/O device management has been saved, development difficulty has been reduced.
It is further that the digital I/O device management module includes the input/output function letter for meeting digital I/O device Number;Input/output function function and external connection keyboard equipment input/output function function including simple digital I/O device;For embedding The digital I/O device management of embedded system;
The input/output function function of the simple digital I/O device includes:Equipment opens function;Equipment closes function;Clearly Buffer empty function;Read simple digital I/O value function;Simple digital I/O value function is put, this function is provided and arranges Contemporary Digital IO Device value function;
The external connection keyboard equipment input/output function function includes:Equipment opens function;Equipment closes function;Empty slow Rush area's function;Read keyboard value function.
User only need to correctly call the function in storehouse, you can realize that the digital I/O device of general embedded system is beaten Open and close are closed and basic input/output function, the concrete operating principle and mode of operation without being concerned about the digital I/O device, section The development time of digital I/O device management has been saved, development difficulty has been reduced.
It is further that the LED device management module includes the output function function for meeting LED device;For being embedded in The LED device management of formula system;
The output function function of the LED device includes:Equipment opens function;Equipment closes function;Emptying buffer letter Number;Put LED device and show value function;
User only need to correctly call the function in storehouse, you can realize that the LED device of general embedded system plays open and close Close and basic display output function, the concrete operating principle and mode of operation without being concerned about the LED device saves LED The development time of equipment control, reduce development difficulty.
The buzzer device management module includes the output function function for meeting buzzer equipment;For embedded system Buzzer kind equipment management;
The output function function of the buzzer equipment includes:Equipment opens function;Equipment closes function;Put buzzer to set Standby value function.
User only need to correctly call the function in storehouse, you can realize that the buzzer equipment of general embedded system is beaten Open and close are closed and basic buzzer function, the concrete operating principle and mode of operation without being concerned about the buzzer equipment, are saved The development time of buzzer equipment control, reduce development difficulty.
It is further that the date and time management module include meeting the basic reading on date and time and arrange work( Can function;The management on date and time module for embedded system;
The basic reading of the date and time and setting power function include:Read date and the function of time;Read day Phase function;Read access time function;Date and the function of time are set;Date function is set;The function of time is set.
User only need to correctly call the function in storehouse, you can realize date and the reading of time of general embedded system The functions such as setting, the concrete operating principle and mode of operation without being concerned about the date and time module save the date timely Between management function development time, reduce development difficulty.
The house dog device management module meets the input/output function function of house dog equipment;
The input/output function function of the house dog equipment includes:Equipment opens function;Equipment closes function;Enable is seen Door dog equipment function;Disabling house dog equipment function;Dog feeding operation function.
User only need to correctly call the function in storehouse, you can realize that the house dog equipment of general embedded system is beaten Open and close are closed and the function such as operate with basic enable, the concrete operating principle and mode of operation without being concerned about the house dog equipment, The development time of house dog equipment control is saved, development difficulty is reduced.
It is further that the PWM device management modules include the basic function letter for meeting pwm pulse width modulated needs Number;For the PWM equipment controles of embedded system;
The basic function function that the pwm pulse width modulated needs includes:Equipment opens function;Equipment closes function; PWM device configuration functions;Obtain PWM equipment and be currently configured function.
User only need to correctly call the function in storehouse, you can realize that the PWM equipment of general embedded system plays open and close Close and basic input/output function, the concrete operating principle and mode of operation without being concerned about the PWM equipment saves PWM The development time of equipment control, reduce development difficulty.
The high-resolution timer device management module includes the basic function function for meeting high-resolution timer needs;With In the high-resolution timer equipment control of embedded system;
The basic function function that the high-resolution timer needs includes creating high-resolution timer function;Delete timer Function;High accuracy delay function.
User only need to correctly call the function in storehouse, you can realize the base of the high-resolution timer of general embedded system This function, the concrete operating principle and mode of operation without being concerned about the high-resolution timer save high precision apparatus management Development time, reduce development difficulty.
On the other hand, present invention also offers a kind of construction device of plug in software module, including processor, storage Device, debugging interface and calling interface, connect memory, debugging interface and calling interface respectively on the processor;
The processor, for transferring corresponding management module in memory, and manages whole device operation;
The debugging interface, for developer to memory typing more fresh code;
The memory, for storing software database;
The calling interface, the outside industrial computer processor of connection, calls required management module in a device for industrial computer.
Using the beneficial effect of the technical program:
The construction device of plug in software module defines the modularization intermediate layer of embedded system, in system bottom reality The basic function that most of users can use is showed, the UDI with particular hardware platform, is carried for user upwards downwards For unified DLL, when user carries out system development, only spy need to be capable of achieving by standard interface calling module function Determine function.The otherness of different hardware platforms is unified for user, so as to realize the quick exploitation of embedded system.In addition, mould The mode of block also brings facility for the later maintenance upgrading of system, and the adjustment of systemic-function can not change user's application Function in the case of program in update module.
1., by being concluded to Embedded Application and being classified, the general character of different field built-in applied system is taken out, Main flow embedded microprocessor is covered in exploitation and the embedded system hardwares of the most applications of embedded OS, satisfaction are put down Platform.Method proposed by the present invention disclosure satisfy that the embedded hardware system development platform of most application demands, to accelerating to use Family product development, shortens time to market (TTM), and dominate the market first chance, significant.
2. the present invention is independent by the basic application of most of embedded systems and common expanded application are designed to Software module, and the general character of foundation system application realizes the function of module.These software modules cover embedded design substantially The function of commonly using in exploitation, provides the user the development interface of standard, is that user develops the means provided convenience, user Can concentrate one's energy to carry out the design of system overall logic function and be not entangled with the realization of individual module function.And can be real System requirements change now, and user adjusts the systemic-function of oneself only by adjusting the method for calling to software module, Allow user to write again code as few as possible, improve the development progress of embedded system, and ensure that user can To be rapidly completed system development.
3. software modularity can also be masked the details of realizing of driver by the present invention, and user only needs to write application The unified modularity function interface of routine access, and the purpose for accessing hardware is reached by the good software module of predefined, make out The process of sending out is more convenient.
4. specification of the present invention defines the interface between device driver and functions of modules function, either embedded at that On hardware platform, we are directed to the peculiar operation of equipment and follow intrinsic agreement in requiring device driver, and definition is unified to be returned Return variable;The power function of software module also realizes standardized calling according to agreement.Therefore, when user program calls software mould During function performance in block, the type of device hardware platform can be indifferent to, that is indifferent to driver writes details, it is only necessary to Complete the funcall to software module and can just realize the operating process to physical device, so application program for user is opened The otherness for shielding first floor system is sent out, the cross-platform function of application programming is realized, is accomplished once writing everywhere for program It is available, the development efficiency of the software systems of raising, and saved the development time.
Description of the drawings
Fig. 1 is a kind of layer of structure figure of the construction method of plug in software module of the present invention;
Fig. 2 is a kind of construction method and installation method schematic flow sheet of plug in software module of the present invention;;
Fig. 3 is a kind of construction device structural representation of plug in software module of the present invention.
Specific embodiment
In order that the object, technical solutions and advantages of the present invention are clearer, below in conjunction with the accompanying drawings the present invention is made into one Step is illustrated.
In embodiment one, referring to shown in Fig. 1 and Fig. 2, the present invention proposes a kind of structure of plug in software module Method, including step:
A middle layer software module is built between the embedded OS and user application of embedded system;
The software database with multiple memory spaces is built in the software module;
The software of embedded system is carried out into functional category;
Software building code to each class, and the management module that code is constituted is stored in corresponding memory space;
Software code in respective stored space is called according to user's request;
Output software code is to corresponding hardware device.
In embodiment two, on the basis of embodiment one, the management module includes that separate industrial bus lead to Letter management module, network service management module, simulation I/O device management module, digital I/O device management module, LED device management Module, buzzer device management module, date and time management module, house dog device management module, PWM device management modules With high-resolution timer device management module.
The function that these software modules are commonly used in covering substantially embedded design exploitation, provides the user the exploitation of standard Interface, is that user develops the means provided convenience, and user can concentrate one's energy to carry out setting for system overall logic function Count and be not entangled with the realization of individual module function.
Used as the prioritization scheme of above-described embodiment, the industrial bus communication management module encapsulation meets serial communication function Operation of serial-port function;For the serial communication of embedded system;
It is described to call operation of serial-port function to include:Serial ports handling function is opened and initializes, this function is opened and initialized Serial port function;Read data function from serial ports;To serial ports write data function;Serial ports closes function.
When being embodied as:
1) open and initialize serial ports function:int OpenCom(char*dev,char*configs,int mode);
2) read data function from serial ports:ReadCom(int fd,char*buffer,unsigned int len, unsigned long timesout);
3) to serial ports write data function:WriteCom(int fd,char*buffer,unsigned int len, unsigned long timesout);
4) serial ports closes function:int CloseCom(int fd).
Used as the prioritization scheme of above-described embodiment, the network service management module includes that TCP dynamic bases and UDP are dynamic Storehouse, is respectively directed to towards connection and disconnected network service demand;For the network service of embedded system;
The TCP dynamic bases include:Client computer contiguous function:Connection is sent to server for client computer;Send data Function:For sending data to TCP sockets;Receiving data function:For from TCP socket receiving datas;Server is set For listening mode function:For server end is set to listening mode;Server receives connection request function:Wait from server Client connection request is taken out in queue;Close socket function;
When being embodied as:
1) client computer contiguous function:int ConnectServce(char*addr);
2) send data function:int SendData(int fd,const void*buf,int len,int mode);
3) receiving data function:intRecvData(int fd,void*buf,int len,int mode);
4) it is listening mode function to arrange server:int SetServce(int queulen,int port);
5) server receives connection request function:int GetRequest(int fd,struct sockaddr_in client);
6) close socket function:int CloseSock(int fd).
The UDP dynamic bases include:Set up Datagram Socket function;Set up server side socket function:Initialization Server socket structure address, binding server port numbers;Initialization server address structure function:Send to server end Data;Initialization server address structure function:From server receiving data;Close socket function;Subsidiary system function Ⅰ:For sending data;Subsidiary system function II:For receiving data.
When being embodied as:
1) set up Datagram Socket function:Socket();
2) set up server side socket function:SetServce(int port);
3) initialize server address structure function:SendSer(char*addr,int sockfd,const void* buf,int len,int mode);
4) initialize server address structure function:RecvSer(char*addr,int sockfd,void*buf,int len,int mode);
5) close socket function:CloseSock(int fd);
6) subsidiary system function I:sendto(int sockfd,const void*buf,size_t len,int f lags,const struct sockaddr*to,int addrlen);
7) subsidiary system function II:recvfrom(int sockfd,void*buf,size_t len,int f lags,struct sockaddr*from,size_t*addrlen)。
Used as the prioritization scheme of above-described embodiment, the simulation I/O device management module includes meeting the defeated of simulation I/O device Enter output function function;Including ADC device input/output function function and DAC equipment input/output function functions;For being embedded in The simulation I/O device management of formula system;
The ADC device input/output function function includes:Equipment opens function;Equipment closes function;ADC device is configured Function;Obtain ADC device and be currently configured function;Read ADC device sampled value;Conversion sampling value function;
When being embodied as:
1) equipment opens function:int OpenAdc(char*dev,int mode);
2) equipment closes function:int CloseAdc(int fd);
3) ADC device configuration function:cyg_err_t SetAdcCfg(int fd,unsigned int cmd,char* buffer,unsigned int len);
4) obtain ADC device and be currently configured function:cyg_err_t GetAdcCfg(int fd,unsigned int cmd,char*buffer,unsigned int*len);
5) read ADC device sampled value:cyg_err_t ReadAdcSampling(int fd,unsigned int channel,cyg_adc_sample*buffer,unsigned int*len,int timesout);
6) conversion sampling value function:cyg_err_t ConvAdcValue(cyg_adc_sample*buffer, unsigned int len,float*values,struct_sampl_to_float*keys)。
The DAC equipment input/output function function includes:Equipment opens function;Equipment closes function;Number is exported to DAC According to function.
When being embodied as:
1) equipment opens function:int OpenDac(char*dev,int mode);
2) equipment closes function:int CloseDac(int fd);
3) to DAC output data functions:cyg_err_t WriteDacVal(int fd,unsigned char chan, float value,struct_float_to_dacout*keys)。
Used as the prioritization scheme of above-described embodiment, the digital I/O device management module includes meeting the defeated of digital I/O device Enter output function function;Input/output function function and external connection keyboard equipment input/output function including simple digital I/O device Function;Digital I/O device for embedded system is managed;
The input/output function function of the simple digital I/O device includes:Equipment opens function;Equipment closes function;Clearly Buffer empty function;Read simple digital I/O value function;Simple digital I/O value function is put, this function is provided and arranges Contemporary Digital IO Device value function;
When being embodied as:
1) equipment opens function:int OpenDio(char*dev,int mode);
2) equipment closes function:int CloseDio(int fd);
3) emptying buffer function:cyg_err_t FlushDio(int fd);
4) read simple digital I/O value function:cyg_err_t GetDioValue(int fd,unsigned short* keyValue,unsigned char*status);
5) put simple digital I/O value function:cyg_err_t SetDioValue(int fd,unsigned short* keyValue)。
The external connection keyboard equipment input/output function function includes:Equipment opens function;Equipment closes function;Empty slow Rush area's function;Read keyboard value function.
When being embodied as:
1) equipment opens function:int OpenKbd(char*dev,int mode);
2) equipment closes function:int CloseKbd(int fd);
3) emptying buffer function:cyg_err_t FlushKbd(int fd);
4) read keyboard value function:cyg_err_t GetKeyValue(int fd,unsigned short* keyValue,unsigned char*status)。
Used as the prioritization scheme of above-described embodiment, the LED device management module includes meeting the output function of LED device Function;LED device for embedded system is managed;
The output function function of the LED device includes:Equipment opens function;Equipment closes function;Emptying buffer letter Number;Put LED device and show value function;
When being embodied as:
1) equipment opens function:int OpenDis(char*dev,int mode);
2) equipment closes function:int CloseDis(int fd);
3) emptying buffer function:cyg_err_t FlushDis(int fd);
4) put LED device and show value function:cyg_err_t SetDisValue(int fd,unsigned short* disPosition,unsigned short*disValue)。
Used as the prioritization scheme of above-described embodiment, the buzzer device management module includes meeting the defeated of buzzer equipment Go out power function;Buzzer kind equipment for embedded system is managed;
The output function function of the buzzer equipment includes:Equipment opens function;Equipment closes function;Put buzzer to set Standby value function.
When being embodied as:
1) equipment opens function:int OpenBuzzer(char*dev,int mode);
2) equipment closes function:int CloseBuzzer(int fd);
3) put buzzer equipment value function:int IocltBuzzer(int fd,unsigned int cmd,int during,int times)。
Used as the prioritization scheme of above-described embodiment, the date and time management module include meeting the base of date and time This reading and setting power function;The management on date and time module for embedded system;
The basic reading of the date and time and setting power function include:Read date and the function of time;Read day Phase function;Read access time function;Date and the function of time are set;Date function is set;The function of time is set.
When being embodied as:
1) date and the function of time are read:cyg_err_t GetDateTime(unsigned short data[]);
2) read date function:cyg_err_t GetDate(unsigned short data[]);
3) read access time function:cyg_err_t GetTime(unsigned short data[]);
4) date and the function of time are set:cyg_err_t SetDateTime(unsigned short data[]);
5) date function is set:cyg_err_t SetDate(unsigned short data[]);
6) function of time is set:cyg_err_t SetTime(unsigned short data[]).
Used as the prioritization scheme of above-described embodiment, the input that the house dog device management module meets house dog equipment is defeated Go out power function;
The input/output function function of the house dog equipment includes:Equipment opens function;Equipment closes function;Enable is seen Door dog equipment function;Disabling house dog equipment function;Dog feeding operation function.
When being embodied as:
1) equipment opens function:int OpenWtd(char*dev,int mode);
2) equipment closes function:int CloseWtd(int fd);
3) enable house dog equipment function:int EnableWtd(int fd,int TimeOut);
4) disable house dog equipment function:int DisableWtd(void);
5) dog feeding operation function:int FeedWtd(void).
Used as the prioritization scheme of above-described embodiment, the PWM device management modules include meeting pwm pulse width modulated need The basic function function wanted;For the PWM equipment controles of embedded system;
The basic function function that the pwm pulse width modulated needs includes:Equipment opens function;Equipment closes function; PWM device configuration functions;Obtain PWM equipment and be currently configured function.
When being embodied as:
1) equipment opens function:int OpenPWM(char*dev,int mode);
2) equipment closes function:int ClosePWM(int fd);
3) PWM device configurations function:cyg_err_t SetPWMCfg(int fd,unsigned int cmd, unsigned char chan,float data);
4) obtain PWM equipment and be currently configured function:cyg_err_t GetPWMCfg(int fd,unsigned int cmd,unsigned char chan,int*buffer)。
Used as the prioritization scheme of above-described embodiment, the high-resolution timer device management module includes meeting high-precision fixed When device need basic function function;For the high-resolution timer equipment control of embedded system;
The basic function function that the high-resolution timer needs includes creating high-resolution timer function;Delete timer Function;High accuracy delay function.
1) create high-resolution timer function:Int GreateHighResTimer (HFUNC handler, timer_t* Timerid, unsigned int nsecs, unsigned char mode);
2) delete timing function:int DelHighResTimer(timer_t timerid);
3) high accuracy delay function:int Userusdelay(unsigned int usecs).
To coordinate the realization of the inventive method, based on identical inventive concept, as shown in figure 3, present invention also offers one Plant the construction device of plug in software module, including processor, memory, debugging interface and calling interface, the processor It is upper to connect memory, debugging interface and calling interface respectively;
The processor, for transferring corresponding management module in memory, and manages whole device operation;
The debugging interface, for developer to memory typing more fresh code;
The memory, for storing software database;
The calling interface, the outside industrial computer processor of connection, calls required management module in a device for industrial computer.
The general principle and principal character and advantages of the present invention of the present invention has been shown and described above.The technology of the industry Personnel it should be appreciated that the present invention is not restricted to the described embodiments, the simply explanation described in above-described embodiment and specification this The principle of invention, without departing from the spirit and scope of the present invention, the present invention also has various changes and modifications, these changes Change and improvement is both fallen within scope of the claimed invention.The claimed scope of the invention by appending claims and its Equivalent thereof.

Claims (10)

1. a kind of construction method of plug in software module, it is characterised in that including step:
A middle layer software module is built between the embedded OS and user application of embedded system;
The software database with multiple memory spaces is built in the software module;
The software of embedded system is carried out into functional category;
Software building code to each class, and the management module that code is constituted is stored in corresponding memory space;
Software code in respective stored space is called according to user's request;
Output software code is to corresponding hardware device.
2. a kind of construction method of plug in software module according to claim 1, it is characterised in that the management mould Block includes separate industrial bus communication management module, network service management module, simulation I/O device management module, numeral I/O device management module, LED device management module, buzzer device management module, date and time management module, house dog set Standby management module, PWM device management modules and high-resolution timer device management module.
3. the construction method of a kind of plug in software module according to claim 2, it is characterised in that the industry is total The encapsulation of line communication management module meets the operation of serial-port function of serial communication function;
The operation of serial-port function includes:Serial ports handling function is opened and initializes, this function is opened and initializes serial port function; Read data function from serial ports;To serial ports write data function;Serial ports closes function.
4. the construction method of a kind of plug in software module according to claim 2, it is characterised in that the network leads to Letter management module includes TCP dynamic bases and UDP dynamic bases, is respectively directed to towards connection and disconnected network service demand;
The TCP dynamic bases include:Client computer contiguous function:Connection is sent to server for client computer;Send data function: For sending data to TCP sockets;Receiving data function:For from TCP socket receiving datas;Server is set to monitor Mode function:For server end is set to listening mode;Server receives connection request function:Take from server waiting list Go out client connection request;Close socket function;
The UDP dynamic bases include:Set up Datagram Socket function;Set up server side socket function:Initialization service Device socket structure address, binding server port numbers;Initialization server address structure function:Number is sent to server end According to;Initialization server address structure function:From server receiving data;Close socket function;Subsidiary system function I: For sending data;Subsidiary system function II:For receiving data.
5. a kind of construction method of plug in software module according to claim 2, it is characterised in that the simulation IO Device management module includes the input/output function function for meeting simulation I/O device;Including ADC device input/output function function With DAC equipment input/output function functions;
The ADC device input/output function function includes:Equipment opens function;Equipment closes function;ADC device configures letter Number;Obtain ADC device and be currently configured function;Read ADC device sampled value;Conversion sampling value function;
The DAC equipment input/output function function includes:Equipment opens function;Equipment closes function;To DAC output data letters Number.
6. a kind of construction method of plug in software module according to claim 2, it is characterised in that the Digital I/O Device management module includes the input/output function function for meeting digital I/O device;Including the input and output of simple digital I/O device Power function and external connection keyboard equipment input/output function function;
The input/output function function of the simple digital I/O device includes:Equipment opens function;Equipment closes function;Empty slow Rush area's function;Read simple digital I/O value function;Simple digital I/O value function is put, this function is provided and arranges Contemporary Digital I/O device Value function;
The external connection keyboard equipment input/output function function includes:Equipment opens function;Equipment closes function;Emptying buffer Function;Read keyboard value function.
7. the construction method of a kind of plug in software module according to claim 2, it is characterised in that the LED sets Standby management module includes meeting the output function function of LED device;
The output function function of the LED device includes:Equipment opens function;Equipment closes function;Emptying buffer function;Put LED device shows value function;
The buzzer device management module includes the output function function for meeting buzzer equipment;
The output function function of the buzzer equipment includes:Equipment opens function;Equipment closes function;Put buzzer device value Function.
8. the construction method of a kind of plug in software module according to claim 2, it is characterised in that the date and Time management module includes basic reading and the setting power function for meeting date and time;
The basic reading of the date and time and setting power function include:Read date and the function of time;Read date letter Number;Read access time function;Date and the function of time are set;Date function is set;The function of time is set;
The house dog device management module meets the input/output function function of house dog equipment;The house dog equipment it is defeated Entering output function function includes:Equipment opens function;Equipment closes function;Enable house dog equipment function;House dog sets disabling Standby function;Dog feeding operation function.
9. the construction method of a kind of plug in software module according to claim 2, it is characterised in that the PWM sets Standby management module includes meeting the basic function function of pwm pulse width modulated needs;
The basic function function that the pwm pulse width modulated needs includes:Equipment opens function;Equipment closes function;PWM sets Standby configuration function;Obtain PWM equipment and be currently configured function;
The high-resolution timer device management module includes the basic function function for meeting high-resolution timer needs;
The basic function function that the high-resolution timer needs includes:Create high-resolution timer function;Delete timer letter Number;High accuracy delay function.
10. a kind of construction device of plug in software module, it is characterised in that including processor, memory, debugging interface and Calling interface, connects memory, debugging interface and calling interface respectively on the processor;
The processor, for transferring corresponding management module in memory, and manages whole device operation;
The debugging interface, for developer to memory typing more fresh code;
The memory, for storing software database;
The calling interface, the outside industrial computer processor of connection, calls required management module in a device for industrial computer.
CN201610987977.6A 2016-11-10 2016-11-10 Embedded software modular construction method and device Pending CN106528153A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610987977.6A CN106528153A (en) 2016-11-10 2016-11-10 Embedded software modular construction method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610987977.6A CN106528153A (en) 2016-11-10 2016-11-10 Embedded software modular construction method and device

Publications (1)

Publication Number Publication Date
CN106528153A true CN106528153A (en) 2017-03-22

Family

ID=58350622

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610987977.6A Pending CN106528153A (en) 2016-11-10 2016-11-10 Embedded software modular construction method and device

Country Status (1)

Country Link
CN (1) CN106528153A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108874442A (en) * 2018-06-08 2018-11-23 山东超越数控电子股份有限公司 A kind of implementation method of the Domestic Platform system simulation based on QEMU
CN111061460A (en) * 2019-12-13 2020-04-24 杭州中恒电气股份有限公司 Universal software development platform based on embedded system
CN111309542A (en) * 2020-01-20 2020-06-19 广州芯德通信科技股份有限公司 Embedded system debugging module and construction method thereof
CN111352632A (en) * 2020-03-02 2020-06-30 北京字节跳动网络技术有限公司 Software product detection device, system, method and storage medium
TWI769696B (en) * 2020-02-14 2022-07-01 日商三菱電機股份有限公司 Drive control device and drive control system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101178653A (en) * 2007-12-03 2008-05-14 北京中星微电子有限公司 Embedded system and method supporting various processor
CN102520990A (en) * 2011-12-01 2012-06-27 太仓市同维电子有限公司 Cross-platform compatible general application device supporting embedded system and loading method thereof
CN102542872A (en) * 2010-12-31 2012-07-04 青岛海尔软件有限公司 Driving system based on embedded development platform
CN102779047A (en) * 2012-07-09 2012-11-14 哈尔滨工程大学 Embedded software support platform

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101178653A (en) * 2007-12-03 2008-05-14 北京中星微电子有限公司 Embedded system and method supporting various processor
CN102542872A (en) * 2010-12-31 2012-07-04 青岛海尔软件有限公司 Driving system based on embedded development platform
CN102520990A (en) * 2011-12-01 2012-06-27 太仓市同维电子有限公司 Cross-platform compatible general application device supporting embedded system and loading method thereof
CN102779047A (en) * 2012-07-09 2012-11-14 哈尔滨工程大学 Embedded software support platform
CN102779047B (en) * 2012-07-09 2016-07-06 哈尔滨工程大学 A kind of embedded software supports platform

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108874442A (en) * 2018-06-08 2018-11-23 山东超越数控电子股份有限公司 A kind of implementation method of the Domestic Platform system simulation based on QEMU
CN111061460A (en) * 2019-12-13 2020-04-24 杭州中恒电气股份有限公司 Universal software development platform based on embedded system
CN111061460B (en) * 2019-12-13 2023-09-29 杭州中恒电气股份有限公司 Universal software development platform based on embedded system
CN111309542A (en) * 2020-01-20 2020-06-19 广州芯德通信科技股份有限公司 Embedded system debugging module and construction method thereof
TWI769696B (en) * 2020-02-14 2022-07-01 日商三菱電機股份有限公司 Drive control device and drive control system
CN111352632A (en) * 2020-03-02 2020-06-30 北京字节跳动网络技术有限公司 Software product detection device, system, method and storage medium
CN111352632B (en) * 2020-03-02 2023-07-04 抖音视界有限公司 Software product detection device, system, method and storage medium

Similar Documents

Publication Publication Date Title
CN106528153A (en) Embedded software modular construction method and device
US11106838B2 (en) Systems, methods, and apparatus to generate an integrated modular architecture model
King et al. Atlas: A service-oriented sensor platform: Hardware and middleware to enable programmable pervasive spaces
Handziski et al. Flexible hardware abstraction for wireless sensor networks
Yang et al. μ PnP: plug and play peripherals for the internet of things
CN101000550A (en) Remote on-line reconfiguration method of embedded system
WO2020053454A1 (en) Controller for robots
CN1924800A (en) Control-based insert management system and method for secondary development platform
CN106371847A (en) Method and system for driving RS422 communication of CPCI (Compact Peripheral Component Interconnect) bus in Windows xp system
Bergmann et al. Low cost prototyping system for sensor networks
KR20040017806A (en) Method and apparatus for providing a radio module for a computer system
CN103957214A (en) Computer network data package grabbing method for teaching
WO2007000588A1 (en) Interface device
CN103677820B (en) A kind of embedded development software output method and system
CN107145467A (en) A kind of distributed computing hardware system in real time
CN104796328B (en) The gateway host of the data communication equipment of multiplex roles or agreement based on KNX/EIB buses
CN101702119B (en) Device oriented programming technology and method
CN100396031C (en) System and method for testing function of communication apparatus
CN207264382U (en) The chip and system of field programmable gate array multi version configuration
CN111176926A (en) IP (Internet protocol) core simulation system and simulation method based on double-port SRAM (static random Access memory)
CN107273621A (en) A kind of transportable approach of FPGA application circuits
CN103677842A (en) Software tool configuration type integrated expansion calling method and system
CN104570856B (en) Online-programmable monitoring network system
US20050125486A1 (en) Decentralized operating system
CN113010361B (en) MIO function rapid verification method of fully programmable SOC chip

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20170322

RJ01 Rejection of invention patent application after publication