-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlayer1.h
42 lines (22 loc) · 960 Bytes
/
layer1.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
#ifndef __LAYER1_H__
#define __LAYER1_H__
#include <stdint.h>
/**********************************************************************************************
* C O N F I G U R A T I O N */
// maximum current (in mA) requested by the speed controller
#define I_MAX 250
// speed controller execution freq in Hz (must be an integer of current ctrl frq)
#define F_EMF_CTRL 200
/**********************************************************************************************
* P R O T Y P E S */
void l1_init();
void l1_periodic (float i_mot, float emf, float u_bat);
int32_t l1_get_emf();
int32_t l1_get_i_ref();
uint32_t l1_get_emf_pos();
void l1_set_emf_pos(uint32_t e);
uint32_t l1_get_u_bat();
void l1_set_emf_ref(int32_t emf);
int32_t l1_get_emf_ref();
void l1_set_direction(bool fwd);
#endif