templog7 2.1.0.0
Temp-Log 7 Click Driver

API for configuring and manipulating Temp-Log 7 Click driver. More...

Topics

 Temp-Log 7 Commands List
 List of commands of Temp-Log 7 Click driver.
 
 Temp-Log 7 Settings
 Settings of Temp-Log 7 Click driver.
 
 Temp-Log 7 MikroBUS Map
 MikroBUS pin mapping of Temp-Log 7 Click driver.
 

Functions

void templog7_cfg_setup (templog7_cfg_t *cfg)
 Temp-Log 7 configuration object setup function.
 
void templog7_gpio_selection (templog7_cfg_t *cfg, templog7_gpio_sel_t gpio_sel)
 Temp-Log 7 driver interface setup function.
 
err_t templog7_init (templog7_t *ctx, templog7_cfg_t *cfg)
 Temp-Log 7 initialization function.
 
err_t templog7_default_cfg (templog7_t *ctx)
 Temp-Log 7 default configuration function.
 
err_t templog7_check_communication (templog7_t *ctx)
 Temp-Log 7 check communication function.
 
err_t templog7_select_device (templog7_t *ctx)
 Temp-Log 7 select device function.
 
err_t templog7_write_scratchpad_1 (templog7_t *ctx, templog7_scratchpad_1_t *scratchpad)
 Temp-Log 7 write scratchpad 1 function.
 
err_t templog7_read_scratchpad_1 (templog7_t *ctx, templog7_scratchpad_1_t *scratchpad)
 Temp-Log 7 read scratchpad 1 function.
 
err_t templog7_copy_scratchpad_1 (templog7_t *ctx)
 Temp-Log 7 copy scratchpad 1 function.
 
err_t templog7_write_scratchpad_2 (templog7_t *ctx, templog7_scratchpad_2_t *scratchpad)
 Temp-Log 7 write scratchpad 2 function.
 
err_t templog7_read_scratchpad_2 (templog7_t *ctx, templog7_scratchpad_2_t *scratchpad)
 Temp-Log 7 read scratchpad 2 function.
 
err_t templog7_copy_scratchpad_2 (templog7_t *ctx)
 Temp-Log 7 copy scratchpad 2 function.
 
err_t templog7_start_measurement (templog7_t *ctx)
 Temp-Log 7 start measurement function.
 
err_t templog7_read_temperature (templog7_t *ctx, float *temperature)
 Temp-Log 7 read temperature function.
 
err_t templog7_write_eeprom (templog7_t *ctx, uint16_t address, uint8_t *data_in, uint16_t len)
 Temp-Log 7 write EEPROM function.
 
err_t templog7_read_eeprom (templog7_t *ctx, uint16_t address, uint8_t *data_out, uint16_t len)
 Temp-Log 7 read EEPROM function.
 
err_t templog7_clear_eeprom (templog7_t *ctx)
 Temp-Log 7 clear EEPROM function.
 
err_t templog7_write_gpio (templog7_t *ctx, uint8_t data_in)
 Temp-Log 7 write gpio function.
 
err_t templog7_read_gpio (templog7_t *ctx, uint8_t *data_out)
 Temp-Log 7 read gpio function.
 
uint8_t templog7_get_alert_pin (templog7_t *ctx)
 Temp-Log 7 get alert pin function.
 

Detailed Description

API for configuring and manipulating Temp-Log 7 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

◆ templog7_cfg_setup()

void templog7_cfg_setup ( templog7_cfg_t * cfg)

Temp-Log 7 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ templog7_check_communication()

err_t templog7_check_communication ( templog7_t * ctx)

Temp-Log 7 check communication function.

This function checks the communication by reading the ROM address as well as verifying family code and CRC 8.

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

◆ templog7_clear_eeprom()

err_t templog7_clear_eeprom ( templog7_t * ctx)

Temp-Log 7 clear EEPROM function.

This function clears the whole EEPROM memory.

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

◆ templog7_copy_scratchpad_1()

err_t templog7_copy_scratchpad_1 ( templog7_t * ctx)

Temp-Log 7 copy scratchpad 1 function.

This function copies the scratchpad 1 registers to the EEPROM config memory.

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

◆ templog7_copy_scratchpad_2()

err_t templog7_copy_scratchpad_2 ( templog7_t * ctx)

Temp-Log 7 copy scratchpad 2 function.

This function copies the content of scratchpad 2 to the EEPROM memory.

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

◆ templog7_default_cfg()

err_t templog7_default_cfg ( templog7_t * ctx)

Temp-Log 7 default configuration function.

This function executes a default configuration of Temp-Log 7 click board.

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

◆ templog7_get_alert_pin()

uint8_t templog7_get_alert_pin ( templog7_t * ctx)

Temp-Log 7 get alert pin function.

This function returns the alert pin logic state.

Parameters
[in]ctx: Click context object. See templog7_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ templog7_gpio_selection()

void templog7_gpio_selection ( templog7_cfg_t * cfg,
templog7_gpio_sel_t gpio_sel )

