Appiko
sensepi_cam_trigger.h
1 /*
2  * sensepi_cam_trigger.h : Module to handle camera triggering related functionality
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 #ifndef APPLICATION_SENSEPI_CAM_TRIGGER_H
31 #define APPLICATION_SENSEPI_CAM_TRIGGER_H
32 
33 #include "sensepi_ble.h"
34 #include "stdint.h"
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
43 typedef struct{
44  sensepi_config_t * config_sensepi;
47  uint32_t led_sense_out_pin;
49  uint32_t led_sense_off_val;
50  uint32_t amp_ud_pin;
51  uint32_t amp_cs_pin;
52  uint32_t amp_spi_sck_pin;
53  uint32_t *signal_out_pin_array;
55  uint32_t signal_pin_num;
58 
59 
64 
69 
75 void sensepi_cam_trigger_init(sensepi_cam_trigger_init_config_t * config_sensepi_cam_trigger);
76 
82 void sensepi_cam_trigger_update(sensepi_config_t * update_config);
83 
88 sensepi_config_t * sensepi_cam_trigger_get_sensepi_config();
89 
94 void sensepi_cam_trigger_add_tick(uint32_t interval);
95 
96 #ifdef __cplusplus
97 }
98 #endif
99 
100 #endif /* APPLICATION_SENSEPI_CAM_TRIGGER_H */
101 
uint32_t amp_ud_pin
Value at which LED is off.
void sensepi_cam_trigger_stop()
Function to stop PIR sensing.
void sensepi_cam_trigger_add_tick(uint32_t interval)
Function to decide what to decide at current tick.
uint32_t amp_spi_sck_pin
Pin number for CSbar pin for MCP4012.
uint32_t amp_cs_pin
Pin number for UDbar pin for MCP4012.
uint32_t pir_sense_offset_input
Pin number for PIR signal output.
uint32_t led_sense_out_pin
Pin number for PIR offset output.
void sensepi_cam_trigger_init(sensepi_cam_trigger_init_config_t *config_sensepi_cam_trigger)
Function to initiate SensePi_PIR module.
sensepi_config_t * sensepi_cam_trigger_get_sensepi_config()
Function to get the current configuration to send it to mobile app.
void sensepi_cam_trigger_update(sensepi_config_t *update_config)
Function to update the configuration at every instance when it is changed in the program.
uint32_t led_sense_off_val
Pin number for light sensing.
uint32_t pir_sense_signal_input
Configuration received from mobile app.
uint32_t led_sense_analog_in_pin
Pin number for LED driving pin.
Strcture to configure SensePi_PIR module.
void sensepi_cam_trigger_start()
Function to start PIR sensing.