presence 2.0.0.0
Public function

Functions

void presence_cfg_setup (presence_cfg_t *cfg)
 Config Object Initialization function.
 
err_t presence_init (presence_t *ctx, presence_cfg_t *cfg)
 Initialization function.
 
err_t presence_default_cfg (presence_t *ctx)
 Presence default configuration function.
 
err_t presence_generic_write (presence_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
err_t presence_generic_read (presence_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint8_t presence_get_int_state (presence_t *ctx)
 Get interrupt state function.
 
void presence_general_call_addr (presence_t *ctx)
 General call address.
 
err_t presence_eeprom_process (presence_t *ctx)
 EEPRM PROCESS.
 
float presence_get_calib_constants (presence_t *ctx)
 Calibration constant K.
 
err_t presence_ambient_temperature (presence_t *ctx, float *temperature)
 Ambient Temperature.
 
err_t presence_object_temperature (presence_t *ctx, float *temperature)
 Object Temperature.
 

Detailed Description

Function Documentation

◆ presence_ambient_temperature()

err_t presence_ambient_temperature ( presence_t * ctx,
float * temperature )

Ambient Temperature.

Parameters
ctxClick object.
temperatureTemperaure in C
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
This function returns ambient temperature in degrees Celsius.

◆ presence_cfg_setup()

void presence_cfg_setup ( presence_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ presence_default_cfg()

err_t presence_default_cfg ( presence_t * ctx)

Presence default configuration function.

This function executes a default configuration of Presence click board.

Parameters
[in]ctx: Click context object. See presence_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.

◆ presence_eeprom_process()

err_t presence_eeprom_process ( presence_t * ctx)

EEPRM PROCESS.

Parameters
ctxClick object.
Returns
Has it successfully read eeprom? [ 0 - YES ] or [ -1 - NO ]

This Function enables , read and dsiables the eeprom and then checks whether or not it as successfully read any data from it.

Note
This function must be performed at the start of each program in order to read and accommodate all calibration coefficients.

◆ presence_general_call_addr()

void presence_general_call_addr ( presence_t * ctx)

General call address.

Parameters
ctxClick object.

This function writes general call address and sets slave address.

◆ presence_generic_read()

err_t presence_generic_read ( presence_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
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
This function reads data from the desired register.

◆ presence_generic_write()

err_t presence_generic_write ( presence_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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
This function writes data to the desired register.

◆ presence_get_calib_constants()

float presence_get_calib_constants ( presence_t * ctx)

Calibration constant K.

Parameters
ctxClick object.
Returns
K value

This function returns calbration constant's K value.

◆ presence_get_int_state()

uint8_t presence_get_int_state ( presence_t * ctx)

Get interrupt state function.

Parameters
ctxClick object.

This function reads state from int pin.

◆ presence_init()

err_t presence_init ( presence_t * ctx,
presence_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ presence_object_temperature()

err_t presence_object_temperature ( presence_t * ctx,
float * temperature )

Object Temperature.

Parameters
ctxClick object.
temperatureTemperaure in C
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
This function returns object temperature.