Appiko
sensebe_rx_mod.c
1 /*
2  * sensebe_tx_rx_mod.c : Module to handle SenseBe's Tx Rx functionalities
3  * Copyright (C) 2019 Appiko
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <https://www.gnu.org/licenses/>.
17  */
18 
19 
20 #include "sensebe_ble.h"
21 #include "sensebe_rx_mod.h"
22 #include "sensebe_store_config.h"
23 
24 #include "hal_gpio.h"
25 #include "ms_timer.h"
26 #include "log.h"
27 #include "led_ui.h"
28 #include "led_seq.h"
29 #include "tssp_detect.h"
30 #include "device_tick.h"
31 #include "cam_trigger.h"
32 #include "simple_adc.h"
33 #include "string.h"
34 #include "hal_nop_delay.h"
35 #include "tssp_ir_tx.h"
36 #include "radio_trigger.h"
37 
38 /***********MACROS***********/
40 #define DETECT_FEEDBACK_TIMEOUT_TICKS MS_TIMER_TICKS_MS(270000)
41 
42 #define LIGHT_THRESHOLD_MULTIPLY_FACTOR 32
43 
44 #define MAX_ADC_OUTPUT 4096
45 
46 #define LIGHT_SENSE_INTERVAL_TICKS MS_TIMER_TICKS_MS(300000)
47 
48 #define PULSE_REQ_FOR_SYNC 4
49 
50 #define MOTION_SYNC_ON_TIME 200
51 
52 #define MOTION_SYNC_OFF_TIME 800
53 
54 /***********ENUMS***********/
56 typedef enum
57 {
59  MOTION_SYNC,
61  MOTION_IDLE,
63  MOTION_STOP,
65  MAX_MOTION_STATE
66 }motion_detection_states_t;
67 
69 typedef enum
70 {
72  MOD_TIMER,
74  MOD_MOTION,
76  MAX_MODS,
77 }modules_t;
78 
80 typedef enum
81 {
83  MOD_FREQ0 = (5),
85  MOD_FREQ1 = (25),
87  MOD_FREQ2 = (50),
89  MOD_FREQ3 = (100),
91  MAX_MOD_FREQ = 4,
92 }module_freq_t;
93 
95 typedef enum
96 {
98  TX_EN = SENSEBE_TX_BOARD,
100  RX_EN = SENSEBE_RX_BOARD
101 }rx_tx_mod_en_t;
102 
103 /***********VARIABLE***********/
105 static uint32_t feedback_timepassed = 0;
107 static sensebe_config_t sensebe_config;
109 static uint32_t arr_module_tick_duration[] = {MOD_FREQ0, MOD_FREQ1, MOD_FREQ2, MOD_FREQ3};
111 static uint32_t arr_sync_validation_ticks[] = {TSSP_DETECT_TICKS_MS(MOD_FREQ0),
112 TSSP_DETECT_TICKS_MS(MOD_FREQ1), TSSP_DETECT_TICKS_MS(MOD_FREQ2), TSSP_DETECT_TICKS_MS(MOD_FREQ3)};
114 static bool arr_is_light_ok [MAX_MODS];
116 static bool arr_is_light_sense_req [MAX_MODS];
118 static bool arr_is_mod_on[MAX_MODS];
120 static tssp_detect_config_t tssp_detect_config;
122 static uint32_t tssp_detect_sync_time;
124 static motion_detection_states_t motion_state = MOTION_SYNC;
126 static uint32_t timer_module_value = 0;
128 static uint32_t light_check_sense_pin = 0;
130 static uint32_t light_check_en_pin = 0;
131 
132 /***********FUNCTIONS***********/
135 void motion_module_start (void);
137 void motion_module_add_ticks (void);
139 void motion_module_add_mod_ticks (void);
141 void motion_module_stop (void);
142 
144 void state_change_sync (void);
146 void state_change_idle (void);
148 void state_change_stop (void);
150 void (* arr_state_change[]) () = {
151  state_change_sync,
152  state_change_idle,
153  state_change_stop
154 };
155 
157 void window_detect_handler ();
159 void pulse_detect_handler (uint32_t ticks_count);
160 
161 
164 void timer_module_start (void);
166 void timer_module_add_ticks (void);
168 void timer_module_add_mod_ticks (void);
170 void timer_module_stop (void);
171 
173 void timer_trigger_handler ();
174 
176 /***/
183 void light_check (oper_time_t oper_time, uint32_t light_intensity, uint32_t module);
188 void light_sense_add_ticks (uint32_t interval);
189 
195 void camera_unit_handler(uint32_t trigger);
205 bool compare_margin(uint32_t data, uint32_t ref, uint32_t margin);
213 bool three_window_sync (uint32_t ticks);
218 void add_ticks_feedback (uint32_t interval);
219 
227 void module_tick_handler ();
228 
229 
230 /*******************Definitions*******************/
231 void add_ticks_feedback (uint32_t interval)
232 {
233  feedback_timepassed += interval;
234  if(feedback_timepassed >= DETECT_FEEDBACK_TIMEOUT_TICKS)
235  {
236  led_ui_stop_seq (LED_UI_LOOP_SEQ, LED_SEQ_DETECT_PULSE);
237  }
238 }
239 
240 void state_change_sync ()
241 {
242  log_printf ("%s\n", __func__);
244 }
245 
246 void state_change_idle ()
247 {
248  log_printf ("%s\n", __func__);
251 }
252 
253 void state_change_stop ()
254 {
255 
256  log_printf ("%s\n", __func__);
259 }
260 
261 void camera_unit_handler(uint32_t trigger)
262 {
263  log_printf("%s\n", __func__);
264  switch(trigger)
265  {
266  case MOD_MOTION :
267  break;
268  case MOD_TIMER :
269  break;
270  }
271 
272 }
273 
274 void timer_trigger_handler ()
275 {
276  if(cam_trigger_is_on () == false)
277  {
278  cam_trigger (MOD_TIMER);
279  }
280 }
281 
282 void window_detect_handler ()
283 {
284  led_ui_stop_seq (LED_UI_LOOP_SEQ, LED_SEQ_DETECT_PULSE);
285  led_ui_single_start (LED_SEQ_DETECT_WINDOW, LED_UI_MID_PRIORITY, true);
286  motion_state = MOTION_SYNC;
287  arr_state_change[motion_state] ();
289  cam_trigger (MOD_MOTION);
290  radio_trigger_yell ();
291 }
292 
293 bool compare_margin(uint32_t data, uint32_t ref, uint32_t margin)
294 {
295  if((ref-margin)<=data && data<=(ref+margin))
296  {
297  return true;
298  }
299  else
300  {
301  return false;
302  }
303 }
304 
305 bool validate_and_sync (uint32_t ticks)
306 {
307  for(uint32_t freq_cmp = 0; freq_cmp < MAX_MOD_FREQ; freq_cmp++)
308  {
309  if(compare_margin (ticks, arr_sync_validation_ticks[freq_cmp], TSSP_DETECT_TICKS_MS(1)))
310  {
311  return true;
312  }
313  }
314  return false;
315 }
316 
317 bool three_window_sync (uint32_t ticks)
318 {
319  static uint32_t previous_pulse_tick = 0, current_pulse_tick = 0;
320  static uint32_t pulse_diff_window[] = {0,0,0};
321  static uint32_t pulse_cnt = PULSE_REQ_FOR_SYNC;
322  static bool flag = false;
323  if(pulse_cnt == PULSE_REQ_FOR_SYNC)
324  {
325  flag = false;
326  previous_pulse_tick = ticks;
327  pulse_cnt --;
328  }
329  else if(pulse_cnt > 0)
330  {
331  current_pulse_tick = ticks;
332  pulse_diff_window[pulse_cnt - 1] = ((current_pulse_tick + (1<<24))- previous_pulse_tick)
333  & 0x00FFFFFF;
334  previous_pulse_tick = current_pulse_tick;
335  pulse_cnt--;
336  }
337  else if(pulse_cnt == 0)
338  {
339  pulse_cnt = PULSE_REQ_FOR_SYNC;
340 
341  }
342  log_printf("Window[0]: %d\n", pulse_diff_window[0]);
343  log_printf("Window[1]: %d\n", pulse_diff_window[1]);
344  log_printf("Window[2]: %d\n", pulse_diff_window[2]);
345  flag = (validate_and_sync (pulse_diff_window[0])
346  && validate_and_sync (pulse_diff_window[1])
347  && validate_and_sync (pulse_diff_window[2])
348  && compare_margin (pulse_diff_window[1], pulse_diff_window[0], TSSP_DETECT_TICKS_MS(2))
349  && compare_margin (pulse_diff_window[2], pulse_diff_window[1], TSSP_DETECT_TICKS_MS(2)));
350 
351  if(flag == true)
352  {
353  tssp_detect_sync_time = pulse_diff_window[1];
354  pulse_diff_window[0] = 0;
355  pulse_diff_window[1] = 0;
356  pulse_diff_window[2] = 0;
357  }
358  return flag;
359 }
360 
361 void pulse_detect_handler (uint32_t ticks_count)
362 {
363  if(motion_state == MOTION_SYNC)
364  {
365  if(three_window_sync (ticks_count))
366  {
367  tssp_detect_window_sync (tssp_detect_sync_time);
368  motion_state = MOTION_IDLE;
369  arr_state_change[motion_state] ();
370  if(feedback_timepassed < DETECT_FEEDBACK_TIMEOUT_TICKS)
371  {
372  led_ui_loop_start (LED_SEQ_DETECT_PULSE, LED_UI_LOW_PRIORITY);
373  }
374  }
375  else
376  {
378 // if(feedback_timepassed < DETECT_FEEDBACK_TIMEOUT_TICKS)
379 // {
380 // led_ui_single_start (LED_SEQ_DETECT_SYNC, LED_UI_LOW_PRIORITY, true);
381 // }
382  led_ui_stop_seq (LED_UI_LOOP_SEQ, LED_SEQ_DETECT_PULSE);
383  }
384  }
385 }
386 
387 void light_check (oper_time_t oper_time, uint32_t light_intensity, uint32_t module)
388 {
389  uint8_t light_sense_config = oper_time.day_or_night;
390  uint32_t light_threshold =
391  (uint32_t)((oper_time.threshold) * LIGHT_THRESHOLD_MULTIPLY_FACTOR);
392 
393  //respective light check
394  //Day and its brighter than the threshold
395  if(((light_sense_config == 1) && (light_intensity >= light_threshold))
396  || //Night and its dimmer than the threshold
397  ((light_sense_config == 0) && (light_intensity <= light_threshold)))
398  //assgin to respective light flag
399  {
400  arr_is_light_ok[module] = true;
401  }
402  else
403  {
404  arr_is_light_ok[module] = false;
405  }
406 }
407 
408 void light_sense_add_ticks (uint32_t interval)
409 {
410  static uint32_t timepassed = 0;
411  timepassed += interval;
412  if(timepassed >= LIGHT_SENSE_INTERVAL_TICKS)
413  {
414  static uint32_t light_intensity;
415  //Enable light sense module
416  hal_gpio_pin_set (light_check_en_pin);
417  //Take light reading
418  hal_nop_delay_ms (3);
419  light_intensity = (MAX_ADC_OUTPUT - simple_adc_get_value (SIMPLE_ADC_GAIN1_6,
420  light_check_sense_pin));
421  //motion light check
422  if(arr_is_light_sense_req[MOD_MOTION])
423  {
424  light_check (sensebe_config.tssp_conf.oper_time, light_intensity, MOD_MOTION);
425  }
426 
427  //timer light check
428  if(arr_is_light_sense_req[MOD_TIMER])
429  {
430  light_check (sensebe_config.timer_conf.oper_time, light_intensity, MOD_TIMER);
431  }
432 
433  //Disable light sense module
434  hal_gpio_pin_clear (light_check_en_pin);
435  timepassed = 0;
436  }
437 }
438 
439 void motion_module_start ()
440 {
441  oper_time_t motion_oper_time = sensebe_config.tssp_conf.oper_time;
442 
443  if((motion_oper_time.day_or_night == 1 && motion_oper_time.threshold == 0b0000000)||
444  (motion_oper_time.day_or_night == 0 && motion_oper_time.threshold == 0b1111111))
445  {
446  arr_is_light_sense_req[MOD_MOTION] = false;
447  arr_is_light_ok [MOD_MOTION] = true;
448  }
449  else
450  {
451  arr_is_light_sense_req[MOD_MOTION] = true;
452  }
453  cam_trigger_config_t motion_cam_trig_config =
454  {
455  .setup_number = MOD_MOTION,
456  .trig_duration_100ms = sensebe_config.tssp_conf.intr_trig_timer,
457  .trig_mode = sensebe_config.cam_trigs[MOTION_ALL].mode,
458  .trig_param1 = sensebe_config.cam_trigs[MOTION_ALL].larger_value,
459  .trig_param2 = sensebe_config.cam_trigs[MOTION_ALL].smaller_value,
460  .pre_focus_en = (bool)sensebe_config.cam_trigs[MOTION_ALL].pre_focus,
461  };
462  cam_trigger_set_trigger (&motion_cam_trig_config);
463 
464  radio_trigger_init_t radio_init =
465  {
466  .comm_direction = RADIO_TRIGGER_Tx,
467  .comm_freq = 95,
468  .irq_priority = APP_IRQ_PRIORITY_HIGH,
469  .tx_on_freq_us = 500,
470  .tx_on_time_ms = 125,
471  };
472  radio_trigger_init (&radio_init);
473 
474  modules_t radio_payload = MOD_MOTION;
475  radio_trigger_memorize_data (&radio_payload, sizeof(modules_t));
476 
477 
478  tssp_detect_config.window_duration_ticks =
479  sensebe_config.tssp_conf.detect_window;
480  tssp_detect_init (&tssp_detect_config);
481 
482  motion_state = MOTION_SYNC;
483  arr_is_mod_on[MOD_MOTION] = true;
484 }
485 
486 void motion_module_add_ticks ()
487 {
488  log_printf("Machine State : %d\n", motion_state);
489  if(arr_is_light_ok [MOD_MOTION] == false)
490  {
491  motion_state = MOTION_STOP;
492  }
493  else if(motion_state == MOTION_STOP)
494  {
495  motion_state = MOTION_SYNC;
496  }
497  arr_state_change[motion_state]();
498 }
499 
500 void motion_module_add_mod_ticks ()
501 {
502  static bool is_rx_on = true;
503  static uint32_t mod_ticks;
504  mod_ticks += arr_module_tick_duration[sensebe_config.speed];
505  if(motion_state == MOTION_SYNC)
506  {
507  if(is_rx_on == true && mod_ticks >= MOTION_SYNC_ON_TIME)
508  {
510  is_rx_on = false;
511  mod_ticks = 0;
512  }
513  else if(is_rx_on == false && mod_ticks >= MOTION_SYNC_OFF_TIME)
514  {
516  is_rx_on = true;
517  mod_ticks = 0;
518  }
519  }
520  else if(motion_state == MOTION_IDLE)
521  {
522  mod_ticks = 0;
523  }
524 }
525 
526 void motion_module_stop ()
527 {
528  motion_state = MOTION_STOP;
529  arr_state_change[motion_state] ();
530 
531  arr_is_mod_on [MOD_MOTION] = false;
532  arr_is_light_sense_req[MOD_MOTION] = false;
533  arr_is_light_ok[MOD_MOTION] = false;
534 }
535 
536 void timer_module_start ()
537 {
538  oper_time_t timer_oper_time = sensebe_config.timer_conf.oper_time;
539 
540  if((timer_oper_time.day_or_night == 1 && timer_oper_time.threshold == 0b0000000)||
541  (timer_oper_time.day_or_night == 0 && timer_oper_time.threshold == 0b1111111))
542  {
543  arr_is_light_sense_req[MOD_TIMER] = false;
544  arr_is_light_ok [MOD_TIMER] = true;
545  }
546  else
547  {
548  arr_is_light_sense_req[MOD_TIMER] = true;
549  }
550  cam_trigger_config_t timer_cam_trig_config =
551  {
552  .setup_number = MOD_TIMER,
553  .trig_duration_100ms = 0,
554  .trig_mode = sensebe_config.cam_trigs[TIMER_ALL].mode,
555  .trig_param1 = sensebe_config.cam_trigs[TIMER_ALL].larger_value,
556  .trig_param2 = sensebe_config.cam_trigs[TIMER_ALL].smaller_value,
557  .pre_focus_en = (bool)sensebe_config.cam_trigs[TIMER_ALL].pre_focus,
558  };
559  cam_trigger_set_trigger (&timer_cam_trig_config);
560 
561  timer_module_value = sensebe_config.timer_conf.timer_interval * 100;
562 
563  arr_is_mod_on[MOD_TIMER] = true;
564 
565 }
566 
567 void timer_module_add_ticks ()
568 {
569  if(arr_is_light_ok [MOD_TIMER] == true)
570  {
571  arr_is_mod_on[MOD_TIMER] = true;
572  }
573  else
574  {
575  arr_is_mod_on[MOD_TIMER] = false;
576  }
577 }
578 
579 void timer_module_add_mod_ticks ()
580 {
581  static uint32_t mod_ticks;
582  mod_ticks += arr_module_tick_duration[sensebe_config.speed];
583  if(mod_ticks >= timer_module_value)
584  {
585  timer_trigger_handler ();
586  mod_ticks = 0;
587  }
588 }
589 
590 void timer_module_stop ()
591 {
592  arr_is_mod_on [MOD_TIMER] = false;
593  arr_is_light_sense_req[MOD_TIMER] = false;
594  arr_is_light_ok[MOD_TIMER] = false;
595 }
596 
597 void module_tick_handler ()
598 {
599  if(arr_is_mod_on[MOD_TIMER] == true)
600  {
601  timer_module_add_mod_ticks ();
602  }
603  if(arr_is_mod_on[MOD_MOTION] == true)
604  {
605  motion_module_add_mod_ticks ();
606  }
607 }
608 
609 void sensebe_tx_rx_init (sensebe_tx_rx_config_t * sensebe_rx_detect_config)
610 {
611  log_printf("%s\n", __func__);
612 
613  //Assign Enable and sense pins
614  light_check_sense_pin = sensebe_rx_detect_config->light_sense_config.photodiode_pin;
615  hal_gpio_cfg_input (light_check_sense_pin, HAL_GPIO_PULL_DOWN);
616  light_check_en_pin = sensebe_rx_detect_config->light_sense_config.photodiode_en_pin;
617  hal_gpio_cfg_output (light_check_en_pin, 0);
618 
619  memcpy (&sensebe_config, sensebe_rx_detect_config->sensebe_config,
620  sizeof(sensebe_config_t));
621 
622  tssp_detect_config_t local_tssp_detect_config =
623  {
624  .detect_logic_level = false,
625  .tssp_missed_handler = window_detect_handler,
626  .tssp_detect_handler = pulse_detect_handler,
627  .rx_en_pin = sensebe_rx_detect_config->rx_detect_config.rx_en_pin,
628  .rx_in_pin = sensebe_rx_detect_config->rx_detect_config.rx_out_pin,
629  .window_duration_ticks =
630  (sensebe_config.tssp_conf.detect_window ),
631  };
632  memcpy (&tssp_detect_config, &local_tssp_detect_config,
633  sizeof(tssp_detect_config_t));
634 
635  cam_trigger_setup_t cam_trig_setup =
636  {
637  .cam_trigger_done_handler = camera_unit_handler,
638  .focus_pin = sensebe_rx_detect_config->cam_config.focus_pin_no,
639  .trigger_pin = sensebe_rx_detect_config->cam_config.trigger_pin_no
640  };
641  cam_trigger_init (&cam_trig_setup);
642 
643 }
644 
646 {
647  log_printf("%s\n", __func__);
648  feedback_timepassed = 0;
649  if(memcmp (&sensebe_config, sensebe_store_config_get_last_config(),
650  sizeof(sensebe_config_t)) != 0)
651  {
652  sensebe_store_config_write (&sensebe_config);
653  }
654 
655  //Check if light sense is required
656 
657  log_printf(" Trig Config : %d\n ", sensebe_config.trig_conf);
658 
659  if((sensebe_config.trig_conf != MOTION_ONLY))
660  {
661  timer_module_start ();
662  }
663  else
664  {
665  timer_module_stop ();
666  }
667 
668  if((sensebe_config.trig_conf != TIMER_ONLY))
669  {
670  motion_module_start ();
671  }
672  else
673  {
674  motion_module_stop ();
675  }
676 
677 
678  ms_timer_start (SENSEBE_OPERATION_MS_TIMER, MS_REPEATED_CALL,
679  MS_TIMER_TICKS_MS(arr_module_tick_duration[sensebe_config.speed])
680  , module_tick_handler);
681 
682  light_sense_add_ticks (LIGHT_SENSE_INTERVAL_TICKS);
683 }
684 
686 {
687  log_printf("%s\n", __func__);
688  radio_trigger_shut ();
689  cam_trigger_stop ();
690  motion_module_stop ();
691  timer_module_stop ();
692  ms_timer_stop (SENSEBE_OPERATION_MS_TIMER);
693 }
694 
695 void sensebe_tx_rx_add_ticks (uint32_t interval)
696 {
697  add_ticks_feedback (interval);
698 
699  if(arr_is_light_sense_req [MOD_MOTION] == true ||
700  arr_is_light_sense_req [MOD_TIMER] == true)
701  {
702  light_sense_add_ticks (interval);
703  }
704 
705  if((sensebe_config.trig_conf != TIMER_ONLY))
706  {
707  motion_module_add_ticks ();
708  }
709  if((sensebe_config.trig_conf != MOTION_ONLY))
710  {
711  timer_module_add_ticks ();
712  }
713 }
714 
715 void sensebe_tx_rx_update_config (sensebe_config_t * update_sensebe_config)
716 {
717  memcpy (&sensebe_config, update_sensebe_config, sizeof(sensebe_config_t));
718 }
719 
720 sensebe_config_t * sensebe_tx_rx_last_config ()
721 {
722  return &sensebe_config;
723 }
void(* cam_trigger_done_handler)(uint32_t done_state)
Definition: cam_trigger.h:133
void tssp_detect_window_stop(void)
Function to stop IR missed window detection.
Definition: tssp_detect.c:172
sensebe_config_t * sensebe_tx_rx_last_config()
Function to get last config which is being used.
uint32_t simple_adc_get_value(simple_adc_gain_t gain, simple_adc_input_t pin)
This function initializes the SAADC peripheral, gets an ADC value and then deinitializes The function...
Definition: simple_adc.c:25
void tssp_detect_pulse_detect()
Function to start module is pulse detecting mode.
Definition: tssp_detect.c:196
LED_UI_LOW_PRIORITY.
Definition: led_ui.h:41
#define TSSP_DETECT_TICKS_MS(ms)
Definition: tssp_detect.h:70
void sensebe_tx_rx_update_config(sensebe_config_t *update_sensebe_config)
Function to update SenseBe Rx configuration to config received over BLE.
void led_ui_loop_start(led_sequences seq, led_ui_priority_t priority)
Start a sequence to play repeatedly.
Definition: led_ui.c:247
void sensebe_tx_rx_stop(void)
Function to disable detection for SenseBe Rx.
void sensebe_store_config_write(sensebe_config_t *latest_config)
Function to write the sensebe_config_t at address location received from get_next_location().
Structure to store information corresponding to hardware and application.
Definition: cam_trigger.h:122
void led_ui_single_start(led_sequences seq, led_ui_priority_t priority, bool reset)
Start a sequence to play once.
Definition: led_ui.c:236
void cam_trigger(uint32_t setup_number)
Function to trigger the camera with given setup number.
Definition: cam_trigger.c:524
bool cam_trigger_is_on(void)
Function to check status of cam_trigger module.
Definition: cam_trigger.c:563
void sensebe_tx_rx_start(void)
Function to enable detection for SenseBe Rx.
Repeated call of the timer.
Definition: ms_timer.h:83
void tssp_detect_init(tssp_detect_config_t *tssp_detect_config)
Function to initialize IR detect sub-module.
Definition: tssp_detect.c:86
#define MS_TIMER_TICKS_MS(ms)
Definition: ms_timer.h:64
void tssp_detect_window_sync(uint32_t sync_ms)
Function to Synchronize TSSP detector to IR transmitter which is being used.
Definition: tssp_detect.c:214
sensebe_config_t * sensebe_store_config_get_last_config()
LED_UI_MID_PRIORITY.
Definition: led_ui.h:42
Trigger only on timer.
Definition: sensebe_ble.h:51
Structure to store information required to use this module.
Definition: tssp_detect.h:76
void ms_timer_start(ms_timer_num id, ms_timer_mode mode, uint64_t ticks, void(*handler)(void))
Definition: ms_timer.c:134
void cam_trigger_stop(void)
Function to stop camera trigger.
Definition: cam_trigger.c:557
void sensebe_tx_rx_add_ticks(uint32_t interval)
Function to handle add tick event.
void cam_trigger_set_trigger(cam_trigger_config_t *cam_trigger_config)
Function to set a camera trigger.
Definition: cam_trigger.c:483
uint32_t window_duration_ticks
Definition: tssp_detect.h:88
void tssp_detect_pulse_stop()
Function to stop IR pulse detection.
Definition: tssp_detect.c:156
Gain factor 1/6.
Definition: simple_adc.h:70
void cam_trigger_init(cam_trigger_setup_t *cam_trigger_setup)
Function to initiate output pins.
Definition: cam_trigger.c:469
Structure to store information related to camera trigger.
Definition: cam_trigger.h:86
void tssp_detect_window_detect()
Function to start IR pulse detection.
Definition: tssp_detect.c:131
void sensebe_tx_rx_init(sensebe_tx_rx_config_t *sensebe_rx_detect_config)
Function to initialize the Rx detect module.
HAL_GPIO_PULL_DOWN.
Definition: hal_gpio.h:38
void ms_timer_stop(ms_timer_num id)
Definition: ms_timer.c:173
void led_ui_stop_seq(led_ui_seq_t type, led_sequences seq)
Stops a particular sequence of a particular type.
Definition: led_ui.c:283