From 95caea74583cf32a00e8558c36a61b4e9c084fc7 Mon Sep 17 00:00:00 2001
From: Pietro Bortolus <Pietro.bortolus@skywarder.eu>
Date: Mon, 10 Feb 2025 13:47:53 +0100
Subject: [PATCH] [ND015X] Added doxygen comments

I also deleted an enum that was not used in the
ND015A file
---
 src/shared/sensors/ND015X/ND015A.h | 45 ++++++++++++++++++++----------
 src/shared/sensors/ND015X/ND015D.h | 40 ++++++++++++++++++++++----
 2 files changed, 64 insertions(+), 21 deletions(-)

diff --git a/src/shared/sensors/ND015X/ND015A.h b/src/shared/sensors/ND015X/ND015A.h
index d853e7e95..c55c24d00 100644
--- a/src/shared/sensors/ND015X/ND015A.h
+++ b/src/shared/sensors/ND015X/ND015A.h
@@ -35,20 +35,6 @@ namespace Boardcore
 class ND015A : public Sensor<ND015XData>
 {
 public:
-    /**
-     * The datasheet is unclear about the unit of measure,
-     * it could be either psi or inH2O but I believe it's the latter
-     */
-    enum FullScaleRange : uint8_t
-    {
-        FS_1  = 0x02,  // 1.0  psi
-        FS_2  = 0x03,  // 2.0  psi
-        FS_4  = 0x04,  // 4.0  psi
-        FS_5  = 0x05,  // 5.0  psi
-        FS_10 = 0x06,  // 10.0 psi
-        FS_15 = 0x07,  // 15.0 psi
-    };
-
     enum BWLimitFilter : uint8_t
     {
         BWL_1   = 0x00,  // 1.0 Hz
@@ -73,10 +59,27 @@ public:
         ENABLED  = 0x80,
     };
 
+    /**
+     * @brief Constructor for the ND015A sensor.
+     *
+     * @param bus SPI bus interface.
+     * @param cs Chip select GPIO pin.
+     * @param spiConfig SPI bus configuration.
+     */
     ND015A(SPIBusInterface& bus, miosix::GpioPin cs, SPIBusConfig spiConfig);
 
+    /**
+     * @brief Initializes the sensor.
+     *
+     * @return True if model number matches, false otherwise.
+     */
     bool init() override;
 
+    /**
+     * @brief Not implemented.
+     *
+     * @return Always returns true.
+     */
     bool selfTest() override;
 
     /**
@@ -84,7 +87,9 @@ public:
      *
      * @param odr   output data rate for the sensor,
      *              the actual odr is calculated as
-     *              444Hz / odr
+     *              444Hz / odr.
+     *              Allowed values are 0x00 to 0xFF,
+     *              0x00 will select the auto-select rate mode
      */
     void setOutputDataRate(u_int8_t odr);
 
@@ -100,8 +105,18 @@ public:
      */
     void setIOWatchdog(IOWatchdogEnable iow);
 
+    /**
+     * @brief Sets the bandwidth limit filter for the sensor.
+     *
+     * @param bwl Bandwidth limit filter setting.
+     */
     void setBWLimitFilter(BWLimitFilter bwl);
 
+    /**
+     * @brief Enables or disables the notch filter.
+     *
+     * @param ntc Notch filter setting.
+     */
     void setNotch(NotchEnable ntc);
 
 protected:
diff --git a/src/shared/sensors/ND015X/ND015D.h b/src/shared/sensors/ND015X/ND015D.h
index 840748dd2..ecbc6e161 100644
--- a/src/shared/sensors/ND015X/ND015D.h
+++ b/src/shared/sensors/ND015X/ND015D.h
@@ -72,10 +72,27 @@ public:
         ENABLED  = 0x80,
     };
 
+    /**
+     * @brief Constructor for the ND015D sensor.
+     *
+     * @param bus SPI bus interface.
+     * @param cs Chip select GPIO pin.
+     * @param spiConfig SPI bus configuration.
+     */
     ND015D(SPIBusInterface& bus, miosix::GpioPin cs, SPIBusConfig spiConfig);
 
+    /**
+     * @brief Initializes the sensor.
+     *
+     * @return True if model number matches, false otherwise.
+     */
     bool init() override;
 
+    /**
+     * @brief Not implemented.
+     *
+     * @return Always returns true.
+     */
     bool selfTest() override;
 
     /**
@@ -83,27 +100,38 @@ public:
      *
      * @param odr   output data rate for the sensor,
      *              the actual odr is calculated as
-     *              444Hz / odr
+     *              444Hz / odr.
+     *              Allowed values are 0x00 to 0xFF,
+     *              0x00 will select the auto-select rate mode
      */
     void setOutputDataRate(u_int8_t odr);
 
     /**
-     * @brief function to set the fullscale range
+     * @brief Sets the full-scale range for the sensor.
      *
-     * @param fs   fullscale range, default is
-     *             2.0 psi
+     * @param fs Full-scale range. Default is 2.0 psi.
      */
     void setFullScaleRange(FullScaleRange fs);
 
     /**
-     * @brief function to enable the IO watchdog
+     * @brief Enables or disables the IO watchdog.
      *
-     * @param iow  setting
+     * @param iow IO watchdog setting.
      */
     void setIOWatchdog(IOWatchdogEnable iow);
 
+    /**
+     * @brief Sets the bandwidth limit filter for the sensor.
+     *
+     * @param bwl Bandwidth limit filter setting.
+     */
     void setBWLimitFilter(BWLimitFilter bwl);
 
+    /**
+     * @brief Enables or disables the notch filter.
+     *
+     * @param ntc Notch filter setting.
+     */
     void setNotch(NotchEnable ntc);
 
 protected:
-- 
GitLab