templog2 2.0.0.0

Functions

void templog2_cfg_setup (templog2_cfg_t *cfg)
 Configuration Object Setup function.
 
TEMPLOG2_RETVAL templog2_init (templog2_t *ctx, templog2_cfg_t *cfg)
 Click Initialization function.
 
void templog2_default_config (templog2_t *ctx)
 Click Default Configuration function.
 
TEMPLOG2_RETVAL templog2_write_reg (templog2_t *ctx, uint8_t reg_addr, uint16_t transfer_data)
 Write Register function.
 
TEMPLOG2_RETVAL templog2_read_reg (templog2_t *ctx, uint8_t reg_addr, uint16_t *data_out)
 Read Register function.
 
uint8_t templog2_data_ready (templog2_t *ctx)
 Data Ready function.
 
uint8_t templog2_check_alert (templog2_t *ctx)
 Alert Checking function.
 
float templog2_read_temp (templog2_t *ctx)
 Read Temperature function.
 
TEMPLOG2_RETVAL templog2_set_mode (templog2_t *ctx, uint8_t op_mode, uint8_t alert_mode)
 Mode Setting function.
 
TEMPLOG2_RETVAL templog2_write_eeprom (templog2_t *ctx, uint8_t eeprom_addr, uint16_t data_in)
 EEPROM Writing function.
 
void templog2_reset (templog2_t *ctx)
 Reset function.
 

Detailed Description

Function Documentation

◆ templog2_cfg_setup()

void templog2_cfg_setup ( templog2_cfg_t * cfg)

Configuration Object Setup 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. ADDR SEL will be set to 0 (false) by default.

◆ templog2_check_alert()

uint8_t templog2_check_alert ( templog2_t * ctx)

Alert Checking function.

Parameters
ctxClick object.
Returns
0 or 1.

@description This function returns the state of the Alert pin on the Temp-Log 2 click.

◆ templog2_data_ready()

uint8_t templog2_data_ready ( templog2_t * ctx)

Data Ready function.

Parameters
ctxClick object.
Returns
Data ready and limit detection flags (0b0000 0xxx).

@description This function checks data ready and limit status flags.

◆ templog2_default_config()

void templog2_default_config ( templog2_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Temp-Log 2 click.

◆ templog2_init()

TEMPLOG2_RETVAL templog2_init ( templog2_t * ctx,
templog2_cfg_t * cfg )

Click Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.
Returns
0x00 - Ok, 0xFD - Driver init error.

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

◆ templog2_read_reg()

TEMPLOG2_RETVAL templog2_read_reg ( templog2_t * ctx,
uint8_t reg_addr,
uint16_t * data_out )

Read Register function.

Parameters
ctxClick object.
reg_addrRegister address.
data_outData output.
Returns
0x00 - Ok, 0xFF - Invalid register address.

@description This function reads 16-bit data from the desired register.

◆ templog2_read_temp()

float templog2_read_temp ( templog2_t * ctx)

Read Temperature function.

Parameters
ctxClick object.
Returns
Temperature [Celsius degrees].

@description This function returns temperature calculated to Celsius degrees.

◆ templog2_reset()

void templog2_reset ( templog2_t * ctx)

Reset function.

Parameters
ctxClick object.

@description This function executes a device reset and makes 1 second delay until device was stabilized.

◆ templog2_set_mode()

TEMPLOG2_RETVAL templog2_set_mode ( templog2_t * ctx,
uint8_t op_mode,
uint8_t alert_mode )

Mode Setting function.

Parameters
ctxClick object.
op_modeOperating mode setting.
alert_modeAlert mode setting.
Returns
0x00 - Ok, 0xFE - Invalid parameter value.

@description This function allows user to set operating and alert mode.

◆ templog2_write_eeprom()

TEMPLOG2_RETVAL templog2_write_eeprom ( templog2_t * ctx,
uint8_t eeprom_addr,
uint16_t data_in )

EEPROM Writing function.

Parameters
ctxClick object.
eeprom_addrRegister address.
data_inData to be written.
Returns
0x00 - Ok, 0xFF - Invalid register address.

@description This function writes data to EEPROM.

◆ templog2_write_reg()

TEMPLOG2_RETVAL templog2_write_reg ( templog2_t * ctx,
uint8_t reg_addr,
uint16_t transfer_data )

Write Register function.

Parameters
ctxClick object.
reg_addrRegister address.
transfer_dataData to be written.
Returns
0x00 - Ok, 0xFF - Invalid register address.

@description This function writes 16-bit data to the desired register.