templog7 2.1.0.0
|
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. | |
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.
void templog7_cfg_setup | ( | templog7_cfg_t * | cfg | ) |
Temp-Log 7 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See templog7_cfg_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See templog7_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t templog7_clear_eeprom | ( | templog7_t * | ctx | ) |
Temp-Log 7 clear EEPROM function.
This function clears the whole EEPROM memory.
[in] | ctx | : Click context object. See templog7_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See templog7_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See templog7_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See templog7_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t templog7_get_alert_pin | ( | templog7_t * | ctx | ) |
Temp-Log 7 get alert pin function.
This function returns the alert pin logic state.
[in] | ctx | : Click context object. See templog7_t object definition for detailed explanation. |
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.
[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. |
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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See templog7_t object definition for detailed explanation. |
[in] | data_out | : GPIO read register data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See templog7_t object definition for detailed explanation. |
[out] | temperature | : Temperature in Celsius. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See templog7_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See templog7_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See templog7_t object definition for detailed explanation. |
[in] | data_in | : GPIO config register data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.