Appiko
sensebe_rx_mod.h
1 /*
2  * sensebe_tx_rx_mod.h : 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 
32 #ifndef SENSEBE_TX_RX_MOD_H
33 #define SENSEBE_TX_RX_MOD_H
34 
35 #include "ms_timer.h"
36 #include "sensebe_ble.h"
37 
38 #if SYS_CFG_PRESENT == 1
39 #include "sys_config.h"
40 #endif
41 #ifndef MS_TIMER_USED_SENSBE_TX_RX
42 #define MS_TIMER_USED_SENSBE_TX_RX 2
43 #endif
44 
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
50 #define SENSEBE_OPERATION_MS_TIMER CONCAT_2(MS_TIMER,MS_TIMER_USED_SENSBE_TX_RX)
51 
52 typedef struct
53 {
55  uint32_t photodiode_pin;
57  uint32_t photodiode_en_pin;
58 
59 }light_sense_pin_config_t;
60 
61 typedef struct
62 {
64  uint32_t focus_pin_no;
66  uint32_t trigger_pin_no;
67 }cam_trig_pin_config_t;
68 
70 typedef struct
71 {
73  uint32_t rx_en_pin;
75  uint32_t rx_out_pin;
77 
78 typedef struct
79 {
80  cam_trig_pin_config_t cam_config;
81  light_sense_pin_config_t light_sense_config;
82  rx_pin_config_t rx_detect_config;
83  sensebe_config_t * sensebe_config;
84 }sensebe_tx_rx_config_t;
85 
90 
96 void sensebe_tx_rx_init (sensebe_tx_rx_config_t * sensebe_rx_detect_config);
97 
101 void sensebe_tx_rx_start (void);
102 
106 void sensebe_tx_rx_stop (void);
107 
113 void sensebe_tx_rx_add_ticks (uint32_t interval);
114 
120 void sensebe_tx_rx_update_config (sensebe_config_t * update_sensebe_config);
121 
126 sensebe_config_t * sensebe_tx_rx_last_config ();
127 #ifdef __cplusplus
128 }
129 #endif
130 
131 #endif /* SENSEBE_TX_RX_MOD_H */
132 
sensebe_config_t * sensebe_tx_rx_last_config()
Function to get last config which is being used.
void sensebe_tx_rx_update_config(sensebe_config_t *update_sensebe_config)
Function to update SenseBe Rx configuration to config received over BLE.
void sensebe_tx_rx_stop(void)
Function to disable detection for SenseBe Rx.
void sensebe_tx_rx_swicht_range()
void sensebe_tx_rx_start(void)
Function to enable detection for SenseBe Rx.
uint32_t rx_en_pin
void sensebe_tx_rx_add_ticks(uint32_t interval)
Function to handle add tick event.
uint32_t rx_out_pin
void sensebe_tx_rx_init(sensebe_tx_rx_config_t *sensebe_rx_detect_config)
Function to initialize the Rx detect module.