Appiko
main.c
1 /*
2  * main.c : Application for SenseBe devices.
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 
30 #include <stdbool.h>
31 #include <stdint.h>
32 #include <stddef.h>
33 #include <string.h>
34 
35 #include "evt_sd_handler.h"
36 #include "nrf.h"
37 #include "boards.h"
38 
39 #include "log.h"
40 #include "hal_wdt.h"
41 #include "nrf_util.h"
42 #include "hal_gpio.h"
43 #include "ms_timer.h"
44 #include "hal_nop_delay.h"
45 #include "irq_msg_util.h"
46 #include "device_tick.h"
47 #include "pir_sense.h"
48 #include "hal_pin_analog_input.h"
49 #include "aa_aaa_battery_check.h"
50 #include "button_ui.h"
51 #include "nrf_nvic.h"
52 #include "ble.h"
53 #include "nrf_sdm.h"
54 #include "app_error.h"
55 #include "out_pattern_gen.h"
56 #include "sensebe_ble.h"
57 #include "sensebe_tx_mod.h"
58 #include "sensebe_store_config.h"
59 #include "dev_id_fw_ver.h"
60 #include "led_seq.h"
61 #include "led_ui.h"
62 #include "cam_trigger.h"
63 /* ----- Defines ----- */
64 
67 #define APP_DEVICE_NAME_CHAR 'S','e','n','s','e','B','e'
68 const uint8_t app_device_name[] = { APP_DEVICE_NAME_CHAR };
69 
72 #define APP_UUID_COMPLETE 0x0a, 0xde, 0xfb, 0x07, 0x74, 0x83, 0x66, 0xb0, 0x0d, 0x48, 0xf5, 0x07, 0x60, 0xdc, 0x73, 0x3c
73 
76 #define APP_ADV_DATA { \
77  0x02, BLE_GAP_AD_TYPE_FLAGS, BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE, \
78  sizeof(app_device_name) + 1, BLE_GAP_AD_TYPE_COMPLETE_LOCAL_NAME, APP_DEVICE_NAME_CHAR, \
79  0x11, BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_COMPLETE, APP_UUID_COMPLETE \
80  }
81 
84 #define APP_SCAN_RSP_DATA { \
85  0x02, BLE_GAP_AD_TYPE_TX_POWER_LEVEL, 0 , \
86  0x11, BLE_GAP_AD_TYPE_SHORT_LOCAL_NAME, \
87  'x', 'x','x', 'x', 'x', 'x' , 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', \
88  0x04, BLE_GAP_AD_TYPE_MANUFACTURER_SPECIFIC_DATA, 0 , 0 , 0 \
89  }
90 
93 #define WDT_PERIOD_MS 301000
94 
96 #define ENABLE_WDT 1
97 
99 #define SENSE_FAST_TICK_INTERVAL_MS 60
100 
101 #define SENSE_SLOW_TICK_INTERVAL_MS 300000
102 
104 #define ADV_FAST_TICK_INTERVAL_MS 60
105 
106 #define ADV_SLOW_TICK_INTERVAL_MS 1100
107 
109 #define CONN_FAST_TICK_INTERVAL_MS 60
110 
111 #define CONN_SLOW_TICK_INTERVAL_MS 1100
112 
114 #define CONN_TIMEOUT_MS (10*60*1000)
115 
117 typedef enum
118 {
122 }sense_states;
123 
124 /* ----- Global constants in flash ----- */
125 
126 /* ----- Global variables in RAM ----- */
129 
131 static uint32_t conn_count;
132 
133 static sensebe_config_t sensebe_ble_default_config = {
134  .cam_trigs[RADIO_ALL].mode = CAM_TRIGGER_LONG_PRESS,
135  .cam_trigs[RADIO_ALL].pre_focus = 1,
136  .cam_trigs[RADIO_ALL].larger_value = 30,
137  .cam_trigs[RADIO_ALL].smaller_value = 0,
138 
139 
140  .timer_conf.oper_time.day_or_night = 1,
141  .timer_conf.oper_time.threshold = 0b0000000,
142  .cam_trigs[TIMER_ALL].mode = CAM_TRIGGER_SINGLE_SHOT,
143  .cam_trigs[TIMER_ALL].larger_value = 0,
144  .cam_trigs[TIMER_ALL].smaller_value = 0,
145  .cam_trigs[TIMER_ALL].pre_focus = 0,
146  .timer_conf.timer_interval = 50,
147 
148  .trig_conf = MOTION_ONLY,
149 
150  .ir_tx_conf.oper_time.day_or_night = 1,
151  .ir_tx_conf.oper_time.threshold = 0b0000000,
152  .ir_tx_conf.is_enable = 1,
153  .ir_tx_conf.ir_tx_speed = 1,
154  .ir_tx_conf.ir_tx_pwr = 2,
155 
156  .speed = FAST,
157 
158 };
159 
160 
161 sensebe_tx_config_t default_sensebe_tx_rx_config =
162 {
163 
164  .cam_config.focus_pin_no = JACK_FOCUS_PIN,
165  .cam_config.trigger_pin_no = JACK_TRIGGER_PIN,
166  .light_sense_config.photodiode_pin = PIN_TO_ANALOG_INPUT(PHOTODIODE_LIGHT_SENSE),
167  .light_sense_config.photodiode_en_pin = PHOTODIODE_LIGHT_SENSE_EN,
168 
169  .tx_transmit_config.tx_en_pin = IR_TX_REG_EN,
170  .tx_transmit_config.tx_in_pin = IR_TX_LED_EN,
171  .tx_transmit_config.tx_pwr1 = IR_TX_PWR1,
172  .tx_transmit_config.tx_pwr2 = IR_TX_PWR2,
173 
174  .sensebe_config = &sensebe_ble_default_config,
175 
176 };
177 
178 /* ----- Function declarations ----- */
179 
180 /* ----- Function definitions ----- */
182 void wdt_prior_reset_callback(void){
183  log_printf("WDT reset\n");
184 }
185 
186 void prepare_init_ble_adv()
187 {
188  uint8_t app_adv_data[] = APP_ADV_DATA;
189  uint8_t app_scan_rsp_data[] = APP_SCAN_RSP_DATA;
190 
191  //Add in the firmware version
192  memcpy(&app_scan_rsp_data[23], fw_ver_get(), sizeof(fw_ver_t));
193 
194  //Add the device ID
195  memcpy(&app_scan_rsp_data[5], dev_id_get(), sizeof(dev_id_t));
196 
197  sensebe_ble_adv_data_t app_adv_data_struct =
198  {
199  .adv_data = app_adv_data,
200  .scan_rsp_data = app_scan_rsp_data,
201  .adv_len = ARRAY_SIZE(app_adv_data),
202  .scan_rsp_len = ARRAY_SIZE(app_scan_rsp_data)
203  };
204 
205  sensebe_ble_adv_init(&app_adv_data_struct);
206 }
207 
214 static void ble_evt_handler(ble_evt_t * evt)
215 {
216  log_printf("ble evt %x\n", evt->header.evt_id);
217  switch (evt->header.evt_id)
218  {
219  case BLE_GAP_EVT_CONNECTED:
220  irq_msg_push(MSG_STATE_CHANGE, (void *) CONNECTED);
221  break;
222  case BLE_GAP_EVT_DISCONNECTED:
223  irq_msg_push(MSG_STATE_CHANGE, (void *) SENSING);
224  break;
225  case BLE_GAP_EVT_ADV_SET_TERMINATED:
226  irq_msg_push(MSG_STATE_CHANGE, (void *) SENSING);
227  break;
228  case BLE_GAP_EVT_CONN_PARAM_UPDATE:
229  log_printf("sup time %d s, max intvl %d ms, min intvl %d ms, slave lat %d\n",
230  evt->evt.gap_evt.params.conn_param_update.conn_params.conn_sup_timeout/100,
231  (5*evt->evt.gap_evt.params.conn_param_update.conn_params.max_conn_interval)/4,
232  (5*evt->evt.gap_evt.params.conn_param_update.conn_params.min_conn_interval)/4,
233  evt->evt.gap_evt.params.conn_param_update.conn_params.slave_latency);
234  break;
235  }
236 }
237 
242 static void get_sensebe_config_t(sensebe_config_t *config)
243 {
245 }
246 
252 void next_interval_handler(uint32_t interval)
253 {
254  log_printf("in %d\n", interval);
255  button_ui_add_tick(interval);
256  switch(current_state)
257  {
258  case SENSING:
259  {
260  log_printf("Nxt Evt Hndlr : SENSING\n");
261  sensebe_tx_rx_add_ticks (interval);
262 
263  }
264  break;
265  case ADVERTISING:
266  break;
267  case CONNECTED:
268  {
269  conn_count += interval;
270  if(conn_count > MS_TIMER_TICKS_MS(CONN_TIMEOUT_MS))
271  {
273  }
274  }
275  break;
276  }
277 }
278 
284 void state_change_handler(uint32_t new_state)
285 {
286  log_printf("State change %d\n", new_state);
287  if(new_state == current_state)
288  {
289  log_printf("new state same as current state\n");
290  return;
291  }
292  current_state = (sense_states) new_state;
293 
294  switch(current_state)
295  {
296  case SENSING:
297  {
298  sd_softdevice_disable();
299  log_printf("State Change : SENSING\n");
300  device_tick_cfg tick_cfg =
301  {
305  };
306  led_ui_type_stop_all(LED_UI_LOOP_SEQ);
307 
308  device_tick_init(&tick_cfg);
310 
311  }
312  break;
313  case ADVERTISING:
314  {
316  conn_count = 0;
317 
318  device_tick_cfg tick_cfg =
319  {
323  };
324  device_tick_init(&tick_cfg);
325 
326 
327  uint8_t is_sd_enabled;
328  sd_softdevice_is_enabled(&is_sd_enabled);
329  // Would be coming from the SENSING mode
330  if(is_sd_enabled == 0)
331  {
335  prepare_init_ble_adv();
336 
337  sensebe_sysinfo sysinfo;
338  memcpy(&sysinfo.id, dev_id_get(), sizeof(dev_id_t));
339  sysinfo.battery_status = aa_aaa_battery_status();
340  memcpy(&sysinfo.fw_ver, fw_ver_get(), sizeof(fw_ver_t));
341  sensebe_ble_update_sysinfo(&sysinfo);
342 
343  sensebe_config_t * config = sensebe_tx_rx_last_config ();
344  sensebe_ble_update_config (config);
345 
347  }
349 
350  led_ui_type_stop_all(LED_UI_LOOP_SEQ);
351  led_ui_loop_start(LED_SEQ_ORANGE_WAVE, LED_UI_MID_PRIORITY);
352  }
353  break;
354  case CONNECTED:
355  {
356  device_tick_cfg tick_cfg =
357  {
361  };
362  device_tick_init(&tick_cfg);
363  led_ui_type_stop_all (LED_UI_LOOP_SEQ);
364  led_ui_loop_start (LED_SEQ_GREEN_WAVE, LED_UI_MID_PRIORITY);
365 
366  break;
367  }
368  }
369 }
370 
378 {
379  log_printf("Act (0 = CROSS, 1= RELEASE) : %d\nStep : %d\n", act,step);
380  if(act == BUTTON_UI_ACT_CROSS)
381  {
382  switch(step)
383  {
384  case BUTTON_UI_STEP_WAKE:
385  log_printf("fast\n");
386  button_ui_config_wake(false);
387  device_tick_cfg tick_cfg =
388  {
392  };
393  device_tick_init(&tick_cfg);
394  break;
396  if(current_state == SENSING)
397  {
398  irq_msg_push(MSG_STATE_CHANGE, (void *) ADVERTISING);
399  }
400 
401  break;
403  break;
404  case BUTTON_UI_STEP_LONG:
405  {
406  NRF_POWER->GPREGRET = 0xB1;
407  log_printf("Trying to do system reset..!!");
408  uint8_t is_sd_enabled;
409  sd_softdevice_is_enabled(&is_sd_enabled);
410  if(is_sd_enabled == 0)
411  {
412  sd_nvic_SystemReset();
413  }
414  else
415  {
416  NVIC_SystemReset ();
417  }
418  }
419  break;
420  }
421  }
422  else //BUTTON_UI_ACT_RELEASE
423  {
425  log_printf("slow\n");
426  button_ui_config_wake(true);
427  switch(step)
428  {
429  case BUTTON_UI_STEP_WAKE:
430  break;
432  break;
434  break;
435  case BUTTON_UI_STEP_LONG:
436  break;
437  }
438  }
439 }
440 
445 void leds_init(void)
446 {
447  hal_gpio_cfg_output(LED_RED, LEDS_ACTIVE_STATE);
448  hal_gpio_cfg_output(LED_GREEN, !LEDS_ACTIVE_STATE);
449  hal_nop_delay_ms(600);
450  hal_gpio_pin_write(LED_RED, !LEDS_ACTIVE_STATE);
451  hal_gpio_pin_write(LED_GREEN, LEDS_ACTIVE_STATE);
452  hal_nop_delay_ms(600);
453  hal_gpio_pin_write(LED_RED, !LEDS_ACTIVE_STATE);
454  hal_gpio_pin_write(LED_GREEN, !LEDS_ACTIVE_STATE);
455 }
456 
462 void boot_pwr_config(void)
463 {
464  log_printf("Reset because of ");
465  if(NRF_POWER->RESETREAS == 0)
466  {
467  log_printf("power on or brownout, ");
468  }
469  if(NRF_POWER->RESETREAS & POWER_RESETREAS_DIF_Msk)
470  {
471  log_printf("entering into debug interface from Sys OFF, ");
472  }
473  if(NRF_POWER->RESETREAS & POWER_RESETREAS_DOG_Msk)
474  {
475  log_printf("watchdog bite, ");
476  }
477  if(NRF_POWER->RESETREAS & POWER_RESETREAS_LOCKUP_Msk)
478  {
479  log_printf("CPU lockup, ");
480  }
481  if(NRF_POWER->RESETREAS & POWER_RESETREAS_OFF_Msk)
482  {
483  log_printf("wake up from SYS OFF by GPIO, ");
484  }
485  if(NRF_POWER->RESETREAS & POWER_RESETREAS_RESETPIN_Msk)
486  {
487  log_printf("pin reset, ");
488  }
489  if(NRF_POWER->RESETREAS & POWER_RESETREAS_SREQ_Msk)
490  {
491  log_printf("software reset, ");
492  }
493  log_printf("\n");
494 
495  //Clear the reset reason
496  NRF_POWER->RESETREAS = (POWER_RESETREAS_DIF_Msk |
497  POWER_RESETREAS_DOG_Msk |
498  POWER_RESETREAS_LOCKUP_Msk |
499  POWER_RESETREAS_OFF_Msk |
500  POWER_RESETREAS_RESETPIN_Msk |
501  POWER_RESETREAS_SREQ_Msk);
502 
503  //Enable the DCDC converter if the board supports it
504 #if DC_DC_CIRCUITRY == true //Defined in the board header file
505  NRF_POWER->DCDCEN = POWER_DCDCEN_DCDCEN_Enabled << POWER_DCDCEN_DCDCEN_Pos;
506 #endif
507  NRF_POWER->TASKS_LOWPWR = 1;
508 }
509 
513 void load_last_config()
514 {
516  {
517  sensebe_store_config_write (&sensebe_ble_default_config);
518  }
520 }
521 
525 void slumber(void)
526 {
527  uint8_t is_sd_enabled;
528  sd_softdevice_is_enabled(&is_sd_enabled);
529  // Would in the SENSING mode
530  if(is_sd_enabled == 0)
531  {
532  __WFI();
533  }
534  else
535  {
536  sd_app_evt_wait();
537  }
538 }
539 
543 int main(void)
544 {
545  leds_init();
546 
547  /* Mandatory welcome message */
548  log_init();
549  log_printf("\n\nHello SenseBe World!\n");
550  boot_pwr_config();
551 
553  ms_timer_init(APP_IRQ_PRIORITY_LOW);
554 #if ENABLE_WDT == 1
556  hal_wdt_start();
557 #endif
558 
559  button_ui_init(BUTTON_PIN, APP_IRQ_PRIORITY_LOW,
561 
562  {
563  irq_msg_callbacks cb =
565  irq_msg_init(&cb);
566  }
567 
568  sensebe_tx_rx_init(&default_sensebe_tx_rx_config);
569 
570  current_state = ADVERTISING; //So that a state change happens
571  irq_msg_push(MSG_STATE_CHANGE, (void *)SENSING);
572  sensebe_ble_init(ble_evt_handler, get_sensebe_config_t);
574  load_last_config ();
575 
576  while (true)
577  {
578 #if ENABLE_WDT == 1
579 // Since the application demands that CPU wakes up
580  hal_wdt_feed();
581 #endif
583  irq_msg_process();
584  slumber();
585  }
586 }
587 
void sensebe_ble_update_sysinfo(sensebe_sysinfo *sysinfo)
Updates the characteristic that stores the sysinfo.
Definition: sensebe_ble.c:187
uint8_t aa_aaa_battery_status()
Function to get battery status. It'll convert battery ADC value to 8bit.
sensebe_config_t * sensebe_tx_rx_last_config()
Function to get last config which is being used.
When a button press crosses a particular time.
Definition: button_ui.h:44
fw_ver_t * fw_ver_get(void)
Gets a pointer to the location where the Device ID is stored.
Definition: dev_id_fw_ver.c:35
Lightning mode.
Definition: sensebe_ble.h:61
void boot_pwr_config(void)
Prints the reason for the last reset, enables the internal DC-DC converter if the board supports it a...
Definition: main.c:451
For a short button press.
Definition: button_ui.h:54
void load_last_config()
function to load previous sensepi configuration present in flash memory
Definition: main.c:502
#define IR_TX_REG_EN
Definition: sensebe_rev1.h:107
void hal_wdt_start(void)
Definition: hal_wdt.c:71
void sensebe_ble_stack_init(void)
Function for initializing the BLE stack by enabling the SoftDevice and the BLE event interrupt.
Definition: sensebe_ble.c:216
BLE connection established with an app.
Definition: main.c:130
void sensebe_ble_service_init(void)
Create the Service and its characteristics for the SensePi device. There is a read-only characteristi...
Definition: sensebe_ble.c:251
Fast mode.
Definition: device_tick.h:56
void sensebe_ble_init(void(*ble_sd_evt)(ble_evt_t *evt), void(*config_update)(sensebe_config_t *cfg))
Initialize the handlers to pass the BLE SD events and the configuration received from the mobile app.
Definition: sensebe_ble.c:169
button_ui_action
Definition: button_ui.h:42
sense_states current_state
Definition: main.c:137
void sensebe_tx_rx_update_config(sensebe_config_t *update_sensebe_config)
Function to update SenseBe Rx configuration to config received over BLE.
#define CONN_TIMEOUT_MS
Definition: main.c:114
void button_ui_init(uint32_t button_pin, uint32_t irq_priority, void(*button_ui_handler)(button_ui_steps step, button_ui_action act))
Initialize the button ui event generator module.
Definition: button_ui.c:66
For a long button press.
Definition: button_ui.h:55
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().
#define LEDS_ACTIVE_STATE
Definition: bluey_1v1.h:44
bool sensebe_store_config_is_memory_empty(void)
#define ADV_SLOW_TICK_INTERVAL_MS
Definition: main.c:106
button_ui_steps
Definition: button_ui.h:51
void sensebe_tx_rx_start(void)
Function to enable detection for SenseBe Rx.
void state_change_handler(uint32_t new_state)
The handler that is called whenever the application transitions to a new state.
Definition: main.c:287
void lfclk_init(lfclk_src_t lfclk_src)
Function to initialize the LF clock.
Definition: hal_clocks.c:23
Use PIR sensor to sense motion based on the set configuration.
Definition: main.c:128
void sensebe_ble_disconn(void)
Disconnect the current active connection, if already connected.
Definition: sensebe_ble.c:176
Stucture for passing the configuration for initializing the Device Tick module.
Definition: device_tick.h:64
For a short button press.
Definition: button_ui.h:53
#define APP_ADV_DATA
Definition: main.c:76
void button_handler(button_ui_steps step, button_ui_action act)
Handler for all button related events.
Definition: main.c:378
#define MS_TIMER_TICKS_MS(ms)
Definition: ms_timer.h:64
void sensebe_ble_update_config(sensebe_config_t *config)
Updates the characteristic that stores the SensePi config.
Definition: sensebe_ble.c:201
#define WDT_PERIOD_MS
Definition: main.c:93
void sensebe_ble_adv_start(void)
Function to start advertising.
Definition: sensebe_ble.c:414
#define APP_DEVICE_NAME_CHAR
Definition: main.c:67
void button_ui_config_wake(bool set_wake_on)
To enable/disable the button UI GPIOTE IRQ.
Definition: button_ui.c:128
void wdt_prior_reset_callback(void)
Definition: main.c:180
void device_tick_init(device_tick_cfg *cfg)
Initializes and starts the Device tick module. Provides a next interval event immediately....
Definition: device_tick.c:52
#define CONN_FAST_TICK_INTERVAL_MS
Definition: main.c:109
void ms_timer_init(uint32_t irq_priority)
Definition: ms_timer.c:111
void led_ui_type_stop_all(led_ui_seq_t type)
Stop all sequence of a particular type.
Definition: led_ui.c:275
dev_id_t * dev_id_get(void)
Gets a pointer to the location where the Device ID is stored.
Definition: dev_id_fw_ver.c:30
Same as previous mode.
Definition: device_tick.h:57
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
void sensebe_ble_gap_params_init(void)
Generic Access Profile initialization. The device name, and the preferred connection parameters are s...
Definition: sensebe_ble.c:346
BLE advertising to get connected to an app.
Definition: main.c:129
#define ARRAY_SIZE(arr)
Definition: common_util.h:70
void sensebe_store_config_check_fw_ver()
Function to check the major number of firmware if latest major number \ firmware version is greater t...
For the moment a button is pressed.
Definition: button_ui.h:56
void device_tick_process(void)
The function to be called whenever the SoC wakes up to see if more than half the time of the current ...
Definition: device_tick.c:89
void irq_msg_init(irq_msg_callbacks *cb_ptr)
Definition: irq_msg_util.c:53
void hal_wdt_feed(void)
Definition: hal_wdt.c:64
#define SENSE_SLOW_TICK_INTERVAL_MS
Definition: main.c:101
void sensebe_tx_rx_add_ticks(uint32_t interval)
Function to handle add tick event.
void slumber(void)
Definition: main.c:180
void leds_init(void)
Initialize and blink the LEDs momentarily. To be used at the start of the program.
Definition: main.c:434
void irq_msg_process(void)
Definition: irq_msg_util.c:77
#define PHOTODIODE_LIGHT_SENSE_EN
Definition: sensebe_rev1.h:64
void device_tick_switch_mode(device_tick_mode mode)
Switches from the fast to slow mode or vice versa.
Definition: device_tick.c:73
int main(void)
Function for application main entry.
Definition: main.c:90
void button_ui_add_tick(uint32_t ui_ticks)
The ticks that need to be sent to the button UI module for its processing.
Definition: button_ui.c:86
sense_states
Definition: main.c:125
void sensebe_ble_adv_init(sensebe_ble_adv_data_t *sensebe_ble_adv_data)
Function to initializing the advertising.
Definition: sensebe_ble.c:369
#define IR_TX_PWR1
Definition: sensebe_rev1.h:109
#define APP_SCAN_RSP_DATA
Definition: main.c:84
void hal_wdt_init(uint32_t period_ms, void(*wdt_timeout_handler)(void))
Definition: hal_wdt.c:34
#define IR_TX_PWR2
Definition: sensebe_rev1.h:111
#define CONN_SLOW_TICK_INTERVAL_MS
Definition: main.c:111
#define IR_TX_LED_EN
Definition: sensebe_rev1.h:105
#define SENSE_FAST_TICK_INTERVAL_MS
Definition: main.c:99
void sensebe_tx_rx_init(sensebe_tx_rx_config_t *sensebe_rx_detect_config)
Function to initialize the Rx detect module.
void next_interval_handler(uint32_t interval)
The next interval handler is used for providing a periodic tick to be used by the various modules of ...
Definition: main.c:256
void irq_msg_push(irq_msg_types pushed_msg, void *more_data)
Definition: irq_msg_util.c:64
External crystal.
Definition: hal_clocks.h:38
#define PHOTODIODE_LIGHT_SENSE
Definition: sensebe_rev1.h:61
#define ADV_FAST_TICK_INTERVAL_MS
Definition: main.c:104
Slow mode.
Definition: device_tick.h:55