refactor ♻️: Implement comprehensive sensor system for environmental monitoring, including temperature, humidity, pressure, wind speed, and direction.

- This commit updates the build process to use a custom toolchain and configuration, enabling compilation of multiple project components.
- The primary goal of this commit is to provide a detailed overview and documentation for a zigbee weather station project, including firmware information and sensor component descriptions.
- Updated configuration file with new constants and definitions.
- The MAIN GOAL of these changes is to implement a comprehensive sensor system for environmental monitoring, including temperature, humidity, pressure, wind speed, and direction.
- Main goal of the changes: Define a new header file with function prototypes and external variable declarations.
- Added new functionality to initialize and read data from an anemometer sensor, introducing its necessary setup and calculation logic.
- Added header file for anemometer sensor with function prototypes.
- Initial implementation of BME280 sensor functionality.
- Added function prototype for the BME280 initialization and data reading functions.
- Initializes and configures a rain gauge sensor with GPIO interrupt setup.
- Added function prototypes to the rain gauge sensor header file.
- This commit adds a new C function to initialize and read data from a wind vane sensor.
- Updated header file with new function prototype definitions.
- This commit adds a new function `send_zigbee_data` to send various Zigbee data types.
- Added Zigbee communication header file with function prototype for sending data.
This commit is contained in:
2025-02-22 10:44:49 +01:00
parent cd165f0210
commit fdfd04bfa6
15 changed files with 236 additions and 0 deletions

12
sensors/anemometer.c Normal file
View File

@@ -0,0 +1,12 @@
#include "anemometer.h"
// Initialize anemometer (GPIO, interrupts, etc.)
void Anemometer_init() {
// Set up GPIO for anemometer
}
// Read wind speed (in mph or other units)
uint8 Anemometer_read() {
// Read wind speed value (e.g., 1.492 mph per tip)
return wind_speed;
}

8
sensors/anemometer.h Normal file
View File

@@ -0,0 +1,8 @@
#ifndef ANEMOMETER_H
#define ANEMOMETER_H
// Function prototypes
void Anemometer_init();
uint8 Anemometer_read();
#endif // ANEMOMETER_H

11
sensors/bme280.c Normal file
View File

@@ -0,0 +1,11 @@
#include "bme280.h"
// Initialize BME280 sensor (I2C setup, etc.)
void BME280_init() {
// Initialize I2C, configure BME280 settings, etc.
}
// Read data from BME280 sensor (temperature, humidity, pressure)
void BME280_readData(int32* temperature, int32* humidity, int32* pressure) {
// Read temperature, humidity, and pressure data from BME280 via I2C
}

8
sensors/bme280.h Normal file
View File

@@ -0,0 +1,8 @@
#ifndef BME280_H
#define BME280_H
// Function prototypes
void BME280_init();
void BME280_readData(int32* temperature, int32* humidity, int32* pressure);
#endif // BME280_H

12
sensors/rain_gauge.c Normal file
View File

@@ -0,0 +1,12 @@
#include "rain_gauge.h"
// Initialize rain gauge (configure GPIO interrupts or polling)
void RainGauge_init() {
// Set up the GPIO pin for the rain gauge
}
// Read rain gauge data (check if bucket tipped)
uint8 RainGauge_read() {
// Return rain tip count or trigger status
return rain_tip;
}

8
sensors/rain_gauge.h Normal file
View File

@@ -0,0 +1,8 @@
#ifndef RAIN_GAUGE_H
#define RAIN_GAUGE_H
// Function prototypes
void RainGauge_init();
uint8 RainGauge_read();
#endif // RAIN_GAUGE_H

12
sensors/wind_vane.c Normal file
View File

@@ -0,0 +1,12 @@
#include "wind_vane.h"
// Initialize the wind vane (configure GPIOs, etc.)
void WindVane_init() {
// Initialize GPIO for wind vane
}
// Read wind direction (0-15 for 16 positions)
uint8 WindVane_read() {
// Read the wind direction from the wind vane sensor
return wind_direction;
}

8
sensors/wind_vane.h Normal file
View File

@@ -0,0 +1,8 @@
#ifndef WIND_VANE_H
#define WIND_VANE_H
// Function prototypes
void WindVane_init();
uint8 WindVane_read();
#endif // WIND_VANE_H