feat(firmware): support configurable SEN54 and SEN66 boards

Add the pinned Sensirion SEN66 driver, central sensor and board profiles, and a separate GPIO I2C bus for SEN66 with display. Preserve the original display layout and keep NOx and CO2 in InfluxDB. Include protocol tests, hardware workflow documentation and verified deployment results without credentials.
This commit is contained in:
root
2026-11-09 21:44:04 +00:00
parent 45b05d045a
commit 69bb47dda1
27 changed files with 2634 additions and 111 deletions
+32 -13
View File
@@ -28,7 +28,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
// File: src/sensirion_common.c
#include "sensirion_common.h"
#include "sensirion_config.h"
@@ -60,27 +60,27 @@ float sensirion_common_bytes_to_float(const uint8_t* bytes) {
}
void sensirion_common_uint32_t_to_bytes(const uint32_t value, uint8_t* bytes) {
bytes[0] = value >> 24;
bytes[1] = value >> 16;
bytes[2] = value >> 8;
bytes[3] = value;
bytes[0] = (uint8_t)(value >> 24);
bytes[1] = (uint8_t)(value >> 16);
bytes[2] = (uint8_t)(value >> 8);
bytes[3] = (uint8_t)(value);
}
void sensirion_common_uint16_t_to_bytes(const uint16_t value, uint8_t* bytes) {
bytes[0] = value >> 8;
bytes[1] = value;
bytes[0] = (uint8_t)(value >> 8);
bytes[1] = (uint8_t)value;
}
void sensirion_common_int32_t_to_bytes(const int32_t value, uint8_t* bytes) {
bytes[0] = value >> 24;
bytes[1] = value >> 16;
bytes[2] = value >> 8;
bytes[3] = value;
bytes[0] = (uint8_t)(value >> 24);
bytes[1] = (uint8_t)(value >> 16);
bytes[2] = (uint8_t)(value >> 8);
bytes[3] = (uint8_t)value;
}
void sensirion_common_int16_t_to_bytes(const int16_t value, uint8_t* bytes) {
bytes[0] = value >> 8;
bytes[1] = value;
bytes[0] = (uint8_t)(value >> 8);
bytes[1] = (uint8_t)value;
}
void sensirion_common_float_to_bytes(const float value, uint8_t* bytes) {
@@ -99,3 +99,22 @@ void sensirion_common_copy_bytes(const uint8_t* source, uint8_t* destination,
destination[i] = source[i];
}
}
void sensirion_common_to_integer(const uint8_t* source, uint8_t* destination,
INT_TYPE int_type, uint8_t data_length) {
if (data_length > int_type) {
data_length = 0; // we do not read at all if data_length is bigger than
// the provided integer!
}
// pad missing bytes
uint8_t offset = int_type - data_length;
for (uint8_t i = 0; i < offset; i++) {
destination[int_type - i - 1] = 0;
}
for (uint8_t i = 1; i <= data_length; i++) {
destination[int_type - offset - i] = source[i - 1];
}
}