hydroprobe 2.0.0.0

Functions

void hydroprobe_cfg_setup (hydroprobe_cfg_t *cfg)
 Config Object Initialization function.
 
HYDROPROBE_RETVAL hydroprobe_init (hydroprobe_t *ctx, hydroprobe_cfg_t *cfg)
 Initialization function.
 
void hydroprobe_generic_write (hydroprobe_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void hydroprobe_generic_read (hydroprobe_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint16_t hydroprobe_read_raw (hydroprobe_t *ctx)
 Read raw data function.
 
uint16_t hydroprobe_avg_val (hydroprobe_t *ctx)
 Get average value function.
 
uint16_t hydroprobe_max_val (hydroprobe_t *ctx)
 Get maximum value function.
 
uint16_t hydroprobe_min_val (hydroprobe_t *ctx)
 Get minimum value function.
 
uint8_t hydroprobe_rel_env_hum (hydroprobe_t *ctx, uint16_t dry_val, uint16_t wet_val)
 Get Relative humidity of the environment function.
 

Detailed Description

Function Documentation

◆ hydroprobe_avg_val()

uint16_t hydroprobe_avg_val ( hydroprobe_t * ctx)

Get average value function.

Parameters
ctxClick object.
Returns
result 16-bit value that represents average value

Function is used to read average value from 100 raw reads.

◆ hydroprobe_cfg_setup()

void hydroprobe_cfg_setup ( hydroprobe_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.

◆ hydroprobe_generic_read()

void hydroprobe_generic_read ( hydroprobe_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic read function.

Parameters
ctxClick object.
regRegister address.
data_bufOutput data buf
lenNumber of the bytes to be read

@description This function reads data from the desired register.

◆ hydroprobe_generic_write()

void hydroprobe_generic_write ( hydroprobe_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.

◆ hydroprobe_init()

HYDROPROBE_RETVAL hydroprobe_init ( hydroprobe_t * ctx,
hydroprobe_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ hydroprobe_max_val()

uint16_t hydroprobe_max_val ( hydroprobe_t * ctx)

Get maximum value function.

Parameters
ctxClick object.
Returns
result 16-bit value that represents maximum value

Function is used to read maximum value from 100 raw reads.

◆ hydroprobe_min_val()

uint16_t hydroprobe_min_val ( hydroprobe_t * ctx)

Get minimum value function.

Parameters
ctxClick object.
Returns
result 16-bit value that represents minimum value

Function is used to read minimum value from 100 raw reads.

◆ hydroprobe_read_raw()

uint16_t hydroprobe_read_raw ( hydroprobe_t * ctx)

Read raw data function.

Parameters
ctxClick object.
Returns
result 16-bit value that represents ADC value from output register

Function is used to read raw data from MCP3221.

◆ hydroprobe_rel_env_hum()

uint8_t hydroprobe_rel_env_hum ( hydroprobe_t * ctx,
uint16_t dry_val,
uint16_t wet_val )

Get Relative humidity of the environment function.

Parameters
ctxClick object.
dry_val16-bit value that represents adc value when probe is completely dry
wet_val16-bit value that represents adc value when probe is completely submerged in liquid
Returns
result 8-bit value that represents environment moisture content in percents

Function is used to get environment moisture content in percents.