Skip to content

Commit 1f62981

Browse files
authored
Merge pull request #6 from Sensirion/sen66_1.6.0_20250313_1043
Generate SEN66 driver from SEN66 model version 1.6.0
2 parents 5f2d2cb + 8bac6cf commit 1f62981

File tree

6 files changed

+109
-15
lines changed

6 files changed

+109
-15
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
name: Quality check
22

33
on:
4-
pull_request:
5-
branches:
6-
- main
74
push:
5+
pull_request:
86
branches:
97
- main
10-
118
jobs:
129
driver-quality:
1310
uses: sensirion/.github/.github/workflows/driver.c.check.yml@main
11+
12+
code-generation-check:
13+
uses: sensirion/.github/.github/workflows/driver.generated.metadata_check.yml@main

CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
55

66
## [Unreleased]
77

8+
## [1.2.0] - 2025-3-13
9+
10+
### Added
11+
12+
- get version command to read the firmware version
13+
- get SHT heater measurement to read humidity and temperature measurement after heater activation. This command is available for firmware version >= 4.0.
14+
### Changed
15+
16+
- Activate SHT heater duration reduced to 20ms. For firmware version >= 4.0 the get heater measurements command can be used to check if the heater has finished. With firmware versions < 4.0 one must wait at least 1300ms before issuing another command.
817
## [1.1.0] - 2025-2-12
918

1019
### Changed
@@ -31,7 +40,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3140
- Add interfaces to start, stop and read measurements.
3241
- Add interfaces to read product name, serial number and version
3342

34-
[Unreleased]: https://github.com/Sensirion/raspberry-pi-i2c-sen66/compare/1.1.0...HEAD
43+
[Unreleased]: https://github.com/Sensirion/raspberry-pi-i2c-sen66/compare/1.2.0...HEAD
44+
[1.2.0]: https://github.com/Sensirion/raspberry-pi-i2c-sen66/compare/1.1.0...1.2.0
3545
[1.1.0]: https://github.com/Sensirion/raspberry-pi-i2c-sen66/compare/1.0.1...1.1.0
3646
[1.0.1]: https://github.com/Sensirion/raspberry-pi-i2c-sen66/compare/1.0.0...1.0.1
3747
[1.0.0]: https://github.com/Sensirion/raspberry-pi-i2c-sen66/compare/0.1.0...1.0.0

