|
@ -94,10 +94,10 @@ void PlateCodeScanerModule::initialize(int32_t moduleid, hardware_config_t* hard |
|
|
adc_capture_buf = (int16_t*)calloc(2, MAX_POINT); |
|
|
adc_capture_buf = (int16_t*)calloc(2, MAX_POINT); |
|
|
ZASSERT(adc_capture_buf); |
|
|
ZASSERT(adc_capture_buf); |
|
|
|
|
|
|
|
|
m_t_laster_enable_io.setState(true); |
|
|
|
|
|
m_amp_negative_5v_gpio.setState(true); |
|
|
|
|
|
m_t_amp_sw_io.setState(true); |
|
|
|
|
|
m_f_amp_sw_io.setState(true); |
|
|
|
|
|
|
|
|
m_t_laster_enable_io.setState(false); |
|
|
|
|
|
m_amp_negative_5v_gpio.setState(false); |
|
|
|
|
|
m_t_amp_sw_io.setState(false); |
|
|
|
|
|
m_f_amp_sw_io.setState(false); |
|
|
|
|
|
|
|
|
// while (true) {
|
|
|
// while (true) {
|
|
|
// int32_t adcv;
|
|
|
// int32_t adcv;
|
|
@ -119,7 +119,7 @@ void PlateCodeScanerModule::initialize(int32_t moduleid, hardware_config_t* hard |
|
|
} |
|
|
} |
|
|
#define PROCESS_REG_CFG(cfg) PROCESS_REG(kreg_plate_code_scaner_##cfg, /* */ REG_GET(m_reg.cfg), REG_SET(m_reg.cfg))
|
|
|
#define PROCESS_REG_CFG(cfg) PROCESS_REG(kreg_plate_code_scaner_##cfg, /* */ REG_GET(m_reg.cfg), REG_SET(m_reg.cfg))
|
|
|
|
|
|
|
|
|
int32_t PlateCodeScanerModule::module_xxx_reg(int32_t param_id, bool read, int32_t& val) { |
|
|
|
|
|
|
|
|
int32_t PlateCodeScanerModule::pri_module_xxx_reg(int32_t param_id, bool read, int32_t& val) { |
|
|
switch (param_id) { |
|
|
switch (param_id) { |
|
|
PROCESS_REG_CFG(laster_intensity); |
|
|
PROCESS_REG_CFG(laster_intensity); |
|
|
PROCESS_REG_CFG(scan_gain); |
|
|
PROCESS_REG_CFG(scan_gain); |
|
@ -134,6 +134,15 @@ int32_t PlateCodeScanerModule::module_xxx_reg(int32_t param_id, bool read, int32 |
|
|
return err::kmodule_not_find_reg; |
|
|
return err::kmodule_not_find_reg; |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
|
|
|
return 0; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int32_t PlateCodeScanerModule::module_xxx_reg(int32_t param_id, bool read, int32_t& val) { |
|
|
|
|
|
int32_t ret = pri_module_xxx_reg(param_id, read, val); |
|
|
|
|
|
if (ret != 0) { |
|
|
|
|
|
return ret; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (!read) module_active_cfg(); |
|
|
if (!read) module_active_cfg(); |
|
|
return 0; |
|
|
return 0; |
|
|
}; |
|
|
}; |
|
@ -368,7 +377,7 @@ void PlateCodeScanerModule::scaner_set_gain(float gain) { |
|
|
} |
|
|
} |
|
|
void PlateCodeScanerModule::laser_set_intensity(float intensity) { |
|
|
void PlateCodeScanerModule::laser_set_intensity(float intensity) { |
|
|
int32_t potentiometer_val = 0; |
|
|
int32_t potentiometer_val = 0; |
|
|
potentiometer_val = intensity / 100.0 * 255.0; |
|
|
|
|
|
|
|
|
potentiometer_val = intensity / 100.0 * 150.0; |
|
|
ZLOGI(TAG, "laser_set_intensity: %.2f(potentiometer_val: %d)", intensity, potentiometer_val); |
|
|
ZLOGI(TAG, "laser_set_intensity: %.2f(potentiometer_val: %d)", intensity, potentiometer_val); |
|
|
m_t_optical_amp_mcp41_ohm.setPotentiometerValue_0(potentiometer_val); |
|
|
m_t_optical_amp_mcp41_ohm.setPotentiometerValue_0(potentiometer_val); |
|
|
} |
|
|
} |
|
|