-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathc_config.h
158 lines (117 loc) · 6.99 KB
/
c_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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
/*****************************************************************************
THIS PROGRAM IS FREE SOFTWARE. YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT
UNDER THE TERMS OF THE GNU GPLV3 AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION.
Copyright (C), 2022-2023, pansamic(Wang GengJie) [email protected]
Filename: c_config.h
Author: Pansamic
Version: 1.1
Create date: 2022.12.09
Description: the file contains some config macros that controls almost all of
features of a car. This file is the first file user must modify.
Others: none
History:
1. <author> <date> <desc>
pansamic 2022.12.10 create v1.0 version.
*****************************************************************************/
#ifndef __C_CONFIG_H_
#define __C_CONFIG_H_
#ifdef __cplusplus
extern "C" {
#endif
#define VERSION 1.3
/*****************************************************************************************************
* *
* MCU *
* *
*****************************************************************************************************/
#define USE_STM32 1
#define USE_MSP432 0
/*****************************************************************************************************
* *
* STM32 configurations *
* *
*****************************************************************************************************/
#if USE_STM32
#define USE_HAL_LIB 1 // use hal library, usually developed with STM32CubeIDE or STM32CubeMX
#define USE_FW_LIB 0 // use firmware library, usually developed with keil5
#define USE_STM32F4 1 // use STM32F4 series, with FPU
#define USE_STM32F1 0 // use STM32F1 series, without FPU
#define USE_STM32G4 0 // use STM32G4 series, with FPU
#endif
/*****************************************************************************************************
* *
* Hardware Configuration *
* *
*****************************************************************************************************/
#define MEM_BLOCK_SIZE 16 // memory block size, suggested value:8, unit:byte
#define MEM_MAX_SIZE 10 // maximum RAM size for CarOS, can't be lower than 2. unit:kb
#define MEM_ALLOC_TABLE_SIZE MEM_MAX_SIZE*1024/MEM_BLOCK_SIZE // memory table size
/*****************************************************************************************************
* *
* Car Configuration *
* *
*****************************************************************************************************/
#define FOUR_WHEEL_MECANUM 1
#define SIX_WHEEL_MECANUM 2
#define TWO_WHEEL_BALANCE 3
#define AKERMAN 4
#define FOUR_WHEEL_DIFFERENTIAL 5
#define TWO_WHEEL_DIFFERENTIAL 6
#define THREE_WHEEL_OMNI 7
#define FOUR_WHEEL_OMNI 8
#define CAR_TYPE FOUR_WHEEL_MECANUM // Choose the model of the car
/*****************************************************************************************************
* *
* Encoder Configuration *
* *
*****************************************************************************************************/
/*****************************************************************************************************
* *
* Debug System Configuration *
* *
*****************************************************************************************************/
/* COS system debug Enable */
#define COS_DEBUG 1
/* COS components debug Enable */
#if COS_DEBUG==1
#define DEBUG_CAR 1
#define DEBUG_DCMOTOR 1
#define DEBUG_ENCODER 1
/* Motor debug configuration */
#if DEBUG_DCMOTOR==1
#define DEBUG_L298N 1
#define DEBUG_A4950 1
#endif
/* if this macro equals to 1, CarOS system will print
* log information realtime */
#define LOG_PRINT 1
/* if this macro equals 1, CarOS system will store
* log information in RAM or other storage meterials */
#define LOG_STORAGE 1
/* Log level enable */
#define LOG_EMERG 1
#define LOG_ALERT 1
#define LOG_CRIT 1
#define LOG_ERR 1
#define LOG_WARNING 1
#define LOG_NOTICE 1
#define LOG_INFO 1
#define LOG_DEBUG 0 // debug mode, records almost everything, but occupies much memory and MCU processing speed
#if LOG_STORAGE
#define LOG_MEM_SIZE 10 // no lower than 2KB is recommended. unit:kb
#endif
#endif/* COS_DEBUG==1 */
/*****************************************************************************************************
* *
* Communication Configuration *
* *
*****************************************************************************************************/
#define INPUT_BUFFER_SIZE 1 // system input buffer, unit:kb
#define OUTPUT_BUFFER1_SIZE 10 // system main output buffer, unit:kb
#define OUTPUT_BUFFER2_SIZE 5 // system secondary output buffer, can be smaller than main buffer. unit:kb
#define USE_USART_DMA 0 // use DMA to transmit usart data, which is much faster than block way.
// but user must configure DMA first. CarOS won't configure DMA automatically.
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif /*__C_CONFIG_H_*/