OpenBIC
OpenSource Bridge-IC
tmp431.c File Reference
#include "tmp431.h"
#include <stdio.h>
#include <stdlib.h>
#include "sensor.h"
#include "hal_i2c.h"
#include "libutil.h"
#include <logging/log.h>
Include dependency graph for tmp431.c:

Classes

struct  _temp_mapping_register
 

Macros

#define TMP432_STATUS_REG   0x02
 
#define TMP432_OPEN_STATUS_REG   0x1B
 
#define TMP432_HIGH_LIMIT_STATUS_REG   0x35
 
#define TMP432_LOW_LIMIT_STATUS_REG   0x36
 
#define I2C_DATA_SIZE   5
 
#define RANGE_0_127   0
 
#define RANGE_m55_150   1
 

Typedefs

typedef struct _temp_mapping_register temp_mapping_register
 

Functions

 LOG_MODULE_REGISTER (dev_tmp431)
 
bool get_tmp432_two_byte_limit (sensor_cfg *cfg, uint8_t temp_threshold_index, uint32_t *millidegree_celsius)
 
bool get_tmp432_one_byte_limit (sensor_cfg *cfg, uint8_t temp_threshold_index, uint32_t *millidegree_celsius)
 
bool tmp432_get_temp_threshold (sensor_cfg *cfg, uint8_t temp_threshold_index, uint32_t *millidegree_celsius)
 
bool set_tmp432_two_byte_limit (sensor_cfg *cfg, uint8_t temp_threshold_index, uint32_t *millidegree_celsius)
 
bool set_tmp432_one_byte_limit (sensor_cfg *cfg, uint8_t temp_threshold_index, uint32_t *millidegree_celsius)
 
bool tmp432_set_temp_threshold (sensor_cfg *cfg, uint8_t temp_threshold_index, uint32_t *millidegree_celsius)
 
uint8_t tmp431_read (sensor_cfg *cfg, int *reading)
 
bool tmp432_get_temp_status (sensor_cfg *cfg, uint8_t *temp_status)
 
bool tmp432_clear_temp_status (sensor_cfg *cfg)
 
uint8_t tmp431_init (sensor_cfg *cfg)
 

Variables

temp_mapping_register tmp432_temp_register_map []
 

Macro Definition Documentation

◆ I2C_DATA_SIZE

#define I2C_DATA_SIZE   5

◆ RANGE_0_127

#define RANGE_0_127   0

◆ RANGE_m55_150

#define RANGE_m55_150   1

◆ TMP432_HIGH_LIMIT_STATUS_REG

#define TMP432_HIGH_LIMIT_STATUS_REG   0x35

◆ TMP432_LOW_LIMIT_STATUS_REG

#define TMP432_LOW_LIMIT_STATUS_REG   0x36

◆ TMP432_OPEN_STATUS_REG

#define TMP432_OPEN_STATUS_REG   0x1B

◆ TMP432_STATUS_REG

#define TMP432_STATUS_REG   0x02

Typedef Documentation

◆ temp_mapping_register

Function Documentation

◆ get_tmp432_one_byte_limit()

bool get_tmp432_one_byte_limit ( sensor_cfg cfg,
uint8_t  temp_threshold_index,
uint32_t *  millidegree_celsius 
)
Here is the call graph for this function:

◆ get_tmp432_two_byte_limit()

bool get_tmp432_two_byte_limit ( sensor_cfg cfg,
uint8_t  temp_threshold_index,
uint32_t *  millidegree_celsius 
)
Here is the call graph for this function:

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( dev_tmp431  )

◆ set_tmp432_one_byte_limit()

bool set_tmp432_one_byte_limit ( sensor_cfg cfg,
uint8_t  temp_threshold_index,
uint32_t *  millidegree_celsius 
)
Here is the call graph for this function:

◆ set_tmp432_two_byte_limit()

bool set_tmp432_two_byte_limit ( sensor_cfg cfg,
uint8_t  temp_threshold_index,
uint32_t *  millidegree_celsius 
)
Here is the call graph for this function:

◆ tmp431_init()

uint8_t tmp431_init ( sensor_cfg cfg)
Here is the call graph for this function:

◆ tmp431_read()

uint8_t tmp431_read ( sensor_cfg cfg,
int *  reading 
)
Here is the call graph for this function:

◆ tmp432_clear_temp_status()

bool tmp432_clear_temp_status ( sensor_cfg cfg)
Here is the call graph for this function:

◆ tmp432_get_temp_status()

bool tmp432_get_temp_status ( sensor_cfg cfg,
uint8_t *  temp_status 
)
Here is the call graph for this function:

◆ tmp432_get_temp_threshold()

bool tmp432_get_temp_threshold ( sensor_cfg cfg,
uint8_t  temp_threshold_index,
uint32_t *  millidegree_celsius 
)
Here is the call graph for this function:

◆ tmp432_set_temp_threshold()

bool tmp432_set_temp_threshold ( sensor_cfg cfg,
uint8_t  temp_threshold_index,
uint32_t *  millidegree_celsius 
)
Here is the call graph for this function:

Variable Documentation

◆ tmp432_temp_register_map

temp_mapping_register tmp432_temp_register_map[]
Initial value:
= {
}
@ REMOTE_1_LOW_LIMIT
Definition: sensor.h:788
@ REMOTE_2_HIGH_LIMIT
Definition: sensor.h:789
@ LOCAL_THERM_LIMIT
Definition: sensor.h:791
@ REMOTE_1_THERM_LIMIT
Definition: sensor.h:792
@ REMOTE_2_LOW_LIMIT
Definition: sensor.h:790
@ LOCAL_LOW_LIMIT
Definition: sensor.h:786
@ REMOTE_2_THERM_LIMIT
Definition: sensor.h:793
@ LOCAL_HIGH_LIMIT
Definition: sensor.h:785
@ REMOTE_1_HIGH_LIMIT
Definition: sensor.h:787
@ TMP432_REMOTE_1_LOW_LIMIT_HIGH_BYTE_WRITE_REG
Definition: tmp431.h:52
@ TMP432_LOCAL_LOW_LIMIT_HIGH_BYTE_WRITE_REG
Definition: tmp431.h:46
@ TMP432_REMOTE_1_HIGH_LIMIT_HIGH_BYTE_READ_REG
Definition: tmp431.h:48
@ TMP432_REMOTE_1_LOW_LIMIT_HIGH_BYTE_READ_REG
Definition: tmp431.h:51
@ TMP432_REMOTE_2_THERM_LIMIT_REG
Definition: tmp431.h:62
@ TMP432_REMOTE_2_HIGH_LIMIT_HIGH_BYTE_READ_REG
Definition: tmp431.h:54
@ TMP432_REMOTE_2_LOW_LIMIT_HIGH_BYTE_WRITE_REG
Definition: tmp431.h:58
@ TMP432_REMOTE_2_LOW_LIMIT_HIGH_BYTE_READ_REG
Definition: tmp431.h:57
@ TMP432_LOCAL_HIGH_LIMIT_HIGH_BYTE_WRITE_REG
Definition: tmp431.h:43
@ TMP432_LOCAL_LOW_LIMIT_HIGH_BYTE_READ_REG
Definition: tmp431.h:45
@ TMP432_LOCAL_HIGH_LIMIT_HIGH_BYTE_READ_REG
Definition: tmp431.h:42
@ TMP432_REMOTE_2_HIGH_LIMIT_HIGH_BYTE_WRITE_REG
Definition: tmp431.h:55
@ TMP432_LOCAL_THERM_LIMIT_REG
Definition: tmp431.h:60
@ TMP432_REMOTE_1_HIGH_LIMIT_HIGH_BYTE_WRITE_REG
Definition: tmp431.h:49
@ TMP432_REMOTE_1_THERM_LIMIT_REG
Definition: tmp431.h:61