Temp-Log 7 driver interface setup function.

This function sets a communication GPIO pin which will be used further in the click driver.

Parameters
[out]cfg: Click configuration structure. See templog7_cfg_t object definition for detailed explanation.
[in]gpio_sel: GPIO pin selection. See templog7_gpio_sel_t object definition for detailed explanation.
Returns
Nothing.
Note
This gpio selection should be call before init function to configure the driver to work with the serial interface which is consistent with the real state of the hardware. If this function is not called, the default driver interface will be set.

◆ templog7_init()

err_t templog7_init ( templog7_t * ctx,
templog7_cfg_t * cfg )

Temp-Log 7 initialization function.

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

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

◆ templog7_read_eeprom()

err_t templog7_read_eeprom ( templog7_t * ctx,
uint16_t address,
uint8_t * data_out,
uint16_t len )

Temp-Log 7 read EEPROM function.

This function reads a desired number of data bytes from the EEPROM memory.

Parameters
[in]ctx: Click context object. See templog7_t object definition for detailed explanation.
[in]address: Starting EEPROM address (0x00-0xFF), must be rounded to 8 bytes block.
[out]data_out: Data buffer read from EEPROM memory.
[in]len: Number of data bytes to read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ templog7_read_gpio()

err_t templog7_read_gpio ( templog7_t * ctx,
uint8_t * data_out )

Temp-Log 7 read gpio function.

This function reads data from the GPIO read register.

Parameters
[in]ctx: Click context object. See templog7_t object definition for detailed explanation.
[in]data_out: GPIO read register data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ templog7_read_scratchpad_1()

err_t templog7_read_scratchpad_1 ( templog7_t * ctx,
templog7_scratchpad_1_t * scratchpad )

Temp-Log 7 read scratchpad 1 function.

This function reads data from scratchpad 1 using One Wire communication protocol.

Parameters
[in]ctx: Click context object. See templog7_t object definition for detailed explanation.
[out]scratchpad: Output read scratchpad. See templog7_scratchpad_1_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ templog7_read_scratchpad_2()

err_t templog7_read_scratchpad_2 ( templog7_t * ctx,
templog7_scratchpad_2_t * scratchpad )

Temp-Log 7 read scratchpad 2 function.

This function reads data from scratchpad 2 using One Wire communication protocol.

Parameters
[in]ctx: Click context object. See templog7_t object definition for detailed explanation.
[in,out]scratchpad: Output read scratchpad, address field must be set. See templog7_scratchpad_2_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ templog7_read_temperature()

err_t templog7_read_temperature ( templog7_t * ctx,
float * temperature )

Temp-Log 7 read temperature function.

This function starts the one shot measurement and reads the temperature value in Celsius.

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

◆ templog7_select_device()

err_t templog7_select_device ( templog7_t * ctx)

Temp-Log 7 select device function.

This function selects the device by performing a skip or match ROM commands depending on the address value set in the ctx->address.

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

◆ templog7_start_measurement()

err_t templog7_start_measurement ( templog7_t * ctx)

Temp-Log 7 start measurement function.

This function starts the measurement by sending the convert temperature command.

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

◆ templog7_write_eeprom()

err_t templog7_write_eeprom ( templog7_t * ctx,
uint16_t address,
uint8_t * data_in,
uint16_t len )

Temp-Log 7 write EEPROM function.

This function writes a desired number of data bytes to the EEPROM memory.

Parameters
[in]ctx: Click context object. See templog7_t object definition for detailed explanation.
[in]address: Starting EEPROM address (0x00-0xFF), must be rounded to 8 bytes block.
[in]data_in: Data buffer to be written.
[in]len: Number of data bytes to write.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ templog7_write_gpio()

err_t templog7_write_gpio ( templog7_t * ctx,
uint8_t data_in )

Temp-Log 7 write gpio function.

This function writes data to the GPIO config register.

Parameters
[in]ctx: Click context object. See templog7_t object definition for detailed explanation.
[in]data_in: GPIO config register data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ templog7_write_scratchpad_1()

err_t templog7_write_scratchpad_1 ( templog7_t * ctx,
templog7_scratchpad_1_t * scratchpad )

Temp-Log 7 write scratchpad 1 function.

This function writes data to scratchpad 1 using One Wire communication protocol.

Parameters
[in]ctx: Click context object. See templog7_t object definition for detailed explanation.
[in]scratchpad: Scratchpad to be written. See templog7_scratchpad_1_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ templog7_write_scratchpad_2()

err_t templog7_write_scratchpad_2 ( templog7_t * ctx,
templog7_scratchpad_2_t * scratchpad )

Temp-Log 7 write scratchpad 2 function.

This function writes data to scratchpad 2 using One Wire communication protocol.

Parameters
[in]ctx: Click context object. See templog7_t object definition for detailed explanation.
[in]scratchpad: Scratchpad to be written. See templog7_scratchpad_2_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.