Appiko
oper_manage.h
1 /*
2  * oper_manage.h : Module to keep track of operation conditions for a device
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 #ifndef CODEBASE_PERIPHERAL_MODULES_OPER_MANAGE_H_
20 #define CODEBASE_PERIPHERAL_MODULES_OPER_MANAGE_H_
21 
33 #include "time_tracker.h"
34 
36 #define OPER_MANAGE_MAX_SLOTS 8
37 
39 #define OPER_MANAGE_INVALID_SLOTS 0xFF
40 
42 typedef enum
43 {
49 
51 typedef struct
52 {
56  uint32_t slot_no;
58  uint32_t start_cond;
60  uint32_t end_cond;
62 
69 
76 
82 uint8_t oper_manage_check_update ();
83 
88 void oper_manage_set_light_sense_pin (uint32_t light_sense_adc);
89 
90 #endif /* CODEBASE_PERIPHERAL_MODULES_OPER_MANAGE_H_ */
91 
oper_list_t
Definition: oper_manage.h:42
uint8_t oper_manage_check_update()
Function to check if there are any changes in active slots.
Definition: oper_manage.c:55
uint8_t oper_manage_get_active_slots()
Definition: oper_manage.c:93
void oper_manage_set_light_sense_pin(uint32_t light_sense_adc)
Function to store ADC pin number.
Definition: oper_manage.c:32
uint32_t start_cond
Definition: oper_manage.h:58
void oper_manage_set_slot(oper_manage_slot_t *new_slot)
Function to initiate new operation condition slot.
Definition: oper_manage.c:39
oper_list_t oper_sel
Definition: oper_manage.h:54