Method and device for reading and writing serial data, computer device, and storage medium
A technology of serial data, reading and writing methods, applied in the direction of electrical digital data processing, instruments, etc., to save CPU resources, save system resource overhead, and fast transmission.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Publication Date
- 2018-08-31
Smart Images

Figure 1 
Figure 2 
Figure 3
Abstract
Description
technical field
[0001] The invention relates to the technical field of embedded systems, in particular to a serial port data reading and writing method, device, computer equipment and storage medium. Background technique
[0002] The GNSS (Global Navigation Satellite System) positioning module can be configured to update and output GNSS raw data to the serial port at a rate of 1Hz, 5Hz, and 10Hz. User applications need to write data to the serial port while continuously reading data from the serial port device. That is to say, the serial port Data interaction and communication between the two parties are required with the user application.
[0003] The traditional technical solution is that in the kernel layer of the LINUX system, the serial port communication adopts the PIO mode (Programming Input / Output Model), and the CPU responds to the interrupt and executes the IO port command to read and write data to realize data communication. In the serial port communication applic...
Examples
Embodiment Construction
[0051] In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.
[0052] figure 1 It is a schematic flowchart of a method for reading and writing serial port data in an embodiment. like figure 1 As shown, the present invention provides a method for reading and writing serial port data, including:
[0053] Step S101: Configure the direct memory access resource of the serial port device in the device tree.
[0054]Specifically, in the system device number file, add the direct memory access (DirectMemory Access) resource corresponding to the serial port device. As the name implies, the direct memory access function is to allow the device to bypass the processor a...