refactor(master : nicsensor)重新整理变量结构
This commit is contained in:
parent
0f24ea84f5
commit
9e07465212
53
nicsensor.sh
53
nicsensor.sh
@ -1,9 +1,8 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
SCRIPT_VERSION="1.7.3"
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
# Project Feature Varible (Change as need)
|
# Project Feature Varible (Change as need)
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
|
|
||||||
# ADC128 Division factor
|
# ADC128 Division factor
|
||||||
votage_division_factor_0="1"
|
votage_division_factor_0="1"
|
||||||
votage_division_factor_1="1"
|
votage_division_factor_1="1"
|
||||||
@ -55,30 +54,35 @@ TMP112_Sensor_name="Temperature"
|
|||||||
|
|
||||||
# fru basic offset
|
# fru basic offset
|
||||||
fru_offset="0x00 0x00"
|
fru_offset="0x00 0x00"
|
||||||
|
# ---------------------------------------------------------
|
||||||
|
# Global Settings
|
||||||
|
# ---------------------------------------------------------
|
||||||
Support_Sensor_List="emc1413, adc128, ina3221, tmp468, tmp112"
|
Support_Sensor_List="emc1413, adc128, ina3221, tmp468, tmp112"
|
||||||
Support_Server_List="5280m7, 5468m7, 5688m7, donghu, yichun, qiandaohu"
|
Support_Server_List="5280m7, 5468m7, 5688m7, donghu, yichun, qiandaohu"
|
||||||
# Which server will use this script
|
# Which server will use this script
|
||||||
server_type="auto"
|
server_type="auto"
|
||||||
|
|
||||||
|
# DISABLE_DETECT=0 : do i2cdetect when i2c status changed
|
||||||
|
# =1 : don't do i2cdetect when i2c status changed
|
||||||
|
DISABLE_DETECT=1
|
||||||
|
|
||||||
|
# DEBUG MODE=0 : Disable debug mode
|
||||||
|
# =1 : Enable debug mode
|
||||||
|
DEBUG_MODE=0
|
||||||
|
i2c_bus=12
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
# Common Varible (Don't Change)
|
# Global Varible (Don't Change)
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
# Input Param
|
# Input Param
|
||||||
nic_slot=$1
|
nic_slot=$1
|
||||||
sensor_type=$2
|
sensor_type=$2
|
||||||
|
|
||||||
# Introduction of chip_slave
|
|
||||||
# 1.chip i2c slave address(7bit)
|
|
||||||
chip_slave=$3
|
chip_slave=$3
|
||||||
option_data=$4
|
option_data=$4
|
||||||
option_data2=$5
|
option_data2=$5
|
||||||
|
|
||||||
param_num=$#
|
param_num=$#
|
||||||
|
|
||||||
# CHIP REGISTER
|
# REGISTER Table
|
||||||
REG_pca9641_controll="0x01"
|
REG_pca9641_controll="0x01"
|
||||||
|
|
||||||
REG_adc128_config="0x00"
|
REG_adc128_config="0x00"
|
||||||
REG_adc128_advance="0x0b"
|
REG_adc128_advance="0x0b"
|
||||||
REG_adc128_status="0x0c"
|
REG_adc128_status="0x0c"
|
||||||
@ -90,64 +94,45 @@ REG_adc128_ch4="0x24"
|
|||||||
REG_adc128_ch5="0x25"
|
REG_adc128_ch5="0x25"
|
||||||
REG_adc128_ch6="0x26"
|
REG_adc128_ch6="0x26"
|
||||||
REG_adc128_ch7="0x27"
|
REG_adc128_ch7="0x27"
|
||||||
|
|
||||||
REG_emc1413_TD1_H="0x00"
|
REG_emc1413_TD1_H="0x00"
|
||||||
REG_emc1413_TD1_L="0x29"
|
REG_emc1413_TD1_L="0x29"
|
||||||
REG_emc1413_TD2_H="0x01"
|
REG_emc1413_TD2_H="0x01"
|
||||||
REG_emc1413_TD2_L="0x10"
|
REG_emc1413_TD2_L="0x10"
|
||||||
REG_emc1413_TD3_H="0x23"
|
REG_emc1413_TD3_H="0x23"
|
||||||
REG_emc1413_TD3_L="0x24"
|
REG_emc1413_TD3_L="0x24"
|
||||||
|
|
||||||
REG_ina3221_ch1="0x01"
|
REG_ina3221_ch1="0x01"
|
||||||
REG_ina3221_ch2="0x03"
|
REG_ina3221_ch2="0x03"
|
||||||
REG_ina3221_ch3="0x05"
|
REG_ina3221_ch3="0x05"
|
||||||
REG_ina3221_bus1="0x02"
|
REG_ina3221_bus1="0x02"
|
||||||
REG_ina3221_bus2="0x04"
|
REG_ina3221_bus2="0x04"
|
||||||
REG_ina3221_bus3="0x06"
|
REG_ina3221_bus3="0x06"
|
||||||
|
|
||||||
REG_tmp112="0x00"
|
REG_tmp112="0x00"
|
||||||
REG_tmp468="0x80"
|
REG_tmp468="0x80"
|
||||||
# ---------------------------------------------------------
|
|
||||||
# Global Varible (Don't Change)
|
|
||||||
# ---------------------------------------------------------
|
|
||||||
# DISABLE_DETECT=0 : do i2cdetect when i2c status changed
|
|
||||||
# =1 : don't do i2cdetect when i2c status changed
|
|
||||||
DISABLE_DETECT=1
|
|
||||||
|
|
||||||
# DEBUG MODE=0 : Disable debug mode
|
# Global Param
|
||||||
# =1 : Enable debug mode
|
|
||||||
DEBUG_MODE=0
|
|
||||||
|
|
||||||
i2c_bus=12
|
|
||||||
pca9641_slave=0x41
|
pca9641_slave=0x41
|
||||||
pca9548_channel=0x04
|
pca9548_channel=0x04
|
||||||
pca9548_slave=0x72
|
pca9548_slave=0x72
|
||||||
|
|
||||||
is_have_pca9641=1
|
is_have_pca9641=1
|
||||||
|
|
||||||
log="/tmp/nicsensor_debug.log"
|
|
||||||
INA3221_SHUNT_VOLT=0
|
INA3221_SHUNT_VOLT=0
|
||||||
INA3221_BUS_VOLT=1
|
INA3221_BUS_VOLT=1
|
||||||
INA3221_POWER=2
|
INA3221_POWER=2
|
||||||
|
|
||||||
INFO="Info"
|
|
||||||
WARNING="Warning"
|
|
||||||
ERROR="Error"
|
|
||||||
|
|
||||||
ina3221_ch0_volt="0"
|
ina3221_ch0_volt="0"
|
||||||
ina3221_ch1_volt="0"
|
ina3221_ch1_volt="0"
|
||||||
ina3221_ch2_volt="0"
|
ina3221_ch2_volt="0"
|
||||||
ina3221_ch0_current="0"
|
ina3221_ch0_current="0"
|
||||||
ina3221_ch1_current="0"
|
ina3221_ch1_current="0"
|
||||||
ina3221_ch2_current="0"
|
ina3221_ch2_current="0"
|
||||||
SCRIPT_VERSION="1.7.3"
|
|
||||||
|
|
||||||
fru_file_name=$option_data2
|
fru_file_name=$option_data2
|
||||||
fru_write_size=0
|
fru_write_size=0
|
||||||
fru_write_data=""
|
fru_write_data=""
|
||||||
nic_type=""
|
nic_type=""
|
||||||
slot_number=""
|
slot_number=""
|
||||||
res_tmp468=""
|
res_tmp468=""
|
||||||
|
INFO="Info"
|
||||||
|
WARNING="Warning"
|
||||||
|
ERROR="Error"
|
||||||
|
log="/tmp/nicsensor_debug.log"
|
||||||
|
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
# Script Function Defination
|
# Script Function Defination
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user