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

Classes

struct  _temp_mapping_register
 

Macros

#define EMC1413_STATUS_REG   0x02
 
#define EMC1413_EXTERNAL_DIODE_FAULT_REG   0x1B
 
#define EMC1413_HIGH_LIMIT_STATUS_REG   0x35
 
#define EMC1413_LOW_LIMIT_STATUS_REG   0x36
 
#define EMC1413_THERM_LIMIT_STATUS_REG   0x37
 
#define EMC1413_DEFAULT_RESOLUTION   0.125
 
#define EMC1413_TEMP_SHIFT_BIT   5
 

Typedefs

typedef struct _temp_mapping_register temp_mapping_register
 

Functions

 LOG_MODULE_REGISTER (dev_emc1413)
 
bool get_emc1413_two_byte_limit (sensor_cfg *cfg, uint8_t temp_threshold_index, uint32_t *millidegree_celsius)
 
bool get_emc1413_one_byte_limit (sensor_cfg *cfg, uint8_t temp_threshold_index, uint32_t *millidegree_celsius)
 
bool emc1413_get_temp_threshold (sensor_cfg *cfg, uint8_t temp_threshold_index, uint32_t *millidegree_celsius)
 
bool set_emc1413_two_byte_limit (sensor_cfg *cfg, uint8_t temp_threshold_index, uint32_t *millidegree_celsius)
 
bool set_emc1413_one_byte_limit (sensor_cfg *cfg, uint8_t temp_threshold_index, uint32_t *millidegree_celsius)
 
bool emc1413_set_temp_threshold (sensor_cfg *cfg, uint8_t temp_threshold_index, uint32_t *millidegree_celsius)
 
uint8_t emc1413_read (sensor_cfg *cfg, int *reading)
 
bool emc1413_get_temp_status (sensor_cfg *cfg, uint8_t *temp_status)
 
bool emc1413_clear_temp_status (sensor_cfg *cfg)
 
uint8_t emc1413_init (sensor_cfg *cfg)
 

Variables

temp_mapping_register emc1413_temp_register_map []
 

Macro Definition Documentation

◆ EMC1413_DEFAULT_RESOLUTION

#define EMC1413_DEFAULT_RESOLUTION   0.125

◆ EMC1413_EXTERNAL_DIODE_FAULT_REG

#define EMC1413_EXTERNAL_DIODE_FAULT_REG   0x1B

◆ EMC1413_HIGH_LIMIT_STATUS_REG

#define EMC1413_HIGH_LIMIT_STATUS_REG   0x35

◆ EMC1413_LOW_LIMIT_STATUS_REG

#define EMC1413_LOW_LIMIT_STATUS_REG   0x36

◆ EMC1413_STATUS_REG

#define EMC1413_STATUS_REG   0x02

◆ EMC1413_TEMP_SHIFT_BIT

#define EMC1413_TEMP_SHIFT_BIT   5

◆ EMC1413_THERM_LIMIT_STATUS_REG

#define EMC1413_THERM_LIMIT_STATUS_REG   0x37

Typedef Documentation

◆ temp_mapping_register

Function Documentation

◆ emc1413_clear_temp_status()

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

◆ emc1413_get_temp_status()

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

◆ emc1413_get_temp_threshold()

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

◆ emc1413_init()

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

◆ emc1413_read()

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

◆ emc1413_set_temp_threshold()

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

◆ get_emc1413_one_byte_limit()

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

◆ get_emc1413_two_byte_limit()

bool get_emc1413_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_emc1413  )

◆ set_emc1413_one_byte_limit()

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

◆ set_emc1413_two_byte_limit()

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

Variable Documentation

◆ emc1413_temp_register_map

temp_mapping_register emc1413_temp_register_map[]
Initial value:
= {
}
@ EMC1413_INTERNAL_HIGH_LIMIT_REG
Definition: emc1413.h:40
@ EMC1413_EXTERNAL_2_LOW_LIMIT_HIGH_BYTE_REG
Definition: emc1413.h:48
@ EMC1413_EXTERNAL_1_LOW_LIMIT_HIGH_BYTE_REG
Definition: emc1413.h:44
@ EMC1413_INTERNAL_LOW_LIMIT_REG
Definition: emc1413.h:41
@ EMC1413_EXTERNAL_2_HIGH_LIMIT_LOW_BYTE_REG
Definition: emc1413.h:47
@ EMC1413_EXTERNAL_1_THERM_LIMIT_REG
Definition: emc1413.h:51
@ EMC1413_EXTERNAL_1_HIGH_LIMIT_HIGH_BYTE_REG
Definition: emc1413.h:42
@ EMC1413_EXTERNAL_2_HIGH_LIMIT_HIGH_BYTE_REG
Definition: emc1413.h:46
@ EMC1413_EXTERNAL_1_HIGH_LIMIT_LOW_BYTE_REG
Definition: emc1413.h:43
@ EMC1413_EXTERNAL_2_THERM_LIMIT_REG
Definition: emc1413.h:52
@ EMC1413_INTERNAL_THERM_LIMIT_REG
Definition: emc1413.h:50
@ EMC1413_EXTERNAL_1_LOW_LIMIT_LOW_BYTE_REG
Definition: emc1413.h:45
@ EMC1413_EXTERNAL_2_LOW_LIMIT_LOW_BYTE_REG
Definition: emc1413.h:49
@ 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