PicoLowLevel
Loading...
Searching...
No Matches
definitions.h
Go to the documentation of this file.
1#ifndef definitions_h
2#define definitions_h
3
4// Main loop timings
5#define DT_BAT 1000 // 1000ms / 1000 = 1 Hz
6#define DT_PID 10 // 1000ms / 100 = 100 Hz
7#define DT_TEL 10 // 1000ms / 10 = 100 Hz
8#define DT_ENC 20 // 1000ms / 20 = 50 Hz
9
10// Timeouts
11#define CAN_TIMEOUT 1000
12
13// PWM configuration
14#define PWM_MAX_VALUE 1023
15#define PWM_FREQUENCY 15000
16
17// I²C configuration
18#define I2C_SENS_SDA 18
19#define I2C_SENS_SCL 19
20
21#define ABSOLUTE_ENCODER_ADDRESS 0x40
22
23// Battery configuration
24#define BAT_LOW 11.1f
25#define BAT_NOM 12.6f
26#define BAT_PIN 28
27#define BAT_R1 10000
28#define BAT_R2 3300
29
30// Motors pins
31#define DRV_TR_LEFT_DIR 15
32#define DRV_TR_LEFT_PWM 14
33
34#define DRV_TR_RIGHT_DIR 9
35#define DRV_TR_RIGHT_PWM 8
36
37// Motor configuration
38#define MAX_SPEED 65.f
39
40// Encoder pins
41#define ENC_TR_LEFT_A 12
42#define ENC_TR_LEFT_B 13
43
44#define ENC_TR_RIGHT_A 10
45#define ENC_TR_RIGHT_B 11
46
47// Encoder conversion constant
48// K = 100 * 10^6 * 60 / ( 48 * 74,83 * 2 )
49// centiRPM microsecToSec SecToMin intPerRotation transmissionRatio transmissionRatio2
50#define ENC_TR_CONVERSION (835226)
51
52// Traction encoder filter samples
53#define ENC_TR_SAMPLES 10
54
55// Display
56#define DISPLAY_ADDR 0x3c
57#define DISPLAY_WIDTH 128
58#define DISPLAY_HEIGHT 64
59
60// Interface definitions
61#define NMENUS 4
62#define MENUTIMEOUT 18
63#define BTNOK 16
64#define BTNNAV 17
65#define DEBOUNCE 300
66
67// Versioning
68#ifndef VERSION
69 #define VERSION "testing"
70#endif
71
72// OTA configuration
73#define OTA_PWD "ciaociao"
74#define WIFI_SSID "iswifi"
75#define WIFI_PWD "ciaociao"
76#define WIFI_HOSTBASE "picow-"
77#define CONF_PATH "/config.txt"
78
79#endif