IRPyro messaging application
Communications program between IRPyro and IRPyro evaluation tool
|
Go to the documentation of this file.
42 #ifndef MESSAGE_TO_SENSOR
63 static void bytes_to_AFE(uint8_t *AFE_bytes, AFE_reg_type *AFE_register)
65 AFE_register->S7_S0 = AFE_bytes[0];
66 AFE_register->LP = (AFE_bytes[1]& 0X80) >> 7;
67 AFE_register->HP = (AFE_bytes[1]& 0X40) >> 6;
68 AFE_register->C_LP = (AFE_bytes[1]& 0X30) >> 4;
69 AFE_register->CLK_OUT = (AFE_bytes[1]& 0X08) >> 3;
70 AFE_register->SYNC = (AFE_bytes[1]& 0X04) >> 2;
71 AFE_register->TEMP = (AFE_bytes[1]& 0X02) >> 1;
72 AFE_register->INT = (AFE_bytes[1]& 0X01) >> 0;
77 static void bytes_to_CCP(uint8_t CCP_byte, CCP_reg_type *CCP_register)
79 CCP_register->Feedback_transconductance = (CCP_byte & 0XC0 )>> 6 ;
80 CCP_register->High_pass_filter_setting = (CCP_byte & 0X30 )>> 4 ;
81 CCP_register->Feedback_cap = (CCP_byte & 0X0E )>> 1 ;
82 CCP_register->status_bit = (CCP_byte & 0X01 )>> 0 ;
87 static void bytes_to_WUP(uint8_t *WUP_bytes, WUP_reg_type *WUP_register)
89 WUP_register->UHT = WUP_bytes[0];
90 WUP_register->ULT = WUP_bytes[1];
91 WUP_register->LHT = WUP_bytes[2];
92 WUP_register->LLT = WUP_bytes[3];
93 WUP_register->WT_Threshold = WUP_bytes[4];
94 WUP_register->ST =(WUP_bytes[5] & 0X40) >> 6;
95 WUP_register->DP0_DP2 =(WUP_bytes[5] & 0X38) >> 3;
96 WUP_register->CH0_CH2 =(WUP_bytes[5] & 0X07) >> 0;
134 uint8_t payload_index = 0;
135 uint8_t num_sensors_to_process;
149 --num_sensors_to_process;
151 while(num_sensors_to_process);
170 uint8_t channel_count = 0;
174 uint8_t payload_idx = 0;
177 CCP_reg_type CCP_value = {0};
186 while (channel_count);
245 EXTernal_Callback_Setup(NULL);
424 #define CMD_ARRAY_SIZE (35)
482 (*pf[cmd_tab_idx])();
484 *cmd_code = cmd_tab_idx;
uint8_t message_to_sensor_payload[7]
static void get_darkpixel_state(void)
Returns the result to the operation to the GUI.
static void goto_sleep(void)
Configures the wake up function and sends the sleep command.
@ execute_apply_parameters
static void second_unit_id_read(void)
Returns the result to the operation to the GUI.
static void set_emitter_timings(void)
Updates with the values received from the GUI.
uint8_t channel_processing(uint8_t *channel_count)
prepares for channel_id requests
void message_unpack_result(uint8_t *cmd_code_result, uint8_t *sensor_destination, uint8_t *cmd_payload)
gives access to the command code and the corresponding payload (if any)
static void bytes_to_AFE(uint8_t *AFE_bytes, AFE_reg_type *AFE_register)
decodes the AFE register of the IRPyro into this_device
EXTernal_callback pointer_to_wakeup_function
decode_result_type message_unpack_decode(void)
FSM to decode a received command If the command is valid, the command code and the payload (if any) a...
static void intpr_WUP_write(void)
Loads the WUP values to be applied to the sensor.
static void reset_hardware(void)
Returns the result to the operation to the GUI.
uint8_t ChannelConfiguration[NUMBER_OF_SCOPES_IN_THE_GUI]
uint8_t channel_id_to_channel(void)
maps the GUI scope channel_id to physical channel on the sensor
static void set_darkpixel_state(void)
Returns the result to the operation to the GUI.
uint8_t sensor_destination
uint8_t channel_id_to_sensor(void)
maps the GUI scope channel_id to physical sensor
static void logical_channels_read(void)
Returns the result to the operation to the GUI.
static void status_start(void)
Enables status report to the GUI.
static void board_type_read(void)
Returns the result to the operation to the GUI.
static void reset_hard(void)
Returns the result to the operation to the GUI.
GUI flag and data structure directed to the sensor.
static void bytes_to_WUP(uint8_t *WUP_bytes, WUP_reg_type *WUP_register)
decodes the WUP register of the IRPyro into this_device
static void status_stop(void)
Disables status report to the GUI.
static void logical_channels_write(void)
Updates with values received from the GUI.
static void intpr_AFE_write(void)
commits the AFE values to the structure in memory
void channel_id_next(void)
increments the channel index
static void fndummy(void)
Null operation for the state machine.
execute_next_state_type message_interpreter(uint8_t *cmd_code, uint8_t *destination)
Recovers the next message from the GUI to the sensor If the message is valid, is passed to the corres...
static void streaming_start(void)
Returns the result to the operation to the GUI.
static void streaming_stop(void)
Changes the streaming flag and reports to the GUI.
static void wake_up(void)
Wakes up the sensor and disables the call back function.
#define NUMBER_OF_SCOPES_IN_THE_GUI
static void intpr_CCP_write(void)
Writes CCP values to channels configured on channel configuration the CCP values are given as single ...
IRPyro_cmd_type IRPyro_device_cmd
EXTernal_callback pointer_to_read_function
execute_next_state_type next_step
static void firmware_version_send(void)
configures firmware version string
static void get_failure_flags(void)
Returns the result to the operation to the GUI.
static void null_test_command(void)
configures the null test
void process_parms_load(uint8_t *idx, uint8_t *num_sensors_to_process)
configures for loop for single or multiple sensor operations
static void intpr_CCP_read(void)
Collects values stored in the channels configured on channel configuration.
static void set_emitter_state(void)
Updates with values received from the GUI.
static void asic_version_read(void)
Returns the result to the operation to the GUI.
static void reset_soft(void)
Returns the result to the operation to the GUI.
static void sampling_rate_read(void)
Returns the result to the operation to the GUI.
static void intpr_WUP_read(void)
Returns the result to the operation to the GUI.
static void bytes_to_CCP(uint8_t CCP_byte, CCP_reg_type *CCP_register)
decodes the CCP register of the IRPyro into this_device
static void unit_id_write(void)
Returns the result to the operation to the GUI.
static void report_error(void)
Changes the error flag and reports to the GUI.
static void intpr_AFE_read(void)
Returns the result to the operation to the GUI.
static void sampling_rate_write(void)
Configures the sample rate in memory and prepares message to sensor.
IRPyro_devices IRPyro_device
static void unit_id_read(void)
Returns the result to the operation to the GUI.