112 const AFE_reg_type IRPyro_AFE_Master =
115 .LP = LOW_POWER_DISABLE,
117 .C_LP = LOW_PASS_180,
118 .CLK_OUT = CLK_ENABLE,
120 .TEMP = TEMP_DISABLE,
123 const AFE_reg_type IRPyro_AFE_Slave =
126 .LP = LOW_POWER_DISABLE,
128 .C_LP = LOW_PASS_180,
129 .CLK_OUT = CLK_DISABLE,
131 .TEMP = TEMP_DISABLE,
135 const CCP_reg_type IRPyro_Ch_Cfg =
137 .Feedback_cap = FEEDBACK_200_80,
138 .High_pass_filter_setting = HIGH_PASS_1HZ,
139 .Feedback_transconductance = TCONDUCT_0_15T,
140 .status_bit = CH_ENABLE
143 const WUP_reg_type IRPyro_WUP_Cfg =
145 .UHT = MAX_WUP_THRESHOLD,
146 .ULT = SAFE_WUP_THRESHOLD,
147 .LHT = MIN_WUP_THRESHOLD,
148 .LLT = MIN_WUP_THRESHOLD,
149 .WT_Threshold = DEFAULT_NO_EVENTS,
150 .DP0_DP2 = NOT_IN_USE_VALUE,
152 .ST = SLEEP_MODE_ONE_CH
156 this_list[0].CS_Port = 2;
157 this_list[0].CS_Pin = 1;
158 this_list[0].INT_Port = 1;
159 this_list[0].INT_Pin = 4;
160 this_list[0].address = 0x70;
162 this_list[1].CS_Port = 2;
163 this_list[1].CS_Pin = 5;
164 this_list[1].INT_Port = 1;
165 this_list[1].INT_Pin = 5;
166 this_list[1].address = 0x69;
168 this_list[2].CS_Port = 2;
169 this_list[2].CS_Pin = 4;
170 this_list[2].INT_Port = 1;
171 this_list[2].INT_Pin = 6;
172 this_list[2].address = 0x68;
174 this_list[3].CS_Port = 2;
175 this_list[3].CS_Pin = 3;
176 this_list[3].INT_Port = 1;
177 this_list[3].INT_Pin = 7;
178 this_list[3].address = 0x67;
181 this_list[0].number_of_active_channels = 1;
182 this_list[0].AFE_register = IRPyro_AFE_Master;
183 this_list[0].CCP_register[2] = IRPyro_Ch_Cfg;
184 this_list[0].WUP_register = IRPyro_WUP_Cfg;
186 this_list[1].number_of_active_channels = 1;
187 this_list[1].AFE_register = IRPyro_AFE_Slave;
188 this_list[1].CCP_register[2] = IRPyro_Ch_Cfg;
189 this_list[1].WUP_register = IRPyro_WUP_Cfg;
191 this_list[2].number_of_active_channels = 1;
192 this_list[2].AFE_register = IRPyro_AFE_Slave;
193 this_list[2].CCP_register[2] = IRPyro_Ch_Cfg;
194 this_list[2].WUP_register = IRPyro_WUP_Cfg;
196 this_list[3].number_of_active_channels = 1;
197 this_list[3].AFE_register = IRPyro_AFE_Slave;
198 this_list[3].CCP_register[2] = IRPyro_Ch_Cfg;
199 this_list[3].WUP_register = IRPyro_WUP_Cfg;
208 uint8_t num_of_IRPyro = *list_size;
209 uint8_t devices_present =0;
210 const uint8_t types[]= {0x00, 0x7F, 0x77, 0x67, 0x47};
212 for(uint8_t current=0 ; current < num_of_IRPyro; ++ current)
214 if (IRPyro_open(&this_list[current]) == 1)
219 *list_size = devices_present;
221 uint8_t calc01 = (uint8_t)( GPIO_ReadInputData( GPIOA ) >> 8 ) & 1 ;
222 uint8_t calc02 = (uint8_t)( GPIO_ReadInputData( GPIOA ) >> 10 ) & 6 ;
223 uint8_t calc03 = (uint8_t)( GPIO_ReadInputData( GPIOA ) >> 2 ) & 0x38;
228 if ( devices_present > 1 )
232 if ( devices_present > 2 )
236 if ( devices_present > 3 )
247 CS_pin_set(2,1,
state);
248 CS_pin_set(2,3,
state);
249 CS_pin_set(2,4,
state);
250 CS_pin_set(2,5,
state);
259 Micro_controller_delay_ms(30);
261 Micro_controller_delay_ms(30);
278 uint8_t LED_ready = 0;
280 Micro_controller_template_init();
287 LED_READY(LED_ready);
300 uint8_t decode_result = 0;
349 static void (*
const pf[6])(void) =