example-usage/sen66_i2c_example_usage.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Generator: sensirion-driver-generator 1.1.2
55
* Product: sen66
6-
* Model-Version: 1.5.0
6+
* Model-Version: 1.6.0
77
*/
88
/*
99
* Copyright (c) 2025, Sensirion AG

metadata.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# driver generation metadata
22
generator_version: 1.1.2
3-
model_version: 1.5.0
3+
model_version: 1.6.0
44
dg_status: released
55
is_manually_modified: false
66
first_generated: '2024-10-30 08:14'
7-
last_generated: '2025-02-12 09:41'
7+
last_generated: '2025-03-13 10:43'

sen66_i2c.c

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Generator: sensirion-driver-generator 1.1.2
55
* Product: sen66
6-
* Model-Version: 1.5.0
6+
* Model-Version: 1.6.0
77
*/
88
/*
99
* Copyright (c) 2025, Sensirion AG
@@ -734,7 +734,29 @@ int16_t sen66_activate_sht_heater() {
734734
if (local_error != NO_ERROR) {
735735
return local_error;
736736
}
737-
sensirion_i2c_hal_sleep_usec(1300 * 1000);
737+
sensirion_i2c_hal_sleep_usec(20 * 1000);
738+
return local_error;
739+
}
740+
741+
int16_t sen66_get_sht_heater_measurements(int16_t* humidity,
742+
int16_t* temperature) {
743+
int16_t local_error = NO_ERROR;
744+
uint8_t* buffer_ptr = communication_buffer;
745+
uint16_t local_offset = 0;
746+
local_offset =
747+
sensirion_i2c_add_command16_to_buffer(buffer_ptr, local_offset, 0x6790);
748+
local_error =
749+
sensirion_i2c_write_data(_i2c_address, buffer_ptr, local_offset);
750+
if (local_error != NO_ERROR) {
751+
return local_error;
752+
}
753+
sensirion_i2c_hal_sleep_usec(20 * 1000);
754+
local_error = sensirion_i2c_read_data_inplace(_i2c_address, buffer_ptr, 4);
755+
if (local_error != NO_ERROR) {
756+
return local_error;
757+
}
758+
*humidity = sensirion_common_bytes_to_int16_t(&buffer_ptr[0]);
759+
*temperature = sensirion_common_bytes_to_int16_t(&buffer_ptr[2]);
738760
return local_error;
739761
}
740762

@@ -782,6 +804,27 @@ int16_t sen66_get_serial_number(int8_t* serial_number,
782804
return local_error;
783805
}
784806

807+
int16_t sen66_get_version(uint8_t* firmware_major, uint8_t* firmware_minor) {
808+
int16_t local_error = NO_ERROR;
809+
uint8_t* buffer_ptr = communication_buffer;
810+
uint16_t local_offset = 0;
811+
local_offset =
812+
sensirion_i2c_add_command16_to_buffer(buffer_ptr, local_offset, 0xd100);
813+
local_error =
814+
sensirion_i2c_write_data(_i2c_address, buffer_ptr, local_offset);
815+
if (local_error != NO_ERROR) {
816+
return local_error;
817+
}
818+
sensirion_i2c_hal_sleep_usec(20 * 1000);
819+
local_error = sensirion_i2c_read_data_inplace(_i2c_address, buffer_ptr, 2);
820+
if (local_error != NO_ERROR) {
821+
return local_error;
822+
}
823+
*firmware_major = (uint8_t)buffer_ptr[0];
824+
*firmware_minor = (uint8_t)buffer_ptr[1];
825+
return local_error;
826+
}
827+
785828
int16_t sen66_read_device_status(sen66_device_status* device_status) {
786829
int16_t local_error = NO_ERROR;
787830
uint8_t* buffer_ptr = communication_buffer;

sen66_i2c.h

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Generator: sensirion-driver-generator 1.1.2
55
* Product: sen66
6-
* Model-Version: 1.5.0
6+
* Model-Version: 1.6.0
77
*/
88
/*
99
* Copyright (c) 2025, Sensirion AG
@@ -70,8 +70,10 @@ typedef enum {
7070
SEN66_SET_SENSOR_ALTITUDE_CMD_ID = 0x6736,
7171
SEN66_GET_SENSOR_ALTITUDE_CMD_ID = 0x6736,
7272
SEN66_ACTIVATE_SHT_HEATER_CMD_ID = 0x6765,
73+
SEN66_GET_SHT_HEATER_MEASUREMENTS_CMD_ID = 0x6790,
7374
SEN66_GET_PRODUCT_NAME_CMD_ID = 0xd014,
7475
SEN66_GET_SERIAL_NUMBER_CMD_ID = 0xd033,
76+
SEN66_GET_VERSION_CMD_ID = 0xd100,
7577
SEN66_READ_DEVICE_STATUS_CMD_ID = 0xd206,
7678
SEN66_READ_AND_CLEAR_DEVICE_STATUS_CMD_ID = 0xd210,
7779
SEN66_DEVICE_RESET_CMD_ID = 0xd304,
@@ -910,16 +912,42 @@ int16_t sen66_get_sensor_altitude(uint16_t* altitude);
910912
*
911913
* This command allows to use the inbuilt heater in SHT sensor to reverse creep
912914
* at high humidity. This command activates the SHT sensor heater with 200mW for
913-
* 1s. The heater is then automatically deactivated again. Wait at least 20s
914-
* after this command before starting a measurement to get coherent temperature
915-
* values (heating consequence to disappear).
915+
* 1s. The heater is then automatically deactivated again. The
916+
* "get_sht_heater_measurements" command can be used to check if the heater has
917+
* finished (firmware version >= 4.0). Wait at least 20s after this command
918+
* before starting a measurement to get coherent temperature values (heating
919+
* consequence to disappear).
916920
*
917-
* @note This command is only available in idle mode.
921+
* @note This command is only available in idle mode. For firmware version <
922+
* 4.0, wait for at least 1300ms before sending another command, to ensure
923+
* heating is finsihed.
918924
*
919925
* @return error_code 0 on success, an error code otherwise.
920926
*/
921927
int16_t sen66_activate_sht_heater();
922928

929+
/**
930+
* @brief Get the measurement values when the SHT sensor heating is finished.
931+
*
932+
* Get the measured values when the SHT sensor heating is triggerd. If the
933+
* heating is not finished, the returned humidity and temperature values are
934+
* 0x7FFF.
935+
*
936+
* @param[out] humidity Value is scaled with factor 100: RH [%] = value / 100
937+
* *Note: If this value is not available, 0x7FFF is returned.*
938+
* @param[out] temperature Value is scaled with factor 200: T [°C] = value / 200
939+
* *Note: If this value is not available, 0x7FFF is returned.*
940+
*
941+
* @note This command is only availble in idle mode. This command is only
942+
* available for firmware version >= 4.0. This command must be used after the
943+
* "activate_sht_heater" command. The get_sht_heater_measurements command can be
944+
* queried every 0.05s to get the measurements.
945+
*
946+
* @return error_code 0 on success, an error code otherwise.
947+
*/
948+
int16_t sen66_get_sht_heater_measurements(int16_t* humidity,
949+
int16_t* temperature);
950+
923951
/**
924952
* @brief sen66_get_product_name
925953
*
@@ -946,6 +974,19 @@ int16_t sen66_get_product_name(int8_t* product_name,
946974
int16_t sen66_get_serial_number(int8_t* serial_number,
947975
uint16_t serial_number_size);
948976

977+
/**
978+
* @brief sen66_get_version
979+
*
980+
* Gets the version information for the hardware, firmware and communication
981+
* protocol.
982+
*
983+
* @param[out] firmware_major Firmware major version number.
984+
* @param[out] firmware_minor Firmware minor version number.
985+
*
986+
* @return error_code 0 on success, an error code otherwise.
987+
*/
988+
int16_t sen66_get_version(uint8_t* firmware_major, uint8_t* firmware_minor);
989+
949990
/**
950991
* @brief sen66_read_device_status
951992
*

0 commit comments

Comments
 (0)