-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.h
59 lines (37 loc) · 1.06 KB
/
config.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
* All config can happen in their respective libraries, but it got annoying to
* manage, so here's a centralized configuration file for all editable constants
* (see the corresponding header files for documentation on exactly what they do)
*/
#include <xc.h>
#ifndef CONFIG_H
#define CONFIG_H
/// main.c (these constants need to be manually tuned for your application)
#define SCALE_P 1
#define SCALE_I 1
#define SCALE_D 1
/// joystick_api.h
#define K_SAMPLERATE 256
/* conditional compilation defines */
#define GET_ADC_X // X adc conversion will happen
#define GET_ADC_Y // Y adc conversion will happen
#define BUF_ADC_X // X buffer
//#define BUF_ADC_Y // no Y buffer
/// touchpad_api.h
#define TOUCHPAD_CENTER 63
#define CMD_READ_X 0xD8
#define CMD_READ_Y 0x98
/// pid_control.h
#define P_CANCEL 0
#define I_SAMPLES 128
#define D_SAMPLES 8
#define BUFSIZE 1024
#define BUF_T_MIN INT16_MIN
#define BUF_T_MAX INT16_MAX
typedef int16_t buf_t;
typedef int32_t bbuf_t;
// servo_api.h
/* n/a */
// lcd_api.h
#define LCD_CONTRAST 0x00
#endif /* CONFIG_H */