Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/raspberry_quality_check.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: Quality check

on:
pull_request:
branches:
- main
push:
pull_request:
branches:
- main

jobs:
driver-quality:
uses: sensirion/.github/.github/workflows/driver.c.check.yml@main

code-generation-check:
uses: sensirion/.github/.github/workflows/driver.generated.metadata_check.yml@main
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.2.0] - 2025-3-13

### Added

- get version command to read the firmware version
- get SHT heater measurement to read humidity and temperature measurement after heater activation. This command is available for firmware version >= 4.0.
### Changed

- 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.
## [1.1.0] - 2025-2-12

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

[Unreleased]: https://github.com/Sensirion/raspberry-pi-i2c-sen66/compare/1.1.0...HEAD
[Unreleased]: https://github.com/Sensirion/raspberry-pi-i2c-sen66/compare/1.2.0...HEAD
[1.2.0]: https://github.com/Sensirion/raspberry-pi-i2c-sen66/compare/1.1.0...1.2.0
[1.1.0]: https://github.com/Sensirion/raspberry-pi-i2c-sen66/compare/1.0.1...1.1.0
[1.0.1]: https://github.com/Sensirion/raspberry-pi-i2c-sen66/compare/1.0.0...1.0.1
[1.0.0]: https://github.com/Sensirion/raspberry-pi-i2c-sen66/compare/0.1.0...1.0.0
Expand Down
2 changes: 1 addition & 1 deletion example-usage/sen66_i2c_example_usage.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Generator: sensirion-driver-generator 1.1.2
* Product: sen66
* Model-Version: 1.5.0
* Model-Version: 1.6.0
*/
/*
* Copyright (c) 2025, Sensirion AG
Expand Down
4 changes: 2 additions & 2 deletions metadata.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# driver generation metadata
generator_version: 1.1.2
model_version: 1.5.0
model_version: 1.6.0
dg_status: released
is_manually_modified: false
first_generated: '2024-10-30 08:14'
last_generated: '2025-02-12 09:41'
last_generated: '2025-03-13 10:43'
47 changes: 45 additions & 2 deletions sen66_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Generator: sensirion-driver-generator 1.1.2
* Product: sen66
* Model-Version: 1.5.0
* Model-Version: 1.6.0
*/
/*
* Copyright (c) 2025, Sensirion AG
Expand Down Expand Up @@ -734,7 +734,29 @@ int16_t sen66_activate_sht_heater() {
if (local_error != NO_ERROR) {
return local_error;
}
sensirion_i2c_hal_sleep_usec(1300 * 1000);
sensirion_i2c_hal_sleep_usec(20 * 1000);
return local_error;
}

int16_t sen66_get_sht_heater_measurements(int16_t* humidity,
int16_t* temperature) {
int16_t local_error = NO_ERROR;
uint8_t* buffer_ptr = communication_buffer;
uint16_t local_offset = 0;
local_offset =
sensirion_i2c_add_command16_to_buffer(buffer_ptr, local_offset, 0x6790);
local_error =
sensirion_i2c_write_data(_i2c_address, buffer_ptr, local_offset);
if (local_error != NO_ERROR) {
return local_error;
}
sensirion_i2c_hal_sleep_usec(20 * 1000);
local_error = sensirion_i2c_read_data_inplace(_i2c_address, buffer_ptr, 4);
if (local_error != NO_ERROR) {
return local_error;
}
*humidity = sensirion_common_bytes_to_int16_t(&buffer_ptr[0]);
*temperature = sensirion_common_bytes_to_int16_t(&buffer_ptr[2]);
return local_error;
}

Expand Down Expand Up @@ -782,6 +804,27 @@ int16_t sen66_get_serial_number(int8_t* serial_number,
return local_error;
}

int16_t sen66_get_version(uint8_t* firmware_major, uint8_t* firmware_minor) {
int16_t local_error = NO_ERROR;
uint8_t* buffer_ptr = communication_buffer;
uint16_t local_offset = 0;
local_offset =
sensirion_i2c_add_command16_to_buffer(buffer_ptr, local_offset, 0xd100);
local_error =
sensirion_i2c_write_data(_i2c_address, buffer_ptr, local_offset);
if (local_error != NO_ERROR) {
return local_error;
}
sensirion_i2c_hal_sleep_usec(20 * 1000);
local_error = sensirion_i2c_read_data_inplace(_i2c_address, buffer_ptr, 2);
if (local_error != NO_ERROR) {
return local_error;
}
*firmware_major = (uint8_t)buffer_ptr[0];
*firmware_minor = (uint8_t)buffer_ptr[1];
return local_error;
}

int16_t sen66_read_device_status(sen66_device_status* device_status) {
int16_t local_error = NO_ERROR;
uint8_t* buffer_ptr = communication_buffer;
Expand Down
51 changes: 46 additions & 5 deletions sen66_i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Generator: sensirion-driver-generator 1.1.2
* Product: sen66
* Model-Version: 1.5.0
* Model-Version: 1.6.0
*/
/*
* Copyright (c) 2025, Sensirion AG
Expand Down Expand Up @@ -70,8 +70,10 @@ typedef enum {
SEN66_SET_SENSOR_ALTITUDE_CMD_ID = 0x6736,
SEN66_GET_SENSOR_ALTITUDE_CMD_ID = 0x6736,
SEN66_ACTIVATE_SHT_HEATER_CMD_ID = 0x6765,
SEN66_GET_SHT_HEATER_MEASUREMENTS_CMD_ID = 0x6790,
SEN66_GET_PRODUCT_NAME_CMD_ID = 0xd014,
SEN66_GET_SERIAL_NUMBER_CMD_ID = 0xd033,
SEN66_GET_VERSION_CMD_ID = 0xd100,
SEN66_READ_DEVICE_STATUS_CMD_ID = 0xd206,
SEN66_READ_AND_CLEAR_DEVICE_STATUS_CMD_ID = 0xd210,
SEN66_DEVICE_RESET_CMD_ID = 0xd304,
Expand Down Expand Up @@ -910,16 +912,42 @@ int16_t sen66_get_sensor_altitude(uint16_t* altitude);
*
* This command allows to use the inbuilt heater in SHT sensor to reverse creep
* at high humidity. This command activates the SHT sensor heater with 200mW for
* 1s. The heater is then automatically deactivated again. Wait at least 20s
* after this command before starting a measurement to get coherent temperature
* values (heating consequence to disappear).
* 1s. The heater is then automatically deactivated again. The
* "get_sht_heater_measurements" command can be used to check if the heater has
* finished (firmware version >= 4.0). Wait at least 20s after this command
* before starting a measurement to get coherent temperature values (heating
* consequence to disappear).
*
* @note This command is only available in idle mode.
* @note This command is only available in idle mode. For firmware version <
* 4.0, wait for at least 1300ms before sending another command, to ensure
* heating is finsihed.
*
* @return error_code 0 on success, an error code otherwise.
*/
int16_t sen66_activate_sht_heater();

