CROSS Technical Documentation User Manual and Technical Doc.
INFN Milano Bicocca
Loading...
Searching...
No Matches

◆ instr_ouput_offset_we_want_to_set_function()

void instr_ouput_offset_we_want_to_set_function ( void  )

The preamplifier offset will be set at the value passed from the CAN with this function if, after this setting, it is launched instr_Vbias_to_be_set_function().

The first 2 bytes of the CAN bus message are the voltage setting in mV. Byte_6 is for which channel the voltage is to be set. The same voltage can be the same for several channels. The voltage is applied if the corresponding bit of Byte_6 is 1, ie if bit_2 is 1, than the voltage is applied to channel 1, if bit_1 and bit_5 are 1 then the same voltage is applied for both channles 1 and 5. Run the command several times if the targety is different among the channles. These values are stored in the vector Detector_bias_target[12]. Only positive values are accepted and the voltage is considered the total bias voltage, namely Voltage==Vbias_pos - Vbias_neg, symmetric.

Returns
No Parameters, the actual result is sent to the CAN bus output throught tx_data.
228uint8_t canali_ , canali_input=vettore_istruzioni[istruzione_byte_4_e_scelta_canale];
229 uint8_t scheda_su_giu = (canali_input >> 7) & 1;
230 uint8_t offset_scheda=0;
231 if (scheda_su_giu){
232 offset_scheda=6;
233 }
234 for( canali_=0; canali_ <6; canali_ ++){
235 if( (canali_input >> canali_) & 1){
236 preamplifier_Output_offset_target[offset_scheda + canali_]= ( ( *(int16_t *)vettore_istruzioni ) *1000);
237 }
238 }
240}
uint8_t tx_data[8]
Transmission data vector.
Definition: Can.c:321
#define istruzione_byte_4_e_scelta_canale
Definition: Istruzioni.h:24
void instr_ouput_offset_we_want_to_set_function(void)
The preamplifier offset will be set at the value passed from the CAN with this function if,...
int32_t preamplifier_Output_offset_target[12]
Offset target values.
volatile int8_t vettore_istruzioni[8]
This is a copy of the received 8 bytes from the CAN.

Definition at line 227 of file Preamplifier_Offset_Drift_Correcttion.c.