temphum2 2.0.0.0

Functions

void temphum2_cfg_setup (temphum2_cfg_t *cfg)
 Config Object Initialization function.
 
TEMPHUM2_RETVAL temphum2_init (temphum2_t *ctx, temphum2_cfg_t *cfg)
 Initialization function.
 
void temphum2_default_cfg (temphum2_t *ctx)
 Click Default Configuration function.
 
void temphum2_generic_write (temphum2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void temphum2_generic_read (temphum2_t *ctx, uint8_t *tx_buf, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint8_t temphum2_read_firmware_revision (temphum2_t *ctx)
 This function for reads Firmware Revision.
 
void temhum2_get_eletronic_id (temphum2_t *ctx, uint8_t *electronic_id)
 This function for reads Eletronic ID.
 
uint8_t temphum2_get_query_device (temphum2_t *ctx)
 This function for reads Query Device.
 
void temphum2_set_mode (uint8_t select_mode, uint8_t speed_mode)
 Functions for set measurement mode.
 
void temphum2_get_measurement (temphum2_t *ctx, float *data_buffer)
 Functions for mesurement.
 

Detailed Description

Function Documentation

◆ temhum2_get_eletronic_id()

void temhum2_get_eletronic_id ( temphum2_t * ctx,
uint8_t * electronic_id )

This function for reads Eletronic ID.

Parameters
ctxClick object.
electronicI_idbuffer that will be written 8 elements Eletronic ID

◆ temphum2_cfg_setup()

void temphum2_cfg_setup ( temphum2_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ temphum2_default_cfg()

void temphum2_default_cfg ( temphum2_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.
Note
   Set: TEMPHUM2_NO_HOLD_MODE
         - TEMPHUM2_NORMAL_MODE
   Set: TEMPHUM2_REG_WRITE_HEATER_CONTROL
         - TEMPHUM2_HEATER_ENABLE | TEMPHUM2_HEATER_CURRENT_6_4mA
@description This function executes default configuration for TempHum2 click.

◆ temphum2_generic_read()

void temphum2_generic_read ( temphum2_t * ctx,
uint8_t * tx_buf,
uint8_t * data_buf,
uint8_t len )

Generic read function.

Parameters
ctxClick object.
tx_bufRegister buffer.
data_bufOutput data buf
lenNumber of the bytes to be read

@description This function reads data from the desired register.

◆ temphum2_generic_write()

void temphum2_generic_write ( temphum2_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic write function.

Parameters
ctxClick object.
regRegister address.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

@description This function writes data to the desired register.

◆ temphum2_get_measurement()

void temphum2_get_measurement ( temphum2_t * ctx,
float * data_buffer )

Functions for mesurement.

Parameters
ctxClick object.
data_bufferbuffer that will be written Temperature and Humidity data

Data: data_buffer[ 0 ] - Temperature data_buffer[ 1 ] - Humidity

◆ temphum2_get_query_device()

uint8_t temphum2_get_query_device ( temphum2_t * ctx)

This function for reads Query Device.

Parameters
ctxClick object.
Returns
QUERY_DEVICE_OK - if the read the response is 0x00 0x47 0x2B QUERY_DEVICE_ERROR - if the read data is not good

◆ temphum2_init()

TEMPHUM2_RETVAL temphum2_init ( temphum2_t * ctx,
temphum2_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ temphum2_read_firmware_revision()

uint8_t temphum2_read_firmware_revision ( temphum2_t * ctx)

This function for reads Firmware Revision.

Parameters
ctxClick object.
Returns
Firmware Revision ( 0x10 = Firmware version 1.0 )

◆ temphum2_set_mode()

void temphum2_set_mode ( uint8_t select_mode,
uint8_t speed_mode )

Functions for set measurement mode.

Parameters
select_modeTEMPHUM2_NO_HOLD_MODE(default) or TEMPHUM2_HOLD_MODE
speend_modeTEMPHUM2_NORMAL_MODE(default) or TEMPHUM2_FAST_MODE