forked from biomimetics/imageproc-test
-
Notifications
You must be signed in to change notification settings - Fork 0
/
consts.h
54 lines (42 loc) · 1.56 KB
/
consts.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
#ifndef __CONSTS_H
#define __CONSTS_H
#define ADC_MAX 1023
#define M_PI 3.14159265
//Limits for numerical values of different types
#define INT_MIN -32768
#define INT_MAX 32767
#define UINT_MAX 65535
#define UINT_MIN 0
//Status field identifiers (currently unused)
#define STATUS_UNUSED 0
//Command identifiers
#define RADIO_TEST 0
#define GYRO_TEST 1
#define ACCEL_TEST 2
#define DFLASH_TEST 3
#define MOTOR_TEST 4
#define SMA_TEST 5
//Camera constants
#define IMCOLS 160
#define IMROWS 100
//Communication constants
#define TX_PAYLOAD_SIZE 128
//Timer constants
#define FT1 100
#define ON 1
#define OFF 0
#define REVERSE 0
#define FORWARD 1
#define BRAKE 2
//Test configuration parameters
#define TEST_PACKET_INTERVAL_MS 200
#define MOTOR_TEST_DUTY_CYCLE 50
#define MOTOR_TEST_DURATION 10 //How long to run the motor (in seconds) during the test
#define MD_LED_1 _LATB8
#define MD_LED_2 _LATB11
#define SMA_1 1
#define SMA_2 2
//Motor PWM configuration parameters
//#define PTPER_VALUE 4999 // = FCY / (F_pwm * time_base_input_prescaler) - 1 eg. 2kHz pwm = 40e6 / ((((PTPER_VALUE = 4999) + 1)) * 4X prescaler)
#define PTPER_VALUE 624// = FCY / (F_pwm * time_base_input_prescaler) - 1 eg. 2kHz pwm = 40e6 / ((((PTPER_VALUE = 4999) + 1)) * 4X prescaler)
#endif