tempalarm 2.1.0.0
Temp Alarm Click Driver

API for configuring and manipulating Temp Alarm Click driver. More...

Topics

 Temp Alarm Registers List
 List of registers of Temp Alarm Click driver.
 
 Temp Alarm Registers Settings
 Settings for registers of Temp Alarm Click driver.
 
 Temp Alarm MikroBUS Map
 MikroBUS pin mapping of Temp Alarm Click driver.
 

Functions

void tempalarm_cfg_setup (tempalarm_cfg_t *cfg)
 Temp Alarm configuration object setup function.
 
err_t tempalarm_init (tempalarm_t *ctx, tempalarm_cfg_t *cfg)
 Temp Alarm initialization function.
 
err_t tempalarm_default_cfg (tempalarm_t *ctx)
 Temp Alarm default configuration function.
 
err_t tempalarm_generic_write (tempalarm_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Temp Alarm I2C writing function.
 
err_t tempalarm_generic_read (tempalarm_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Temp Alarm I2C reading function.
 
uint8_t tempalarm_get_alr_pin (tempalarm_t *ctx)
 Temp Alarm get alarm pin state function.
 
uint8_t tempalarm_get_tcr_pin (tempalarm_t *ctx)
 Temp Alarm get critical temperature alert pin state function.
 
err_t tempalarm_write_reg (tempalarm_t *ctx, uint8_t reg, uint8_t data_in)
 Temp Alarm register writing function.
 
err_t tempalarm_read_reg (tempalarm_t *ctx, uint8_t reg, uint8_t *data_out)
 Temp Alarm register reading function.
 
err_t tempalarm_read_temperature (tempalarm_t *ctx, int8_t *temperature)
 Temp Alarm local sensor read temperature function.
 
err_t tempalarm_read_remote_temp (tempalarm_t *ctx, float *temperature)
 Temp Alarm remote sensor read temperature function.
 
err_t tempalarm_set_crit_thigh (tempalarm_t *ctx, int8_t max_temperature)
 Temp Alarm local sensor set critical high temperature function.
 
err_t tempalarm_set_limit_thigh (tempalarm_t *ctx, int8_t max_temperature)
 Temp Alarm local sensor set limit high temperature function.
 
err_t tempalarm_set_alarm_low_limit (tempalarm_t *ctx, float min_temperature)
 Temp Alarm remote sensor set limit low temperature function.
 
err_t tempalarm_set_alarm_high_limit (tempalarm_t *ctx, float max_temperature)
 Temp Alarm remote sensor set limit high temperature function.
 
err_t tempalarm_get_alarms (tempalarm_t *ctx, uint8_t *alarms)
 Temp Alarm read alarms state function.
 

Detailed Description

API for configuring and manipulating Temp Alarm Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ tempalarm_cfg_setup()

void tempalarm_cfg_setup ( tempalarm_cfg_t * cfg)

Temp Alarm configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See tempalarm_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ tempalarm_default_cfg()

err_t tempalarm_default_cfg ( tempalarm_t * ctx)

Temp Alarm default configuration function.

This function executes a default configuration of Temp Alarm click board.

Parameters
[in]ctx: Click context object. See tempalarm_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ tempalarm_generic_read()

err_t tempalarm_generic_read ( tempalarm_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

Temp Alarm I2C reading function.

This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See tempalarm_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Output read data.
[in]len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ tempalarm_generic_write()

err_t tempalarm_generic_write ( tempalarm_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

Temp Alarm I2C writing function.

This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See tempalarm_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
[in]len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ tempalarm_get_alarms()

err_t tempalarm_get_alarms ( tempalarm_t * ctx,
uint8_t * alarms )

Temp Alarm read alarms state function.

This function is used to read alarms state.

Parameters
[in]ctx: Click context object. See tempalarm_t object definition for detailed explanation.
[in]alarms: Alarm state.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ tempalarm_get_alr_pin()

uint8_t tempalarm_get_alr_pin ( tempalarm_t * ctx)

Temp Alarm get alarm pin state function.

This function is used to get alarm pin state.

Parameters
[in]ctx: Click context object. See tempalarm_t object definition for detailed explanation.
Returns
  • 0 - Pin state low,
  • 1 - Pin state high.
Note
None.

◆ tempalarm_get_tcr_pin()

uint8_t tempalarm_get_tcr_pin ( tempalarm_t * ctx)

Temp Alarm get critical temperature alert pin state function.

This function is used to get alarm critical temperature alert state.

Parameters
[in]ctx: Click context object. See tempalarm_t object definition for detailed explanation.
Returns
  • 0 - Pin state low,
  • 1 - Pin state high.
Note
None.

◆ tempalarm_init()

err_t tempalarm_init ( tempalarm_t * ctx,
tempalarm_cfg_t * cfg )

Temp Alarm initialization function.

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

Parameters
[out]ctx: Click context object. See tempalarm_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See tempalarm_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ tempalarm_read_reg()

err_t tempalarm_read_reg ( tempalarm_t * ctx,
uint8_t reg,
uint8_t * data_out )

Temp Alarm register reading function.

This function reads a data byte from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See tempalarm_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ tempalarm_read_remote_temp()

err_t tempalarm_read_remote_temp ( tempalarm_t * ctx,
float * temperature )

Temp Alarm remote sensor read temperature function.

This function is used to read remote sensor in degrees of Celsius.

Parameters
[in]ctx: Click context object. See tempalarm_t object definition for detailed explanation.
[out]temperature: Temperature value.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ tempalarm_read_temperature()

err_t tempalarm_read_temperature ( tempalarm_t * ctx,
int8_t * temperature )

Temp Alarm local sensor read temperature function.

This function is used to read local sensor in degrees of Celsius.

Parameters
[in]ctx: Click context object. See tempalarm_t object definition for detailed explanation.
[out]temperature: Temperature value.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ tempalarm_set_alarm_high_limit()

err_t tempalarm_set_alarm_high_limit ( tempalarm_t * ctx,
float max_temperature )

Temp Alarm remote sensor set limit high temperature function.

This function is used to set remote sensor limit high temperature.

Parameters
[in]ctx: Click context object. See tempalarm_t object definition for detailed explanation.
[in]max_temperature: Temperature value.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ tempalarm_set_alarm_low_limit()

err_t tempalarm_set_alarm_low_limit ( tempalarm_t * ctx,
float min_temperature )

Temp Alarm remote sensor set limit low temperature function.

This function is used to set remote sensor limit low temperature.

Parameters
[in]ctx: Click context object. See tempalarm_t object definition for detailed explanation.
[in]min_temperature: Temperature value.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ tempalarm_set_crit_thigh()

err_t tempalarm_set_crit_thigh ( tempalarm_t * ctx,
int8_t max_temperature )

Temp Alarm local sensor set critical high temperature function.

This function is used to set local sensor critical high temperature.

Parameters
[in]ctx: Click context object. See tempalarm_t object definition for detailed explanation.
[in]max_temperature: Temperature value.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ tempalarm_set_limit_thigh()

err_t tempalarm_set_limit_thigh ( tempalarm_t * ctx,
int8_t max_temperature )

Temp Alarm local sensor set limit high temperature function.

This function is used to set local sensor limit high temperature.

Parameters
[in]ctx: Click context object. See tempalarm_t object definition for detailed explanation.
[in]max_temperature: Temperature value.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ tempalarm_write_reg()

err_t tempalarm_write_reg ( tempalarm_t * ctx,
uint8_t reg,
uint8_t data_in )

Temp Alarm register writing function.

This function writes data byte into the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See tempalarm_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.