Library for the Measurement Specialties' HTU21D Humidity and Temperature sensor. Code includes device's heater on/off control, serial number access, dew point calculations and RTOS hooks. To date, code tested on GR-PEACH, K64F and KL25Z boards with and w/o RTOS, SDFlash and USB serial Rx interrupts.

Dependents:   BLE_soil_humidity

Embed: (wiki syntax)

« Back to documentation index

htu21d::HTU21snStruct Struct Reference

htu21d::HTU21snStruct Struct Reference

Structure to access HTU21D's serial number

  • HTU21D_sna is the hi 16 bit word of the s/n, always is 0x4854
  • HTU21D_snb is the mid 32 bit word of the s/n, 0x00--------
  • HTU21D_snc is the low 16 bit word of the s/n, 0x32--
  • The complete 64 bit s/n value is: 0x48 54 00 -- -- -- 32 --
  • The numbers shown are fixed fields
  • The '-' numbers are variable
  • For reference, the CRC values for the s/n are included.
More...

#include <htu21d.h>

Data Fields

uint16_t HTU21D_sna
 Highest order 16 bit word of SN

  • Value always = 0x4854.

uint32_t HTU21D_snb
 Middle order 32 bit word of SN

  • Value = 0x00--------
  • Highest byte always = 0x00
  • Lower 3 bytes are variable.

uint16_t HTU21D_snc
 Lowest order 16 bit word of SN

  • Value = 0x32--
  • Highest byte always = 0x32
  • Lowest byte is variable.

uint8_t HTU21D_crca
 Single byte checksum from HTU21D_sna.
uint32_t HTU21D_crcb
 Four byte checksum from HTU21D_snb.
uint8_t HTU21D_crcc
 Single byte checksum from HTU21D_snc.

Detailed Description

Structure to access HTU21D's serial number

  • HTU21D_sna is the hi 16 bit word of the s/n, always is 0x4854
  • HTU21D_snb is the mid 32 bit word of the s/n, 0x00--------
  • HTU21D_snc is the low 16 bit word of the s/n, 0x32--
  • The complete 64 bit s/n value is: 0x48 54 00 -- -- -- 32 --
  • The numbers shown are fixed fields
  • The '-' numbers are variable
  • For reference, the CRC values for the s/n are included.

Definition at line 209 of file htu21d.h.


Field Documentation

uint8_t HTU21D_crca

Single byte checksum from HTU21D_sna.

Definition at line 223 of file htu21d.h.

uint32_t HTU21D_crcb

Four byte checksum from HTU21D_snb.

Definition at line 225 of file htu21d.h.

uint8_t HTU21D_crcc

Single byte checksum from HTU21D_snc.

Definition at line 227 of file htu21d.h.

uint16_t HTU21D_sna

Highest order 16 bit word of SN

  • Value always = 0x4854.

Definition at line 210 of file htu21d.h.

uint32_t HTU21D_snb

Middle order 32 bit word of SN

  • Value = 0x00--------
  • Highest byte always = 0x00
  • Lower 3 bytes are variable.

Definition at line 213 of file htu21d.h.

uint16_t HTU21D_snc

Lowest order 16 bit word of SN

  • Value = 0x32--
  • Highest byte always = 0x32
  • Lowest byte is variable.

Definition at line 218 of file htu21d.h.