/**
* @brief Get the measurement values when the SHT sensor heating is finished.
*
* Get the measured values when the SHT sensor heating is triggerd. If the
* heating is not finished, the returned humidity and temperature values are
* 0x7FFF.
*
* @param[out] humidity Value is scaled with factor 100: RH [%] = value / 100
* *Note: If this value is not available, 0x7FFF is returned.*
* @param[out] temperature Value is scaled with factor 200: T [°C] = value / 200
* *Note: If this value is not available, 0x7FFF is returned.*
*
* @note This command is only availble in idle mode. This command is only
* available for firmware version >= 4.0. This command must be used after the
* "activate_sht_heater" command. The get_sht_heater_measurements command can be
* queried every 0.05s to get the measurements.
*
* @return error_code 0 on success, an error code otherwise.
*/
int16_t sen66_get_sht_heater_measurements(int16_t* humidity,
int16_t* temperature);

/**
* @brief sen66_get_product_name
*
Expand All @@ -946,6 +974,19 @@ int16_t sen66_get_product_name(int8_t* product_name,
int16_t sen66_get_serial_number(int8_t* serial_number,
uint16_t serial_number_size);

/**
* @brief sen66_get_version
*
* Gets the version information for the hardware, firmware and communication
* protocol.
*
* @param[out] firmware_major Firmware major version number.
* @param[out] firmware_minor Firmware minor version number.
*
* @return error_code 0 on success, an error code otherwise.
*/
int16_t sen66_get_version(uint8_t* firmware_major, uint8_t* firmware_minor);

/**
* @brief sen66_read_device_status
*
Expand Down