templog3 2.0.0.0

Functions

void templog3_cfg_setup (templog3_cfg_t *cfg)
 Config Object Initialization function.
 
TEMPLOG3_RETVAL templog3_init (templog3_t *ctx, templog3_cfg_t *cfg)
 Initialization function.
 
void templog3_default_cfg (templog3_t *ctx)
 Click Default Configuration function.
 
uint8_t templog3_write_reg (templog3_t *ctx, uint8_t reg_addr, uint16_t data_in)
 Generic Write function.
 
uint8_t templog3_read_reg (templog3_t *ctx, uint8_t reg_addr, uint16_t *data_out)
 Generic Read function.
 
uint8_t templog3_set_addr_ptr (templog3_t *ctx, uint8_t reg_addr)
 Set Address Pointer function.
 
void templog3_repeated_read (templog3_t *ctx, uint16_t *data_out)
 Repeated Read function.
 
uint8_t templog3_get_temp (templog3_t *ctx, uint8_t temp_sel, float *temp_out)
 Get Temperature function.
 
uint8_t templog3_set_temp (templog3_t *ctx, uint8_t temp_sel, float temp_in)
 Set Temperature function.
 
uint8_t templog3_check_alarm (templog3_t *ctx)
 Alarm-Event Check function.
 
void templog3_wait_conv_done (templog3_t *ctx)
 Conversion Time function.
 
void templog3_eeprom_byte_write (templog3_t *ctx, uint8_t reg_addr, uint8_t data_in, uint8_t eeprom_mode)
 EEPROM Single Write function.
 
void templog3_eeprom_page_write (templog3_t *ctx, uint8_t reg_addr, uint8_t *data_in)
 EEPROM Page Write function.
 
void templog3_eeprom_curr_addr_read (templog3_t *ctx, uint8_t *current_address)
 EEPROM Current Address Read function.
 
void templog3_eeprom_byte_read (templog3_t *ctx, uint8_t reg_addr, uint8_t *data_out)
 EEPROM Single Read function.
 
uint8_t templog3_eeprom_sequential_read (templog3_t *ctx, uint8_t reg_addr, uint8_t *data_out, uint16_t num_bytes)
 EEPROM Sequential Read function.
 

Detailed Description

Function Documentation

◆ templog3_cfg_setup()

