thermoj 2.0.0.0
thermoj.h File Reference

This file contains API for Thermo J Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  thermoj_t
 Click ctx object definition. More...
 
struct  thermoj_cfg_t
 Click configuration structure definition. More...
 

Macros

#define THERMOJ_MAP_MIKROBUS(cfg, mikrobus)
 
#define THERMOJ_RETVAL   uint8_t
 
#define THERMOJ_OK   0x00
 
#define THERMOJ_INIT_ERROR   0xFF
 
#define THERMOJ_I2C_ADDR_0   0x60
 
#define THERMOJ_I2C_ADDR_1   0x67
 
#define THERMOJ_TH   0x00
 
#define THERMOJ_TD   0x01
 
#define THERMOJ_TC   0x02
 
#define THERMOJ_RAW_ADC_DATA   0x03
 
#define THERMOJ_STATUS   0x04
 
#define THERMOJ_SENSOR_CONFIG   0x05
 
#define THERMOJ_DEVICE_CONFIG   0x06
 
#define THERMOJ_ALERT1_CONFIG   0x08
 
#define THERMOJ_ALERT2_CONFIG   0x09
 
#define THERMOJ_ALERT3_CONFIG   0x0A
 
#define THERMOJ_Alert4_CONFIG   0x0B
 
#define THERMOJ_THYST1   0x0C
 
#define THERMOJ_THYST2   0x0D
 
#define THERMOJ_THYST3   0x0E
 
#define THERMOJ_THYST4   0x0F
 
#define THERMOJ_TALERT1   0x10
 
#define THERMOJ_TALERT2   0x11
 
#define THERMOJ_TALERT3   0x12
 
#define THERMOJ_TALERT4   0x13
 
#define THERMOJ_DEVICE_ID   0x20
 
#define THERMOJ_THERMOCOUPLE_TYPE_K   0x00
 
#define THERMOJ_THERMOCOUPLE_TYPE_J   0x01
 
#define THERMOJ_THERMOCOUPLE_TYPE_T   0x02
 
#define THERMOJ_THERMOCOUPLE_TYPE_N   0x03
 
#define THERMOJ_THERMOCOUPLE_TYPE_S   0x04
 
#define THERMOJ_THERMOCOUPLE_TYPE_E   0x05
 
#define THERMOJ_THERMOCOUPLE_TYPE_B   0x06
 
#define THERMOJ_THERMOCOUPLE_TYPE_R   0x07
 

Functions

void thermoj_cfg_setup (thermoj_cfg_t *cfg)
 Config Object Initialization function.
 
THERMOJ_RETVAL thermoj_init (thermoj_t *ctx, thermoj_cfg_t *cfg)
 Initialization function.
 
void thermoj_generic_write (thermoj_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void thermoj_generic_read (thermoj_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void thermoj_write_byte (thermoj_t *ctx, uint8_t reg_address, uint8_t write_data)
 Write the byte of data function.
 
uint8_t thermoj_read_byte (thermoj_t *ctx, uint8_t reg_address)
 Read the byte of data function.
 
uint8_t thermoj_get_status (thermoj_t *ctx)
 Get the status function.
 
uint8_t thermoj_check_burst_complete (thermoj_t *ctx)
 Check the status of burst complete function.
 
uint8_t thermoj_check_data_ready (thermoj_t *ctx)
 Check the status of data ready function.
 
uint8_t thermoj_check_over_voltage (thermoj_t *ctx)
 Check the status of over voltage function.
 
void thermoj_check_alert_status (thermoj_t *ctx, uint8_t *alert_1, uint8_t *alert_2, uint8_t *alert_3, uint8_t *alert_4)
 Write the byte of data function.
 
void thermoj_set_sensor_config (thermoj_t *ctx, uint8_t config_val)
 Set sensor configuration function.
 
void thermoj_set_thermocouple_type (thermoj_t *ctx, uint8_t thermocouple_type)
 Set thermocouple type sensor configuration function.
 
void thermoj_set_filter_coefficient (thermoj_t *ctx, uint8_t filter_coeff)
 Set filter coefficient sensor configuration function.
 
uint8_t thermoj_get_sensor_config (thermoj_t *ctx)
 Get sensor configuration function.
 
void thermoj_set_config (thermoj_t *ctx, uint8_t config_val)
 Set configuration function.
 
void thermoj_set_cold_junction_resolution (thermoj_t *ctx, uint8_t cj_res)
 Set cold-junction resolution function.
 
void thermoj_set_adc_resolution (thermoj_t *ctx, uint8_t adc_res)
 Set ADC measurement resolution function.
 
void thermoj_set_number_of_temperature_samples (thermoj_t *ctx, uint8_t num_temp_samp)
 Set number of temperature samples function.
 
void thermoj_set_shutdown_modes (thermoj_t *ctx, uint8_t sd_mod)
 Set shutdown modes function.
 
void thermoj_write_data (thermoj_t *ctx, uint8_t reg_address, uint16_t write_data)
 Write data function.
 
uint16_t thermoj_read_data (thermoj_t *ctx, uint8_t reg_address)
 Read data function.
 
uint8_t thermoj_get_device_id (thermoj_t *ctx)
 Get the device ID function.
 
float thermoj_get_temperature (thermoj_t *ctx)
 Get temperature function.
 
float thermoj_get_temperature_fahrenheit (thermoj_t *ctx)
 Get temperature ( Fahrenheit ) function.
 
uint8_t thermoj_get_alert_1 (thermoj_t *ctx)
 Get temperature alert 1 function.
 
uint8_t thermoj_get_alert_2 (thermoj_t *ctx)
 Get temperature alert 2 function.
 
uint8_t thermoj_get_alert_3 (thermoj_t *ctx)
 Get temperature alert 3 function.
 
uint8_t thermoj_get_alert_4 (thermoj_t *ctx)
 Get temperature alert 4 function.
 
void thermoj_set_alerts_limits (thermoj_t *ctx, uint8_t pos_alert, float temp_alert_limit)
 Set temperature alert limits function.
 
void thermoj_set_alert_config (thermoj_t *ctx, uint8_t pos_alert, uint8_t alert_config)
 Set alert configuration function.
 
void thermoj_enable_alert (thermoj_t *ctx, uint8_t pos_alert)
 Enable alerts function.
 
void thermoj_disable_alert (thermoj_t *ctx, uint8_t pos_alert)
 Disable alerts function.
 

Detailed Description

This file contains API for Thermo J Click driver.