Donny9 opened a new pull request, #9954:
URL: https://github.com/apache/nuttx/pull/9954

   ## Summary
   Implement the GPS driver framework
   
   The design diagram of the GPS driver framework is as follows:
   
![image](https://github.com/apache/nuttx/assets/70748590/ea6c575f-0516-432f-9457-774d77a3b5e3)
   
   The GPS driver framework is implemented based on the lower half of the 
sensor driver framework, because essentially gps is also a kind of sensor. 
Therefore, from the perspective of the sensor driver framework, the gps driver 
is its lower half, and inside the lower half we abstract the upper half and 
lower half of the gps driver framework.
   
   The gps driver framework will provide three nodes, two of which are sensor 
topic nodes, namely /dev/uorb/sensor_gps and /dev/uorb/sensor_gps_satellite, 
they mainly connect with the upper uorb framework and publish the gps data 
parsed by the driver , there is also a character device node /dev/ttyGPS0, 
which is used for upper-layer applications to directly obtain raw data or NMEA 
data reported by the driver.
   
   The data flow of the three nodes is controllable. When the data reported by 
the driver contains data in the standard NMEA format, it is necessary to 
specify true through the parameter `is_nmea` when calling `push_data`, and the 
driver will start to analyze the reported data and publish new data. topic 
data, and also transparently transmit the data reported by the driver to 
/dev/ttyGPS.
   
   In addition, the driver also supports direct reporting of event events, 
which needs to call the interface `push_event`.
   
   The abstract GPS operation set of the driver framework gps_ops_s, including 
methods: `activate`, `set_interval`, `control` and `inject_data`.
   
   ```
   struct gps_lowerhalf_s
   {
     FAR const struct gps_ops_s *ops; 
   
     gps_push_data_t push_data;
   
     gps_push_event_t push_event;
   
     FAR void *priv;
   };
   
   struct gps_ops_s
   {
     CODE int (*activate)(FAR struct gps_lowerhalf_s *lower,
                        FAR struct file *filep, bool enable);
     CODE int (*set_interval)(FAR struct gps_lowerhalf_s *lower,
                            FAR struct file *filep,
                            FAR unsigned long *period_us);
     CODE int (*control)(FAR struct gps_lowerhalf_s *lower,
                       FAR struct file *filep,
                       int cmd, unsigned long arg);
     CODE ssize_t (*inject_data)(FAR struct gps_lowerhalf_s *lower,
                               FAR struct file *filep,
                               FAR const void *buffer, size_t buflen);
   };
   ```
   
   This PR is related to https://github.com/apache/nuttx-apps/pull/1867
   ## Impact
   Add gps driver frameworks
   ## Testing
   local test
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to