void templog3_cfg_setup ( templog3_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.

◆ templog3_check_alarm()

uint8_t templog3_check_alarm ( templog3_t * ctx)

Alarm-Event Check function.

Parameters
ctxClick object.
Returns
0 - OK, 1 - Alarming, when alarm (event) pin polarity is set to active high

@description Function checks the alarm (event) pin state.

◆ templog3_default_cfg()

void templog3_default_cfg ( templog3_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.
Note
     Set: TEMPLOG3_CONFIG_REG
           - TEMPLOG3_TLIMIT_HYST_0_DEG | 
           - TEMPLOG3_CONT_CONV_MODE | 
           - TEMPLOG3_EVENT_OUTPUT_EN | 
           - TEMPLOG3_EVENT_TCRIT_ONLY | 
           - TEMPLOG3_EVENT_POL_ACT_HIGH | 
           - TEMPLOG3_EVENT_COMPARATOR_MODE
   Set: TEMPLOG3_RESOLUTION_REG
           - TEMPLOG3_11BIT_RESOLUTION
   Set: TEMPLOG3_TEMP_CRITICAL_REG
           - 26.5
   Set: TEMPLOG3_TEMP_UPPER_REG
           - 30
   Set: TEMPLOG3_TEMP_LOWER_REG
           - -5

@description This function executes default configuration for TempLog3 click.

◆ templog3_eeprom_byte_read()

void templog3_eeprom_byte_read ( templog3_t * ctx,
uint8_t reg_addr,
uint8_t * data_out )

EEPROM Single Read function.

Parameters
ctxClick object.
reg_addrMemory address which from data byte be read
data_outMemory where data byte be placed

@description Function reads a one byte data from the EEPROM.

◆ templog3_eeprom_byte_write()

void templog3_eeprom_byte_write ( templog3_t * ctx,
uint8_t reg_addr,
uint8_t data_in,
uint8_t eeprom_mode )

EEPROM Single Write function.

Parameters
ctxClick object.
reg_addrMemory address where one byte data be written
data_inData byte to be written
eeprom_mode0 - EEPROM Write, 1 - SW Write Protection, 2 - Clear Write Protection

@description Function writes a one byte data to the EEPROM including/excluding a write protection.

◆ templog3_eeprom_curr_addr_read()

void templog3_eeprom_curr_addr_read ( templog3_t * ctx,
uint8_t * current_address )

EEPROM Current Address Read function.

Parameters
ctxClick object.
current_addressReturns the address of the last word accessed internally incremented by 1

@description Function returns the address of the last word accessed internally incremented by 1.

◆ templog3_eeprom_page_write()

void templog3_eeprom_page_write ( templog3_t * ctx,
uint8_t reg_addr,
uint8_t * data_in )

EEPROM Page Write function.

Parameters
ctxClick object.
reg_addrMemory start address which from a writing cycle be started
data_inData to be written, 16 bytes of data

@description Function writes a 16 bytes of data to the selected EEPROM page.

◆ templog3_eeprom_sequential_read()

uint8_t templog3_eeprom_sequential_read ( templog3_t * ctx,
uint8_t reg_addr,
uint8_t * data_out,
uint16_t num_bytes )

EEPROM Sequential Read function.

Parameters
ctxClick object.
reg_addrMemory start address which from a reading cycle be started
data_outMemory where data be placed
num_bytesNumber of bytes to be read
Returns
0 - OK, 4 - Number of bytes is out of range

@description Function reads a desired number of bytes from the EEPROM.

Note
Sum of the memory address and number of bytes must not be higher than 256.

◆ templog3_get_temp()

uint8_t templog3_get_temp ( templog3_t * ctx,
uint8_t temp_sel,
float * temp_out )

Get Temperature function.

Parameters
ctxClick object.
temp_selAddress of the desired temperature register
temp_outReturns a temperature value calculated to the Celsius degrees
Returns
0 - OK, 2 - Wrong address

@description Function gets a temperature value from the desired temperature register calculated to the Celsius degrees.

◆ templog3_init()

TEMPLOG3_RETVAL templog3_init ( templog3_t * ctx,
templog3_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ templog3_read_reg()

uint8_t templog3_read_reg ( templog3_t * ctx,
uint8_t reg_addr,
uint16_t * data_out )

Generic Read function.

Parameters
ctxClick object.
reg_addrAddress which from data be read
data_outMemory where 16bit data be placed
Returns
0 - OK, 2 - Wrong address

@description Function reads a 16bit data from the desired register.

◆ templog3_repeated_read()

void templog3_repeated_read ( templog3_t * ctx,
uint16_t * data_out )

Repeated Read function.

Parameters
ctxClick object.
data_outMemory where 16bit data be placed

@description Function reads a 16bit data from the register on which the internal address pointer was last set.

◆ templog3_set_addr_ptr()

uint8_t templog3_set_addr_ptr ( templog3_t * ctx,
uint8_t reg_addr )

Set Address Pointer function.

Parameters
ctxClick object.
reg_addrAddress on which the internal address pointer be set
Returns
0 - OK, 2 - Wrong address

@description Function sets the internal address pointer on the desired register address.

◆ templog3_set_temp()

uint8_t templog3_set_temp ( templog3_t * ctx,
uint8_t temp_sel,
float temp_in )

Set Temperature function.

Parameters
ctxClick object.
temp_selAddress of the desired temperature register
temp_inTemperature value to be written calculated to the Celsius degrees
Returns
0 - OK, 2 - Wrong address, 3 - Temperature value is out of range

@description Function sets a desired temperature register on the desired value calculated to the Celsius degrees.

◆ templog3_wait_conv_done()

void templog3_wait_conv_done ( templog3_t * ctx)

Conversion Time function.

Parameters
ctxClick object.

@description Function ensures that the minimum conversion time is met.

◆ templog3_write_reg()

uint8_t templog3_write_reg ( templog3_t * ctx,
uint8_t reg_addr,
uint16_t data_in )

Generic Write function.

Parameters
ctxClick object.
reg_addrAddress where data be written
data_in16bit data to be written
Returns
0 - OK, 2 - Wrong address

@description Function writes a 16bit data to the desired register.