Appiko
sensebe_tx_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 
69 typedef struct
70 {
71  uint32_t tx_en_pin;
72  uint32_t tx_in_pin;
73  uint32_t tx_pwr1;
74  uint32_t tx_pwr2;
75 }tx_pin_config_t;
76 
77 typedef struct
78 {
79  cam_trig_pin_config_t cam_config;
80  light_sense_pin_config_t light_sense_config;
81  tx_pin_config_t tx_transmit_config;
82  sensebe_config_t * sensebe_config;
83 }sensebe_tx_config_t;
84 
89 
95 void sensebe_tx_rx_init (sensebe_tx_config_t * sensebe_tx_init);
96 
100 void sensebe_tx_rx_start (void);
101 
105 void sensebe_tx_rx_stop (void);
106 
112 void sensebe_tx_rx_add_ticks (uint32_t interval);
113 
119 void sensebe_tx_rx_update_config (sensebe_config_t * update_sensebe_config);
120 
125 sensebe_config_t * sensebe_tx_rx_last_config ();
126 #ifdef __cplusplus
127 }
128 #endif
129 
130 #endif /* SENSEBE_TX_RX_MOD_H */
131 
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_init(sensebe_tx_config_t *sensebe_tx_init)
Function to initialize the Rx detect module.
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.
void sensebe_tx_rx_add_ticks(uint32_t interval)
Function to handle add tick event.