|
|
@ -47,6 +47,15 @@ int32_t ZCanBoardModule::module_xxx_reg(int32_t param_id, bool read, int32_t &va |
|
|
|
PROCESS_REG(kreg_module_initflag, /* */ REG_GET(module_get_inited_flag()), module_set_inited_flag(val)); |
|
|
|
PROCESS_REG(kreg_module_output_state, /* */ REG_GET(readoutput()), ACTION_NONE); |
|
|
|
PROCESS_REG(kreg_module_input_state, /* */ REG_GET(readinput()), ACTION_NONE); |
|
|
|
|
|
|
|
PROCESS_REG(kreg_sensor_temperature0, readTemperature(0, val), ACTION_NONE); |
|
|
|
PROCESS_REG(kreg_sensor_temperature1, readTemperature(1, val), ACTION_NONE); |
|
|
|
PROCESS_REG(kreg_sensor_temperature2, readTemperature(2, val), ACTION_NONE); |
|
|
|
PROCESS_REG(kreg_sensor_temperature3, readTemperature(3, val), ACTION_NONE); |
|
|
|
PROCESS_REG(kreg_sensor_temperature4, readTemperature(4, val), ACTION_NONE); |
|
|
|
PROCESS_REG(kreg_sensor_temperature5, readTemperature(5, val), ACTION_NONE); |
|
|
|
PROCESS_REG(kreg_sensor_temperature6, readTemperature(6, val), ACTION_NONE); |
|
|
|
PROCESS_REG(kreg_sensor_temperature7, readTemperature(7, val), ACTION_NONE); |
|
|
|
default: |
|
|
|
return err::kmodule_not_find_config_index; |
|
|
|
break; |
|
|
@ -79,4 +88,15 @@ int32_t ZCanBoardModule::readoutput() { |
|
|
|
} |
|
|
|
} |
|
|
|
return outputval; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
int32_t ZCanBoardModule::readTemperature(int32_t sensorId, int32_t &temperature_val) { |
|
|
|
if (sensorId < 0 || sensorId >= ZARRAY_SIZE(temperature_sensor)) { |
|
|
|
return err::kmodule_not_find_config_index; |
|
|
|
} |
|
|
|
|
|
|
|
if (temperature_sensor[sensorId] == nullptr) { |
|
|
|
return err::kmodule_not_find_config_index; |
|
|
|
} |
|
|
|
return temperature_sensor[sensorId]->getTemperature(temperature_val); |
|
|
|
} |