-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsysstate.h
42 lines (35 loc) · 796 Bytes
/
sysstate.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
* sysstate.h
*
* Created on: 26 èþíÿ 2017 ã.
* Author: alpha-user
*/
#ifndef SYSSTATE_H_
#define SYSSTATE_H_
#include "encoder.h"
#include "interface.h"
#include "pid.h"
typedef enum {
UPD_BUTTON = 0b1,
UPD_ENCODER = 0b10,
UPD_SET_TEMPERATURE = 0b100,
UPD_TEMPERATURE = 0b1000,
UPD_PWM = 0b1<<4,
UPD_SET_PWM = 0b10<<4
} state_updated_t;
typedef struct SystemState {
//TODO: change this
float f_param;
pid_params_t pid_params;
uint8_t i_param;
uint16_t encoder_cnt;
encoder_button_state_t encoder_button;
float temperature;
uint16_t set_temperature;
uint8_t pwm;
interface_t *interface, *return_interface[MAX_INTERFACE_DEPTH];
uint8_t return_interfaces_top;
state_updated_t updated;
mutex_t mutex;
} sys_state_t;
#endif /* SYSSTATE_H_ */