|
1 | | - |
2 | | -/* |
3 | | - *--------------------------------------------------------------------------------- |
| 1 | +/** |
| 2 | + * @file sfeDevSoilMoisture.cpp |
| 3 | + * @brief Implementation file for the soil moisture sensor class |
4 | 4 | * |
5 | | - * Copyright (c) 2025, SparkFun Electronics Inc. |
| 5 | + * This file contains the implementation of the soil moisture sensor class, including |
| 6 | + * methods for initialization, reading moisture values, controlling the on-board LED, |
| 7 | + * and setting the I2C address. |
6 | 8 | * |
| 9 | + * @author SparkFun Electronics |
| 10 | + * @date 2025 |
| 11 | + * @copyright Copyright (c) 2025, SparkFun Electronics Inc. This project is released under the MIT License. |
| 12 | + * |
7 | 13 | * SPDX-License-Identifier: MIT |
8 | | - * |
9 | | - *--------------------------------------------------------------------------------- |
10 | 14 | */ |
11 | 15 |
|
| 16 | + |
12 | 17 | #include "sfeDevSoilMoisture.h" |
13 | 18 |
|
14 | 19 | // Impl for the core driver |
15 | 20 |
|
16 | 21 | // Define the communication commands for the soil moisture sensor (from the original zio firmware) |
| 22 | +/** |
| 23 | + * @brief Command to turn off the on-board LED |
| 24 | + */ |
17 | 25 | #define kCommandLEDOff 0x00 |
| 26 | + |
| 27 | +/** |
| 28 | + * @brief Command to turn on the on-board LED |
| 29 | + */ |
18 | 30 | #define kCommandLEDOn 0x01 |
| 31 | + |
| 32 | +/** |
| 33 | + * @brief Command to change the I2C address of the sensor |
| 34 | + */ |
19 | 35 | #define kCommandChangeAddress 0x03 |
| 36 | + |
| 37 | +/** |
| 38 | + * @brief Command to get the moisture value from the sensor |
| 39 | + */ |
20 | 40 | #define kCommandGetValue 0x05 |
| 41 | + |
| 42 | +/** |
| 43 | + * @brief Command indicating no new data is available |
| 44 | + */ |
21 | 45 | #define kCommandNothingNew 0x99 |
| 46 | +9 |
22 | 47 | //--------------------------------------------------------------------- |
23 | 48 | // Core object implementation |
24 | 49 | //--------------------------------------------------------------------- |
|
0 commit comments