-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpower.h
39 lines (29 loc) · 810 Bytes
/
power.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
#ifndef POWER_H
#define POWER_H
#include "LSM6DS3.h"
#include "ADS1232.h"
#include "ant_bpwr.h"
typedef struct {
float v[2];
} filter_t;
typedef struct {
ant_bpwr_common_data_t* common;
ant_bpwr_page1_data_t* page_1;
ant_bpwr_page16_data_t* page_16;
float accel;
uint16_t force_cnt;
float force_sum;
float crank_length;
uint16_t rev_cnt;
float rev_time;
uint32_t rev_timer_cnt;
uint32_t az_cnt;
float az_last_force;
float rot_deg;
float dps_sum;
uint32_t dps_cnt;
} power_compute_t;
void power_update_accel(power_compute_t * p_power_compute, imu_t * p_imu);
void power_update_scale(power_compute_t * p_power_compute, scale_t * p_scale);
void power_update_pages(power_compute_t * p_power_compute, ant_bpwr_profile_t* p_profile);
#endif