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

Macros

#define NCT7363_PIN_NUMBER   16
 
#define NCT7363_PIN_FUNC_REG_SIZE   4
 
#define NCT7363_REG_SIZE   8
 
#define FREQUENCY_DIVEL_0_RANGE_MAX   62500
 
#define FREQUENCY_DIVEL_0_RANGE_MIN   488.28125
 
#define FREQUENCY_DIVEL_1_RANGE_MAX   244.14
 
#define FREQUENCY_DIVEL_1_RANGE_MIN   1.907
 
#define NCT7363_FAN_LSB_MASK   BIT_MASK(5)
 
#define NCT7363_GPIO_LSB_MASK   BIT_MASK(8)
 
#define MAX_THRESHOLD_VAL   0x1FFF
 
#define FAN_COUNT_DEFAULT_VAL   0x1FFF
 

Functions

 LOG_MODULE_REGISTER (dev_nct7363)
 
bool nct7363_read_back_data (sensor_cfg *cfg, uint8_t reading_offset, uint8_t *val)
 
bool nct7363_set_threshold (sensor_cfg *cfg, uint16_t threshold)
 
bool nct7363_set_duty (sensor_cfg *cfg, uint8_t duty, uint8_t port)
 
bool nct7363_write (sensor_cfg *cfg, uint8_t offset, uint8_t val)
 
bool nct7363_setting_wdt (sensor_cfg *cfg, uint8_t wdt)
 
bool nct7363_set_frequency (sensor_cfg *cfg, float frequency)
 
uint8_t nct7363_init (sensor_cfg *cfg)
 

Macro Definition Documentation

◆ FAN_COUNT_DEFAULT_VAL

#define FAN_COUNT_DEFAULT_VAL   0x1FFF

◆ FREQUENCY_DIVEL_0_RANGE_MAX

#define FREQUENCY_DIVEL_0_RANGE_MAX   62500

◆ FREQUENCY_DIVEL_0_RANGE_MIN

#define FREQUENCY_DIVEL_0_RANGE_MIN   488.28125

◆ FREQUENCY_DIVEL_1_RANGE_MAX

#define FREQUENCY_DIVEL_1_RANGE_MAX   244.14

◆ FREQUENCY_DIVEL_1_RANGE_MIN

#define FREQUENCY_DIVEL_1_RANGE_MIN   1.907

◆ MAX_THRESHOLD_VAL

#define MAX_THRESHOLD_VAL   0x1FFF

◆ NCT7363_FAN_LSB_MASK

#define NCT7363_FAN_LSB_MASK   BIT_MASK(5)

◆ NCT7363_GPIO_LSB_MASK

#define NCT7363_GPIO_LSB_MASK   BIT_MASK(8)

◆ NCT7363_PIN_FUNC_REG_SIZE

#define NCT7363_PIN_FUNC_REG_SIZE   4

◆ NCT7363_PIN_NUMBER

#define NCT7363_PIN_NUMBER   16

◆ NCT7363_REG_SIZE

#define NCT7363_REG_SIZE   8

Function Documentation

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( dev_nct7363  )

◆ nct7363_init()

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

◆ nct7363_read_back_data()

bool nct7363_read_back_data ( sensor_cfg cfg,
uint8_t  reading_offset,
uint8_t *  val 
)
Here is the call graph for this function:

◆ nct7363_set_duty()

bool nct7363_set_duty ( sensor_cfg cfg,
uint8_t  duty,
uint8_t  port 
)
Here is the call graph for this function:

◆ nct7363_set_frequency()

bool nct7363_set_frequency ( sensor_cfg cfg,
float  frequency 
)

◆ nct7363_set_threshold()

bool nct7363_set_threshold ( sensor_cfg cfg,
uint16_t  threshold 
)
Here is the call graph for this function:

◆ nct7363_setting_wdt()

bool nct7363_setting_wdt ( sensor_cfg cfg,
uint8_t  wdt 
)
Here is the call graph for this function:

◆ nct7363_write()

bool nct7363_write ( sensor_cfg cfg,
uint8_t  offset,
uint8_t  val 
)
Here is the call graph for this function: