1
- /*
2
- *---------------------------------------------------------------------------------
1
+ /* *
2
+ * @file sfeDevSoilMoisture.h
3
+ * @brief Header file for the soil moisture sensor class
3
4
*
4
- * Copyright (c) 2025, SparkFun Electronics Inc.
5
+ * This file contains the class definition for the soil moisture sensor, including
6
+ * methods for initialization, reading moisture values, controlling the on-board LED,
7
+ * and setting the I2C address.
5
8
*
6
- * SPDX-License-Identifier: MIT
9
+ * @author SparkFun Electronics
10
+ * @date 2025
11
+ * @copyright Copyright (c) 2025, SparkFun Electronics Inc.
12
+ * @license MIT
7
13
*
8
- *---------------------------------------------------------------------------------
14
+ * SPDX-License-Identifier: MIT
9
15
*/
16
+
10
17
// Actual implementation of the soil moisture sensor - this is a platform "independent" implementation
11
18
12
19
#pragma once
20
27
#include < sfeTk/sfeTkII2C.h>
21
28
#include < sfeTk/sfeTkISPI.h>
22
29
23
- // Default I2C address for the sensor
30
+ /* *
31
+ * @brief Default I2C address for the soil moisture sensor
32
+ *
33
+ * This macro defines the default I2C address (0x28) used by the soil moisture sensor.
34
+ */
24
35
#define SFE_SOIL_MOISTURE_DEFAULT_I2C_ADDRESS 0x28
25
36
26
- // Max value for the sensor value (10-bit ADC) 2^10 = 1024-1
37
+ /* *
38
+ * @brief Maximum value for the soil moisture sensor
39
+ *
40
+ * This macro defines the maximum value (1023) for the soil moisture sensor,
41
+ * which corresponds to the highest reading from the 10-bit ADC. 2^10 = 1024-1
42
+ */
27
43
#define SFE_SOIL_MOISTURE_MAX_VALUE 1023
28
44
45
+ /* *
46
+ * @brief Class representing the soil moisture sensor
47
+ *
48
+ * This class provides an interface to the soil moisture sensor, allowing for
49
+ * initialization, reading moisture values and controlling the on-board LED.
50
+ */
29
51
class sfeDevSoilMoisture
30
52
{
31
53
@@ -129,7 +151,12 @@ class sfeDevSoilMoisture
129
151
uint8_t address (void );
130
152
131
153
protected:
132
- // The toolkit bus the sensor is connected to
154
+ /* *
155
+ * @brief The toolkit bus the sensor is connected to
156
+ *
157
+ * This member variable holds a pointer to the bus interface (I2C or SPI) used
158
+ * for communication with the soil moisture sensor.
159
+ */
133
160
sfeTkIBus *_theBus;
134
161
135
162
}; // class sfeDevSoilMoisture
0 commit comments