64 #define HTSEN_I2C_ADDRESS (0x44u)
67 #define HTSEN_READ_TIMEOUT_10ms (10u)
70 #define HTSEN_TIME_MEAS_WAIT_10ms (2u)
73 #define HTSEN_TEMP_SCALING (175.0f)
74 #define HTSEN_TEMP_OFFSET (-45.0f)
75 #define HTSEN_TEMP_DEG_TO_DDEG (10.0f)
79 #define HTSEN_HUMIDITY_SCALING (100.0f)
80 #define HTSEN_FULL_SCALE (65535.0f)
84 #define HTSEN_TEMPERATURE_LSB (1u)
85 #define HTSEN_TEMPERATURE_MSB (0u)
86 #define HTSEN_TEMPERATURE_BYTE_CRC (2u)
87 #define HTSEN_HUMIDITY_LSB (4u)
88 #define HTSEN_HUMIDITY_MSB (3u)
89 #define HTSEN_HUMIDITY_BYTE_CRC (5u)
90 #define HTSEN_BYTE_SHIFT (8u)
91 #define HTSEN_MEASUREMENT_LENGTH_IN_BYTES (2u)
92 #define HTSEN_TOTAL_DATA_LENGTH_IN_BYTES (6u)
96 #define HTSEN_CRC_POLYNOMIAL (0x31u)
97 #define HTSEN_CRC_SEED (0xFF)
98 #define HTSEN_CRC_BYTE_SHIFT (0x8u)
99 #define HTSEN_CRC_MSB_MASK (0x80u)
100 #define HTSEN_CRC_8BIT_MASK (0xFFu)
132 #define HTSEN_CLOCK_STRETCHING (false)
133 #if (HTSEN_CLOCK_STRETCHING == false)
134 #define HTSEN_SINGLE_MEAS_MSB (0x24u)
135 #define HTSEN_HIGH_REPEATABILITY (0x00u)
136 #define HTSEN_MEDIUM_REPEATABILITY (0x0Bu)
137 #define HTSEN_LOW_REPEATABILITY (0x16u)
139 #define HTSEN_SINGLE_MEAS_MSB (0x2Cu)
140 #define HTSEN_HIGH_REPEATABILITY (0x06u)
141 #define HTSEN_MEDIUM_REPEATABILITY (0x0Du)
142 #define HTSEN_LOW_REPEATABILITY (0x10u)
145 #define HTSEN_SINGLE_MEAS_LSB (HTSEN_HIGH_REPEATABILITY)
198 for (uint8_t i = 0u; i < length; i++) {
215 return (int16_t)temperature_ddeg;
220 return (uint8_t)humidity_perc;
252 if (i2cReadReturn !=
STD_OK) {
290 #ifdef UNITY_UNIT_TEST
291 extern uint8_t TEST_HTSEN_TestCalculateCrc8(uint8_t *data, uint32_t length) {
#define DATA_WRITE_DATA(...)
#define FAS_ASSERT(x)
Assertion macro that asserts that x is true.
#define FAS_TRAP
Define that evaluates to essential boolean false thus tripping an assert.
#define NULL_PTR
Null pointer.
#define HTSEN_TEMPERATURE_BYTE_CRC
#define HTSEN_CRC_MSB_MASK
#define HTSEN_SINGLE_MEAS_LSB
static int16_t HTSEN_ConvertRawTemperature(uint16_t data)
computes temperature measurement from raw value.
static uint8_t HTSEN_ConvertRawHumidity(uint16_t data)
computes humidity measurement from raw value.
#define HTSEN_HUMIDITY_SCALING
#define HTSEN_I2C_ADDRESS
static uint8_t HTSEN_CalculateCrc8(const uint8_t *data, uint32_t length)
computes CRC8.
#define HTSEN_HUMIDITY_LSB
static uint8_t htsen_counter
#define HTSEN_READ_TIMEOUT_10ms
#define HTSEN_TEMP_OFFSET
#define HTSEN_TOTAL_DATA_LENGTH_IN_BYTES
#define HTSEN_TEMP_SCALING
#define HTSEN_TEMPERATURE_MSB
#define HTSEN_SINGLE_MEAS_MSB
#define HTSEN_TEMPERATURE_LSB
#define HTSEN_HUMIDITY_BYTE_CRC
#define HTSEN_TEMP_DEG_TO_DDEG
#define HTSEN_HUMIDITY_MSB
#define HTSEN_MEASUREMENT_LENGTH_IN_BYTES
static HTSEN_STATE_e htsen_state
describes the current state of the measurement
static DATA_BLOCK_HTSEN_s htsen_data
#define HTSEN_TIME_MEAS_WAIT_10ms
#define HTSEN_CRC_BYTE_SHIFT
static uint8_t htsen_timeout_10ms
#define HTSEN_CRC_POLYNOMIAL
#define HTSEN_CRC_8BIT_MASK
void HTSEN_Trigger(void)
triggers a measurement of the I2C humidity/temperature sensor.
Header for the driver for the Sensirion SHT35-DIS I2C humidity/temperature sensor.
STD_RETURN_TYPE_e I2C_WriteDirect(uint32_t slaveAddress, uint32_t nrBytes, uint8_t *writeData)
writes to an I2C slave, no register address written first, blocking.
STD_RETURN_TYPE_e I2C_ReadDirect(uint32_t slaveAddress, uint32_t nrBytes, uint8_t *readData)
reads from an I2C slave, no register address written first, blocking.
Header for the driver for the I2C module.
int16_t temperature_ddegC
DATA_BLOCK_HEADER_s header