Revision 5b0a8e7b

View differences:

modules/DiWheelDrive_1-1/Makefile
1
################################################################################
2
# AMiRo-OS is an operating system designed for the Autonomous Mini Robot       #
3
# (AMiRo) platform.                                                            #
4
# Copyright (C) 2016..2018  Thomas Schöpping et al.                            #
5
#                                                                              #
6
# This program is free software: you can redistribute it and/or modify         #
7
# it under the terms of the GNU General Public License as published by         #
8
# the Free Software Foundation, either version 3 of the License, or            #
9
# (at your option) any later version.                                          #
10
#                                                                              #
11
# This program is distributed in the hope that it will be useful,              #
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of               #
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                #
14
# GNU General Public License for more details.                                 #
15
#                                                                              #
16
# You should have received a copy of the GNU General Public License            #
17
# along with this program.  If not, see <http://www.gnu.org/licenses/>.        #
18
#                                                                              #
19
# This research/work was supported by the Cluster of Excellence Cognitive      #
20
# Interaction Technology 'CITEC' (EXC 277) at Bielefeld University, which is   #
21
# funded by the German Research Foundation (DFG).                              #
22
################################################################################
23

  
24

  
25

  
26
################################################################################
27
# Build global options                                                         #
28
# NOTE: Can be overridden externally.                                          #
29
#                                                                              #
30

  
31
# Compiler options here.
32
ifeq ($(USE_OPT),)
33
  USE_OPT = -O2 -fomit-frame-pointer -falign-functions=16 -fstack-usage
34
endif
35

  
36
# C specific options here (added to USE_OPT).
37
ifeq ($(USE_COPT),)
38
  USE_COPT = -std=c11
39
endif
40

  
41
# C++ specific options here (added to USE_OPT).
42
ifeq ($(USE_CPPOPT),)
43
  USE_CPPOPT = -fno-rtti -std=c++17
44
endif
45

  
46
# Enable this if you want the linker to remove unused code and data
47
ifeq ($(USE_LINK_GC),)
48
  USE_LINK_GC = yes
49
endif
50

  
51
# Linker extra options here.
52
ifeq ($(USE_LDOPT),)
53
  USE_LDOPT =
54
endif
55

  
56
# Enable this if you want link time optimizations (LTO)
57
ifeq ($(USE_LTO),)
58
  USE_LTO = yes
59
endif
60

  
61
# If enabled, this option allows to compile the application in THUMB mode.
62
ifeq ($(USE_THUMB),)
63
  USE_THUMB = yes
64
endif
65

  
66
# Enable this if you want to see the full log while compiling.
67
ifeq ($(USE_VERBOSE_COMPILE),)
68
  USE_VERBOSE_COMPILE = no
69
endif
70

  
71
# If enabled, this option makes the build process faster by not compiling
72
# modules not used in the current configuration.
73
ifeq ($(USE_SMART_BUILD),)
74
  USE_SMART_BUILD = no
75
endif
76

  
77
#                                                                              #
78
# Build global options                                                         #
79
################################################################################
80

  
81
################################################################################
82
# Architecture or project specific options                                     #
83
#                                                                              #
84

  
85
# Stack size to be allocated to the Cortex-M process stack. This stack is
86
# the stack used by the main() thread.
87
ifeq ($(USE_PROCESS_STACKSIZE),)
88
  USE_PROCESS_STACKSIZE = 0x400
89
endif
90

  
91
# Stack size to the allocated to the Cortex-M main/exceptions stack. This
92
# stack is used for processing interrupts and exceptions.
93
ifeq ($(USE_EXCEPTIONS_STACKSIZE),)
94
  USE_EXCEPTIONS_STACKSIZE = 0x400
95
endif
96

  
97
# Enables the use of FPU on Cortex-M4.
98
# Possible selections are:
99
#   no     - no FPU is used (probably equals 'soft')
100
#   soft   - does not use the FPU, thus all floating point operations are emulated
101
#   softfp - uses the FPU, but uses the integer registers only
102
#   hard   - uses the FPU and passes data via the FPU registers
103
ifeq ($(USE_FPU),)
104
  USE_FPU = no
105
endif
106

  
107
#                                                                              #
108
# Architecture or project specific options                                     #
109
################################################################################
110

  
111
################################################################################
112
# Project, sources and paths                                                   #
113
#                                                                              #
114

  
115
# Define project name here
116
PROJECT := $(patsubst $(abspath $(dir $(abspath $(lastword $(MAKEFILE_LIST))))..)/%,%,$(abspath $(dir $(abspath $(lastword $(MAKEFILE_LIST))))))
117

  
118
# Imported source files and paths
119
include ../../../kernel/kernel.mk
120
CHIBIOS := $(AMIROOS_KERNEL)
121
AMIROOS = ../..
122
# Startup files
123
include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f1xx.mk
124
# HAL-OSAL files
125
include $(CHIBIOS)/os/hal/hal.mk
126
include $(AMIROOS)/hal/hal.mk
127
include $(CHIBIOS)/os/hal/ports/STM32/STM32F1xx/platform.mk
128
include $(AMIROOS)/hal/ports/STM32/platform.mk
129
include ./board.mk
130
include $(CHIBIOS)/os/hal/osal/rt/osal.mk
131
# RTOS files
132
include $(CHIBIOS)/os/rt/rt.mk
133
include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
134
# Other files (optional).
135
include $(CHIBIOS)/test/rt/test.mk
136
# AMiRo-BLT files
137
include ../../../bootloader/bootloader.mk
138
# AMiRo-LLD files
139
include ../../../periphery-lld/periphery-lld.mk
140
# AMiRo-OS files
141
include $(AMIROOS)/modules/modules.mk
142
include $(AMIROOS)/core/core.mk
143
include $(AMIROOS)/unittests/unittests.mk
144

  
145
# Define linker script file here
146
LDSCRIPT= $(BOARDLD)/STM32F103xE.ld
147

  
148
# C sources that can be compiled in ARM or THUMB mode depending on the global
149
# setting.
150
CSRC = $(STARTUPSRC) \
151
       $(KERNSRC) \
152
       $(PORTSRC) \
153
       $(OSALSRC) \
154
       $(HALSRC) \
155
       $(PLATFORMSRC) \
156
       $(BOARDSRC) \
157
       $(MODULESCSRC) \
158
       $(TESTSRC) \
159
       $(PERIPHERYLLDCSRC) \
160
       $(AMIROOSCORECSRC) \
161
       $(UNITTESTSCSRC) \
162
       $(CHIBIOS)/os/various/evtimer.c \
163
       $(CHIBIOS)/os/various/syscalls.c \
164
       $(CHIBIOS)/os/hal/lib/streams/chprintf.c \
165
       module.c \
166
       $(APPSCSRC)
167

  
168
# C++ sources that can be compiled in ARM or THUMB mode depending on the global
169
# setting.
170
CPPSRC = $(AMIROOSCORECPPSRC) \
171
         $(APPSCPPSRC)
172

  
173
# C sources to be compiled in ARM mode regardless of the global setting.
174
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
175
#       option that results in lower performance and larger code size.
176
ACSRC = $(APPSACSRC)
177

  
178
# C++ sources to be compiled in ARM mode regardless of the global setting.
179
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
180
#       option that results in lower performance and larger code size.
181
ACPPSRC = $(APPSACPPSRC)
182

  
183
# C sources to be compiled in THUMB mode regardless of the global setting.
184
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
185
#       option that results in lower performance and larger code size.
186
TCSRC = $(APPSTCSRC)
187

  
188
# C sources to be compiled in THUMB mode regardless of the global setting.
189
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
190
#       option that results in lower performance and larger code size.
191
TCPPSRC = $(APPSTCPPSRC)
192

  
193
# List ASM source files here
194
ASMSRC = $(APPSASMSRC)
195
ASMXSRC = $(STARTUPASM) \
196
          $(PORTASM) \
197
          $(OSALASM) \
198
          $(APPSASMXSRC)
199

  
200
INCDIR = $(CHIBIOS)/os/license \
201
         $(STARTUPINC) \
202
         $(KERNINC) \
203
         $(PORTINC) \
204
         $(OSALINC) \
205
         $(HALINC) \
206
         $(PLATFORMINC) \
207
         $(BOARDINC) \
208
         $(MODULESINC) \
209
         $(TESTINC) \
210
         $(BOOTLOADERINC) \
211
         $(CHIBIOS)/os/hal/lib/streams \
212
         $(CHIBIOS)/os/various \
213
         $(PERIPHERYLLDINC) \
214
         $(AMIROOS) \
215
         $(AMIROOSCOREINC) \
216
         $(UNITTESTSINC) \
217
         $(APPSINC)
218

  
219
#                                                                              #
220
# Project, sources and paths                                                   #
221
################################################################################
222

  
223
################################################################################
224
# Compiler settings                                                            #
225
# NOTE: Some can be overridden externally.                                     #
226
#                                                                              #
227

  
228
MCU  = cortex-m3
229

  
230
#TRGT = arm-elf-
231
TRGT = arm-none-eabi-
232
CC   = $(TRGT)gcc
233
CPPC = $(TRGT)g++
234
# Enable loading with g++ only if you need C++ runtime support.
235
# NOTE: You can use C++ even without C++ support if you are careful. C++
236
#       runtime support makes code size explode.
237
LD   = $(TRGT)gcc
238
#LD   = $(TRGT)g++
239
CP   = $(TRGT)objcopy
240
AS   = $(TRGT)gcc -x assembler-with-cpp
241
AR   = $(TRGT)ar
242
OD   = $(TRGT)objdump
243
SZ   = $(TRGT)size
244
HEX  = $(CP) -O ihex
245
BIN  = $(CP) -O binary
246
SREC = $(CP) -O srec --srec-len=248
247

  
248
# ARM-specific options here
249
ifeq ($(AOPT),)
250
  AOPT =
251
endif
252

  
253
# THUMB-specific options here
254
ifeq ($(TOPT),)
255
  TOPT = -mthumb -DTHUMB
256
endif
257

  
258
# Define C warning options here
259
ifeq ($(CWARN),)
260
  CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes
261
endif
262

  
263
# Define C++ warning options here
264
ifeq ($(CPPWARN),)
265
  CPPWARN = -Wall -Wextra -Wundef
266
endif
267

  
268
#                                                                              #
269
# Compiler settings                                                            #
270
################################################################################
271

  
272
################################################################################
273
# Start of user section                                                        #
274
#                                                                              #
275

  
276
# List all user C define here, like -D_DEBUG=1
277
UDEFS +=
278

  
279
# Define ASM defines here
280
UADEFS +=
281

  
282
# List all user directories here
283
UINCDIR +=
284

  
285
# List the user directory to look for the libraries here
286
ULIBDIR +=
287

  
288
# List all user libraries here
289
ULIBS +=
290

  
291
#                                                                              #
292
# End of user defines                                                          #
293
################################################################################
294

  
295
# allow for custom build directory
296
ifneq ($(BUILDDIR),)
297
  BUILDDIR := $(BUILDDIR)/$(PROJECT)
298
endif
299

  
300
RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC
301
include $(RULESPATH)/rules.mk
302

  
303
include $(AMIROOS)/modules/flash.mk
modules/DiWheelDrive_1-1/alldconf.h
1
/*
2
AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
3
Copyright (C) 2016..2018  Thomas Schöpping et al.
4

  
5
This program is free software: you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation, either version 3 of the License, or
8
(at your option) any later version.
9

  
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
GNU General Public License for more details.
14

  
15
You should have received a copy of the GNU General Public License
16
along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
*/
18

  
19
#ifndef _ALLDCONF_H_
20
#define _ALLDCONF_H_
21

  
22
/*
23
 * compatibility guards
24
 */
25
#define _AMIRO_LLD_CFG_
26
#define AMIRO_LLD_CFG_VERSION_MAJOR         1
27
#define AMIRO_LLD_CFG_VERSION_MINOR         0
28

  
29
/**
30
 * @brief   Enable flag for the A3906 motor driver.
31
 */
32
#define AMIROLLD_CFG_USE_A3906
33

  
34
/**
35
 * @brief   Enable flag for the AT24C01BN-SH-B EEPROM.
36
 */
37
#define AMIROLLD_CFG_USE_AT24C01BN
38

  
39
/**
40
 * @brief   Enable flag for the MHC5883L compass.
41
 */
42
#define AMIROLLD_CFG_USE_HMC5883L
43

  
44
/**
45
 * @brief   Enable flag for the INA219 power monitor.
46
 */
47
#define AMIROLLD_CFG_USE_INA219
48

  
49
/**
50
 * @brief   Enable flag for the L3G4200D gyroscope.
51
 */
52
#define AMIROLLD_CFG_USE_L3G4200D
53

  
54
/**
55
 * @brief   Enable flag for the status LED.
56
 */
57
#define AMIROLLD_CFG_USE_LED
58

  
59
/**
60
 * @brief   Enable flag for the LIS331DLH accelerometer.
61
 */
62
#define AMIROLLD_CFG_USE_LIS331DLH
63

  
64
/**
65
 * @brief   Enable flag for the LTC4412 power path controller.
66
 */
67
#define AMIROLLD_CFG_USE_LTC4412
68

  
69
/**
70
 * @brief   Enable flag for the PCA9544A I2C multiplexer.
71
 */
72
#define AMIROLLD_CFG_USE_PCA9544A
73

  
74
/**
75
 * @brief   Enable flag for the TPS62113 step-down converter.
76
 */
77
#define AMIROLLD_CFG_USE_TPS62113
78

  
79
/**
80
 * @brief   Enable flag for the VCNL4020 proximity sensor.
81
 */
82
#define AMIROLLD_CFG_USE_VCNL4020
83

  
84
#endif /* _ALLDCONF_H_ */
modules/DiWheelDrive_1-1/aosconf.h
1
/*
2
AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
3
Copyright (C) 2016..2018  Thomas Schöpping et al.
4

  
5
This program is free software: you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation, either version 3 of the License, or
8
(at your option) any later version.
9

  
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
GNU General Public License for more details.
14

  
15
You should have received a copy of the GNU General Public License
16
along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
*/
18

  
19
#ifndef _AOSCONF_H_
20
#define _AOSCONF_H_
21

  
22
/*
23
 * compatibility guards
24
 */
25
#define _AMIRO_OS_CFG_
26
#define _AMIRO_OS_CFG_VERSION_MAJOR_            2
27
#define _AMIRO_OS_CFG_VERSION_MINOR_            0
28

  
29
#include <stdbool.h>
30

  
31
/*===========================================================================*/
32
/**
33
 * @name Kernel parameters and options
34
 * @{
35
 */
36
/*===========================================================================*/
37

  
38
/*
39
 * Include an external configuration file to override the following default settings only if required.
40
 */
41
#if defined(AMIRO_APPS) && (AMIRO_APPS == true)
42
  #include <osconf.h>
43
#endif
44

  
45
/**
46
 * @brief   Flag to set the module as SSSP master.
47
 */
48
#if !defined(OS_CFG_SSSP_MASTER)
49
  #define AMIROOS_CFG_SSSP_MASTER               false
50
#else
51
  #define AMIROOS_CFG_SSSP_MASTER               OS_CFG_SSSP_MASTER
52
#endif
53

  
54
/**
55
 * @brief   Time boundary for robot wide clock synchronization in microseconds.
56
 * @details Whenever the SSSP S (snychronization) signal gets logically deactivated,
57
 *          All modules need to align their local uptime to the nearest multiple of this value.
58
 */
59
#if !defined(OS_CFG_SSSP_SYSSYNCPERIOD)
60
  #define AMIROOS_CFG_SSSP_SYSSYNCPERIOD        1000000
61
#else
62
  #define AMIROOS_CFG_SSSP_SYSSYNCPERIOD        OS_CFG_SSSP_SYSSYNCPERIOD
63
#endif
64

  
65
/**
66
 * @brief   Flag to enable/disable debug API.
67
 */
68
#if !defined(OS_CFG_DBG)
69
  #define AMIROOS_CFG_DBG                       true
70
#else
71
  #define AMIROOS_CFG_DBG                       OS_CFG_DBG
72
#endif
73

  
74
/**
75
 * @brief   Flag to enable/disable unit tests.
76
 */
77
#if !defined(OS_CFG_TESTS_ENABLE)
78
  #define AMIROOS_CFG_TESTS_ENABLE              true
79
#else
80
  #define AMIROOS_CFG_TESTS_ENABLE              OS_CFG_TESTS_ENABLE
81
#endif
82

  
83
/**
84
 * @brief   Flag to enable/disable profiling API.
85
 */
86
#if !defined(OS_CFG_PROFILE)
87
  #define AMIROOS_CFG_PROFILE                   true
88
#else
89
  #define AMIROOS_CFG_PROFILE                   OS_CFG_PROFILE
90
#endif
91

  
92
/**
93
 * @brief   Timeout value when waiting for events in the main loop in microseconds.
94
 * @details A value of 0 deactivates the timeout.
95
 */
96
#if !defined(OS_CFG_MAIN_LOOP_TIMEOUT)
97
  #define AMIROOS_CFG_MAIN_LOOP_TIMEOUT         0
98
#else
99
  #define AMIROOS_CFG_MAIN_LOOP_TIMEOUT         OS_CFG_MAIN_LOOP_TIMEOUT
100
#endif
101

  
102
/** @} */
103

  
104
/*===========================================================================*/
105
/**
106
 * @name System shell options
107
 * @{
108
 */
109
/*===========================================================================*/
110

  
111
/**
112
 * @brief   Shell enable flag.
113
 */
114
#if (AMIROOS_CFG_TESTS_ENABLE == false) && !defined(OS_CFG_SHELL_ENABLE)
115
  #define AMIROOS_CFG_SHELL_ENABLE              true
116
#elif (AMIROOS_CFG_TESTS_ENABLE == true)
117
  #define AMIROOS_CFG_SHELL_ENABLE              true
118
#else
119
  #define AMIROOS_CFG_SHELL_ENABLE              OS_CFG_SHELL_ENABLE
120
#endif
121

  
122
/**
123
 * @brief   Shell thread stack size.
124
 */
125
#if !defined(OS_CFG_SHELL_STACKSIZE)
126
  #define AMIROOS_CFG_SHELL_STACKSIZE           1024
127
#else
128
  #define AMIROOS_CFG_SHELL_STACKSIZE           OS_CFG_SHELL_STACKSIZE
129
#endif
130

  
131
/**
132
 * @brief   Shell thread priority.
133
 */
134
#if !defined(OS_CFG_SHELL_THREADPRIO)
135
  #define AMIROOS_CFG_SHELL_THREADPRIO          THD_NORMALPRIO_MIN
136
#else
137
  #define AMIROOS_CFG_SHELL_THREADPRIO          OS_CFG_SHELL_THREADPRIO
138
#endif
139

  
140
/**
141
 * @brief   Shell maximum input line length.
142
 */
143
#if !defined(OS_CFG_SHELL_LINEWIDTH)
144
  #define AMIROOS_CFG_SHELL_LINEWIDTH           64
145
#else
146
  #define AMIROOS_CFG_SHELL_LINEWIDTH           OS_CFG_SHELL_LINEWIDTH
147
#endif
148

  
149
/**
150
 * @brief   Shell maximum number of arguments.
151
 */
152
#if !defined(OS_CFG_SHELL_MAXARGS)
153
  #define AMIROOS_CFG_SHELL_MAXARGS             4
154
#else
155
  #define AMIROOS_CFG_SHELL_MAXARGS             OS_CFG_SHELL_MAXARGS
156
#endif
157

  
158
/** @} */
159

  
160
#endif /* _AOSCONF_H_ */
161

  
modules/DiWheelDrive_1-1/board.c
1
/*
2
AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
3
Copyright (C) 2016..2018  Thomas Schöpping et al.
4

  
5
This program is free software: you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation, either version 3 of the License, or
8
(at your option) any later version.
9

  
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
GNU General Public License for more details.
14

  
15
You should have received a copy of the GNU General Public License
16
along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
*/
18

  
19
#include <hal.h>
20

  
21
#if HAL_USE_PAL || defined(__DOXYGEN__)
22
/**
23
 * @brief   PAL setup.
24
 * @details Digital I/O ports static configuration as defined in @p board.h.
25
 *          This variable is used by the HAL when initializing the PAL driver.
26
 */
27
const PALConfig pal_default_config = {
28
#if STM32_HAS_GPIOA
29
  {VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH},
30
#endif
31
#if STM32_HAS_GPIOB
32
  {VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH},
33
#endif
34
#if STM32_HAS_GPIOC
35
  {VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH},
36
#endif
37
#if STM32_HAS_GPIOD
38
  {VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH},
39
#endif
40
#if STM32_HAS_GPIOE
41
  {VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH},
42
#endif
43
#if STM32_HAS_GPIOF
44
  {VAL_GPIOFODR, VAL_GPIOFCRL, VAL_GPIOFCRH},
45
#endif
46
#if STM32_HAS_GPIOG
47
  {VAL_GPIOGODR, VAL_GPIOGCRL, VAL_GPIOGCRH},
48
#endif
49
};
50
#endif
51

  
52
/**
53
 * @brief   Early initialization code.
54
 * @details This initialization must be performed just after stack setup
55
 *          and before any other initialization.
56
 */
57
void __early_init(void) {
58

  
59
  stm32_clock_init();
60
}
61

  
62
/**
63
 * @brief   Board-specific initialization code.
64
 * @todo    Add your board-specific code, if any.
65
 */
66
void boardInit(void) {
67
  /*
68
   * Several I/O pins are re-mapped:
69
   *   JTAG disabled and SWJ enabled
70
   *   TIM2 to the PA15/PB3/PA2/PA3 pins.
71
   *   TIM3 to PC6/PC7 pins.
72
   *   USART3 to the PC10/PC11 pins.
73
   *   I2C1 to the PB8/PB9 pins.
74
   */
75
  AFIO->MAPR = AFIO_MAPR_SWJ_CFG_DISABLE |
76
               AFIO_MAPR_TIM2_REMAP_PARTIALREMAP1 |
77
               AFIO_MAPR_TIM3_REMAP_FULLREMAP |
78
               AFIO_MAPR_USART3_REMAP_PARTIALREMAP |
79
               AFIO_MAPR_I2C1_REMAP;
80
}
modules/DiWheelDrive_1-1/board.h
1
/*
2
AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
3
Copyright (C) 2016..2018  Thomas Schöpping et al.
4

  
5
This program is free software: you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation, either version 3 of the License, or
8
(at your option) any later version.
9

  
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
GNU General Public License for more details.
14

  
15
You should have received a copy of the GNU General Public License
16
along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
*/
18

  
19
#ifndef _BOARD_H_
20
#define _BOARD_H_
21

  
22
/*
23
 * Setup for AMiRo DiWheelDrive v1.1 board.
24
 */
25

  
26
/*
27
 * Board identifier.
28
 */
29
#define BOARD_DIWHEELDRIVE
30
#define BOARD_NAME              "AMiRo DiWheelDrive"
31
#define BOARD_VERSION           "1.1"
32

  
33
/*
34
 * Board oscillators-related settings.
35
 * NOTE: LSE not fitted.
36
 */
37
#if !defined(STM32_LSECLK)
38
#define STM32_LSECLK                0U
39
#endif
40

  
41
#if !defined(STM32_HSECLK)
42
#define STM32_HSECLK                8000000U
43
#endif
44

  
45
/*
46
 * Board voltages.
47
 * Required for performance limits calculation.
48
 */
49
#define STM32_VDD                   330U
50

  
51
/*
52
 * MCU type as defined in the ST header.
53
 */
54
#define STM32F103xE
55

  
56
/*
57
 * IO pins assignments.
58
 */
59
#define GPIOA_WKUP                  0U
60
#define GPIOA_LED                   1U
61
#define GPIOA_DRIVE_PWM1A           2U
62
#define GPIOA_DRIVE_PWM1B           3U
63
#define GPIOA_PIN4                  4U
64
#define GPIOA_MOTION_SCLK           5U
65
#define GPIOA_MOTION_MISO           6U
66
#define GPIOA_MOTION_MOSI           7U
67
#define GPIOA_PIN8                  8U
68
#define GPIOA_PROG_RX               9U
69
#define GPIOA_PROG_TX               10U
70
#define GPIOA_CAN_RX                11U
71
#define GPIOA_CAN_TX                12U
72
#define GPIOA_SWDIO                 13U
73
#define GPIOA_SWCLK                 14U
74
#define GPIOA_DRIVE_PWM2B           15U
75

  
76
#define GPIOB_PIN0                  0U
77
#define GPIOB_DRIVE_SENSE2          1U
78
#define GPIOB_POWER_EN              2U
79
#define GPIOB_DRIVE_PWM2A           3U
80
#define GPIOB_PIN4                  4U
81
#define GPIOB_COMPASS_DRDY          5U
82
#define GPIOB_DRIVE_ENC1A           6U
83
#define GPIOB_DRIVE_ENC1B           7U
84
#define GPIOB_COMPASS_SCL           8U
85
#define GPIOB_COMPASS_SDA           9U
86
#define GPIOB_IR_SCL                10U
87
#define GPIOB_IR_SDA                11U
88
#define GPIOB_IR_INT                12U
89
#define GPIOB_GYRO_DRDY             13U
90
#define GPIOB_SYS_UART_UP           14U
91
#define GPIOB_ACCEL_INT_N           15U
92

  
93
#define GPIOC_DRIVE_SENSE1          0U
94
#define GPIOC_SYS_INT_N             1U
95
#define GPIOC_PIN2                  2U
96
#define GPIOC_PATH_DCSTAT           3U
97
#define GPIOC_PIN4                  4U
98
#define GPIOC_PATH_DCEN             5U
99
#define GPIOC_DRIVE_ENC2B           6U
100
#define GPIOC_DRIVE_ENC2A           7U
101
#define GPIOC_SYS_PD_N              8U
102
#define GPIOC_SYS_REG_EN            9U
103
#define GPIOC_SYS_UART_RX           10U
104
#define GPIOC_SYS_UART_TX           11U
105
#define GPIOC_PIN12                 12U
106
#define GPIOC_ACCEL_SS_N            13U
107
#define GPIOC_GYRO_SS_N             14U
108
#define GPIOC_PIN15                 15U
109

  
110
#define GPIOD_OSC_IN                0U
111
#define GPIOD_OSC_OUT               1U
112
#define GPIOD_SYS_WARMRST_N         2U
113
#define GPIOD_PIN3                  3U
114
#define GPIOD_PIN4                  4U
115
#define GPIOD_PIN5                  5U
116
#define GPIOD_PIN6                  6U
117
#define GPIOD_PIN7                  7U
118
#define GPIOD_PIN8                  8U
119
#define GPIOD_PIN9                  9U
120
#define GPIOD_PIN10                 10U
121
#define GPIOD_PIN11                 11U
122
#define GPIOD_PIN12                 12U
123
#define GPIOD_PIN13                 13U
124
#define GPIOD_PIN14                 14U
125
#define GPIOD_PIN15                 15U
126

  
127
#define GPIOE_PIN0                  0U
128
#define GPIOE_PIN1                  1U
129
#define GPIOE_PIN2                  2U
130
#define GPIOE_PIN3                  3U
131
#define GPIOE_PIN4                  4U
132
#define GPIOE_PIN5                  5U
133
#define GPIOE_PIN6                  6U
134
#define GPIOE_PIN7                  7U
135
#define GPIOE_PIN8                  8U
136
#define GPIOE_PIN9                  9U
137
#define GPIOE_PIN10                 10U
138
#define GPIOE_PIN11                 11U
139
#define GPIOE_PIN12                 12U
140
#define GPIOE_PIN13                 13U
141
#define GPIOE_PIN14                 14U
142
#define GPIOE_PIN15                 15U
143

  
144
#define GPIOF_PIN0                  0U
145
#define GPIOF_PIN1                  1U
146
#define GPIOF_PIN2                  2U
147
#define GPIOF_PIN3                  3U
148
#define GPIOF_PIN4                  4U
149
#define GPIOF_PIN5                  5U
150
#define GPIOF_PIN6                  6U
151
#define GPIOF_PIN7                  7U
152
#define GPIOF_PIN8                  8U
153
#define GPIOF_PIN9                  9U
154
#define GPIOF_PIN10                 10U
155
#define GPIOF_PIN11                 11U
156
#define GPIOF_PIN12                 12U
157
#define GPIOF_PIN13                 13U
158
#define GPIOF_PIN14                 14U
159
#define GPIOF_PIN15                 15U
160

  
161
#define GPIOG_PIN0                  0U
162
#define GPIOG_PIN1                  1U
163
#define GPIOG_PIN2                  2U
164
#define GPIOG_PIN3                  3U
165
#define GPIOG_PIN4                  4U
166
#define GPIOG_PIN5                  5U
167
#define GPIOG_PIN6                  6U
168
#define GPIOG_PIN7                  7U
169
#define GPIOG_PIN8                  8U
170
#define GPIOG_PIN9                  9U
171
#define GPIOG_PIN10                 10U
172
#define GPIOG_PIN11                 11U
173
#define GPIOG_PIN12                 12U
174
#define GPIOG_PIN13                 13U
175
#define GPIOG_PIN14                 14U
176
#define GPIOG_PIN15                 15U
177

  
178
/*
179
 * IO lines assignments.
180
 */
181
#define LINE_WKUP                   PAL_LINE(GPIOA, GPIOA_WKUP)
182
#define LINE_LED                    PAL_LINE(GPIOA, GPIOA_LED)
183
#define LINE_DRIVE_PWM1A            PAL_LINE(GPIOA, GPIOA_DRIVE_PWM1A)
184
#define LINE_DRIVE_PWM1B            PAL_LINE(GPIOA, GPIOA_DRIVE_PWM1B)
185
#define LINE_MOTION_SCLK            PAL_LINE(GPIOA, GPIOA_MOTION_SCLK)
186
#define LINE_MOTION_MISO            PAL_LINE(GPIOA, GPIOA_MOTION_MISO)
187
#define LINE_MOTION_MOSI            PAL_LINE(GPIOA, GPIOA_MOTION_MOSI)
188
#define LINE_PROG_RX                PAL_LINE(GPIOA, GPIOA_PROG_RX)
189
#define LINE_PROG_TX                PAL_LINE(GPIOA, GPIOA_PROG_TX)
190
#define LINE_CAN_RX                 PAL_LINE(GPIOA, GPIOA_CAN_RX)
191
#define LINE_CAN_TX                 PAL_LINE(GPIOA, GPIOA_CAN_TX)
192
#define LINE_SWDIO                  PAL_LINE(GPIOA, GPIOA_SWDIO)
193
#define LINE_SWCLK                  PAL_LINE(GPIOA, GPIOA_SWCLK)
194
#define LINE_DRIVE_PWM2B            PAL_LINE(GPIOA, GPIOA_DRIVE_PWM2B)
195

  
196
#define LINE_DRIVE_SENSE2           PAL_LINE(GPIOB, GPIOB_DRIVE_SENSE2)
197
#define LINE_POWER_EN               PAL_LINE(GPIOB, GPIOB_POWER_EN)
198
#define LINE_DRIVE_PWM2A            PAL_LINE(GPIOB, GPIOB_DRIVE_PWM2A)
199
#define LINE_COMPASS_DRDY           PAL_LINE(GPIOB, GPIOB_COMPASS_DRDY)
200
#define LINE_DRIVE_ENC1A            PAL_LINE(GPIOB, GPIOB_DRIVE_ENC1A)
201
#define LINE_DRIVE_ENC1B            PAL_LINE(GPIOB, GPIOB_DRIVE_ENC1B)
202
#define LINE_COMPASS_SCL            PAL_LINE(GPIOB, GPIOB_COMPASS_SCL)
203
#define LINE_COMPASS_SDA            PAL_LINE(GPIOB, GPIOB_COMPASS_SDA)
204
#define LINE_IR_SCL                 PAL_LINE(GPIOB, GPIOB_IR_SCL)
205
#define LINE_IR_SDA                 PAL_LINE(GPIOB, GPIOB_IR_SDA)
206
#define LINE_IR_INT                 PAL_LINE(GPIOB, GPIOB_IR_INT)
207
#define LINE_GYRO_DRDY              PAL_LINE(GPIOB, GPIOB_GYRO_DRDY)
208
#define LINE_SYS_UART_UP            PAL_LINE(GPIOB, GPIOB_SYS_UART_UP)
209
#define LINE_ACCEL_INT_N            PAL_LINE(GPIOB, GPIOB_ACCEL_INT_N)
210

  
211
#define LINE_DRIVE_SENSE1           PAL_LINE(GPIOC, GPIOC_DRIVE_SENSE1)
212
#define LINE_SYS_INT_N              PAL_LINE(GPIOC, GPIOC_SYS_INT_N)
213
#define LINE_PATH_DCSTAT            PAL_LINE(GPIOC, GPIOC_PATH_DCSTAT)
214
#define LINE_PATH_DCEN              PAL_LINE(GPIOC, GPIOC_PATH_DCEN)
215
#define LINE_DRIVE_ENC2B            PAL_LINE(GPIOC, GPIOC_DRIVE_ENC2B)
216
#define LINE_DRIVE_ENC2A            PAL_LINE(GPIOC, GPIOC_DRIVE_ENC2A)
217
#define LINE_SYS_PD_N               PAL_LINE(GPIOC, GPIOC_SYS_PD_N)
218
#define LINE_SYS_REG_EN             PAL_LINE(GPIOC, GPIOC_SYS_REG_EN)
219
#define LINE_SYS_UART_RX            PAL_LINE(GPIOC, GPIOC_SYS_UART_RX)
220
#define LINE_SYS_UART_TX            PAL_LINE(GPIOC, GPIOC_SYS_UART_TX)
221
#define LINE_ACCEL_SS_N             PAL_LINE(GPIOC, GPIOC_ACCEL_SS_N)
222
#define LINE_GYRO_SS_N              PAL_LINE(GPIOC, GPIOC_GYRO_SS_N)
223

  
224
#define LINE_OSC_IN                 PAL_LINE(GPIOD, GPIOD_OSC_IN)
225
#define LINE_OSC_OUT                PAL_LINE(GPIOD, GPIOD_OSC_OUT)
226
#define LINE_SYS_WARMRST_N          PAL_LINE(GPIOD, GPIOD_SYS_WARMRST_N)
227

  
228
/*
229
 * I/O ports initial setup, this configuration is established soon after reset
230
 * in the initialization code.
231
 * Please refer to the STM32 Reference Manual for details.
232
 */
233
#define PIN_MODE_INPUT              0U
234
#define PIN_MODE_OUTPUT_2M          2U
235
#define PIN_MODE_OUTPUT_10M         1U
236
#define PIN_MODE_OUTPUT_50M         3U
237
#define PIN_CNF_INPUT_ANALOG        0U
238
#define PIN_CNF_INPUT_FLOATING      1U
239
#define PIN_CNF_INPUT_PULLX         2U
240
#define PIN_CNF_OUTPUT_PUSHPULL     0U
241
#define PIN_CNF_OUTPUT_OPENDRAIN    1U
242
#define PIN_CNF_ALTERNATE_PUSHPULL  2U
243
#define PIN_CNF_ALTERNATE_OPENDRAIN 3U
244
#define PIN_CR(pin, mode, cnf)      (((mode) | ((cnf) << 2U)) << (((pin) % 8U) * 4U))
245
#define PIN_ODR_LOW(n)              (0U << (n))
246
#define PIN_ODR_HIGH(n)             (1U << (n))
247

  
248
/*
249
 * GPIOA setup:
250
 *
251
 * PA0  - WKUP                      (input floating)
252
 * PA1  - LED                       (output opendrain high 50MHz)
253
 * PA2  - DRIVE_PWM1A               (alternate pushpull 50MHz)
254
 * PA3  - DRIVE_PWM1B               (alternate pushpull 50MHz)
255
 * PA4  - PIN4                      (input floating)
256
 * PA5  - MOTION_SCLK               (alternate pushpull 50MHz)
257
 * PA6  - MOTION_MISO               (input pullup)
258
 * PA7  - MOTION_MOSI               (alternate pushpull 50MHz)
259
 * PA8  - PIN8                      (input floating)
260
 * PA9  - PROG_RX                   (alternate pushpull 50MHz)
261
 * PA10 - PROG_TX                   (input pullup)
262
 * PA11 - CAN_RX                    (input pullup)
263
 * PA12 - CAN_TX                    (input floating)
264
 * PA13 - SWDIO                     (input pullup)
265
 * PA14 - SWCLK                     (input pullup)
266
 * PA15 - DRIVE_PWM2B               (alternate pushpull 50MHz)
267
 */
268
#define VAL_GPIOACRL                (PIN_CR(GPIOA_WKUP, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
269
                                     PIN_CR(GPIOA_LED, PIN_MODE_OUTPUT_50M, PIN_CNF_OUTPUT_OPENDRAIN) |            \
270
                                     PIN_CR(GPIOA_DRIVE_PWM1A, PIN_MODE_OUTPUT_50M, PIN_CNF_ALTERNATE_PUSHPULL) |  \
271
                                     PIN_CR(GPIOA_DRIVE_PWM1B, PIN_MODE_OUTPUT_50M, PIN_CNF_ALTERNATE_PUSHPULL) |  \
272
                                     PIN_CR(GPIOA_PIN4, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
273
                                     PIN_CR(GPIOA_MOTION_SCLK, PIN_MODE_OUTPUT_50M, PIN_CNF_ALTERNATE_PUSHPULL) |  \
274
                                     PIN_CR(GPIOA_MOTION_MISO, PIN_MODE_INPUT, PIN_CNF_INPUT_PULLX) |              \
275
                                     PIN_CR(GPIOA_MOTION_MOSI, PIN_MODE_OUTPUT_50M, PIN_CNF_ALTERNATE_PUSHPULL))
276
#define VAL_GPIOACRH                (PIN_CR(GPIOA_PIN8, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
277
                                     PIN_CR(GPIOA_PROG_RX, PIN_MODE_OUTPUT_50M, PIN_CNF_ALTERNATE_PUSHPULL) |      \
278
                                     PIN_CR(GPIOA_PROG_TX, PIN_MODE_INPUT, PIN_CNF_INPUT_PULLX) |                  \
279
                                     PIN_CR(GPIOA_CAN_RX, PIN_MODE_INPUT, PIN_CNF_INPUT_PULLX) |                   \
280
                                     PIN_CR(GPIOA_CAN_TX, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                \
281
                                     PIN_CR(GPIOA_SWDIO, PIN_MODE_INPUT, PIN_CNF_INPUT_PULLX) |                    \
282
                                     PIN_CR(GPIOA_SWCLK, PIN_MODE_INPUT, PIN_CNF_INPUT_PULLX) |                    \
283
                                     PIN_CR(GPIOA_DRIVE_PWM2B, PIN_MODE_OUTPUT_50M, PIN_CNF_ALTERNATE_PUSHPULL))
284
#define VAL_GPIOAODR                (PIN_ODR_HIGH(GPIOA_WKUP) |                                                    \
285
                                     PIN_ODR_HIGH(GPIOA_LED) |                                                     \
286
                                     PIN_ODR_HIGH(GPIOA_DRIVE_PWM1A) |                                             \
287
                                     PIN_ODR_HIGH(GPIOA_DRIVE_PWM1B) |                                             \
288
                                     PIN_ODR_LOW(GPIOA_PIN4) |                                                     \
289
                                     PIN_ODR_HIGH(GPIOA_MOTION_SCLK) |                                             \
290
                                     PIN_ODR_HIGH(GPIOA_MOTION_MISO) |                                             \
291
                                     PIN_ODR_HIGH(GPIOA_MOTION_MOSI) |                                             \
292
                                     PIN_ODR_LOW(GPIOA_PIN8) |                                                     \
293
                                     PIN_ODR_HIGH(GPIOA_PROG_RX) |                                                 \
294
                                     PIN_ODR_HIGH(GPIOA_PROG_TX) |                                                 \
295
                                     PIN_ODR_HIGH(GPIOA_CAN_RX) |                                                  \
296
                                     PIN_ODR_HIGH(GPIOA_CAN_TX) |                                                  \
297
                                     PIN_ODR_HIGH(GPIOA_SWDIO) |                                                   \
298
                                     PIN_ODR_HIGH(GPIOA_SWCLK) |                                                   \
299
                                     PIN_ODR_HIGH(GPIOA_DRIVE_PWM2B))
300

  
301
/*
302
 * GPIOB setup:
303
 *
304
 * PB0  - PIN0                      (input floating)
305
 * PB1  - DRIVE_SENSE2              (input analog)
306
 * PB2  - POWER_EN                  (output pushpull low 50MHz)
307
 * PB3  - DRIVE_PWM2A               (alternate pushpull 50MHz)
308
 * PB4  - PIN4                      (input floating)
309
 * PB5  - COMPASS_DRDY              (input pullup)
310
 * PB6  - DRIVE_ENC1A               (input floating)
311
 * PB7  - DRIVE_ENC1B               (input floating)
312
 * PB8  - COMPASS_SCL               (alternate opendrain 50MHz)
313
 * PB9  - COMPASS_SDA               (alternate opendrain 50MHz)
314
 * PB10 - IR_SCL                    (alternate opendrain 50MHz)
315
 * PB11 - IR_SDA                    (alternate opendrain 50MHz)
316
 * PB12 - IR_INT                    (input pullup)
317
 * PB13 - GYRO_DRDY                 (input pullup)
318
 * PB14 - SYS_UART_UP               (output opendrain high 50MHz)
319
 * PB15 - ACCEL_INT_N               (input pullup)
320
 */
321
#define VAL_GPIOBCRL                (PIN_CR(GPIOB_PIN0, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
322
                                     PIN_CR(GPIOB_DRIVE_SENSE2, PIN_MODE_INPUT, PIN_CNF_INPUT_ANALOG) |            \
323
                                     PIN_CR(GPIOB_POWER_EN, PIN_MODE_OUTPUT_50M, PIN_CNF_OUTPUT_PUSHPULL) |        \
324
                                     PIN_CR(GPIOB_DRIVE_PWM2A, PIN_MODE_OUTPUT_50M, PIN_CNF_ALTERNATE_PUSHPULL) |  \
325
                                     PIN_CR(GPIOB_PIN4, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
326
                                     PIN_CR(GPIOB_COMPASS_DRDY, PIN_MODE_INPUT, PIN_CNF_INPUT_PULLX) |             \
327
                                     PIN_CR(GPIOB_DRIVE_ENC1A, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |           \
328
                                     PIN_CR(GPIOB_DRIVE_ENC1B, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING))
329
#define VAL_GPIOBCRH                (PIN_CR(GPIOB_COMPASS_SCL, PIN_MODE_OUTPUT_50M, PIN_CNF_ALTERNATE_OPENDRAIN) | \
330
                                     PIN_CR(GPIOB_COMPASS_SDA, PIN_MODE_OUTPUT_50M, PIN_CNF_ALTERNATE_OPENDRAIN) | \
331
                                     PIN_CR(GPIOB_IR_SCL, PIN_MODE_OUTPUT_50M, PIN_CNF_ALTERNATE_OPENDRAIN) |      \
332
                                     PIN_CR(GPIOB_IR_SDA, PIN_MODE_OUTPUT_50M, PIN_CNF_ALTERNATE_OPENDRAIN) |      \
333
                                     PIN_CR(GPIOB_IR_INT, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                \
334
                                     PIN_CR(GPIOB_GYRO_DRDY, PIN_MODE_INPUT, PIN_CNF_INPUT_PULLX) |                \
335
                                     PIN_CR(GPIOB_SYS_UART_UP, PIN_MODE_OUTPUT_50M, PIN_CNF_OUTPUT_OPENDRAIN) |    \
336
                                     PIN_CR(GPIOB_ACCEL_INT_N, PIN_MODE_INPUT, PIN_CNF_INPUT_PULLX))
337
#define VAL_GPIOBODR                (PIN_ODR_LOW(GPIOB_PIN0) |                                                     \
338
                                     PIN_ODR_HIGH(GPIOB_DRIVE_SENSE2) |                                            \
339
                                     PIN_ODR_LOW(GPIOB_POWER_EN) |                                                 \
340
                                     PIN_ODR_HIGH(GPIOB_DRIVE_PWM2A) |                                             \
341
                                     PIN_ODR_LOW(GPIOB_PIN4) |                                                     \
342
                                     PIN_ODR_HIGH(GPIOB_COMPASS_DRDY) |                                            \
343
                                     PIN_ODR_HIGH(GPIOB_DRIVE_ENC1A) |                                             \
344
                                     PIN_ODR_HIGH(GPIOB_DRIVE_ENC1B) |                                             \
345
                                     PIN_ODR_HIGH(GPIOB_COMPASS_SCL) |                                             \
346
                                     PIN_ODR_HIGH(GPIOB_COMPASS_SDA) |                                             \
347
                                     PIN_ODR_HIGH(GPIOB_IR_SCL) |                                                  \
348
                                     PIN_ODR_HIGH(GPIOB_IR_SDA) |                                                  \
349
                                     PIN_ODR_HIGH(GPIOB_IR_INT) |                                                  \
350
                                     PIN_ODR_HIGH(GPIOB_GYRO_DRDY) |                                               \
351
                                     PIN_ODR_HIGH(GPIOB_SYS_UART_UP) |                                             \
352
                                     PIN_ODR_HIGH(GPIOB_ACCEL_INT_N))
353

  
354
/*
355
 * GPIOC setup:
356
 *
357
 * PC0  - DRIVE_SENSE1              (input analog)
358
 * PC1  - SYS_INT_N                 (output opendrain low 50MHz)
359
 * PC2  - PIN2                      (input floating)
360
 * PC3  - PATH_DCSTAT               (input floating)
361
 * PC4  - PIN4                      (input floating)
362
 * PC5  - PATH_DCEN                 (output pushpull low 50MHz)
363
 * PC6  - DRIVE_ENC2B               (input floating)
364
 * PC7  - DRIVE_ENC2A               (input floating)
365
 * PC8  - SYS_PD_N                  (output opendrain high 50MHz)
366
 * PC9  - SYS_REG_EN                (input floating)
367
 * PC10 - SYS_UART_RX               (input floating)
368
 * PC11 - SYS_UART_TX               (input floating)
369
 * PC12 - PIN12                     (input pullup)
370
 * PC13 - ACCEL_SS_N                (output pushpull high 50MHz)
371
 * PC14 - GYRO_SS_N                 (output pushpull high 50MHz)
372
 * PC15 - PIN15                     (input floating)
373
 */
374
#define VAL_GPIOCCRL                (PIN_CR(GPIOC_DRIVE_SENSE1, PIN_MODE_INPUT, PIN_CNF_INPUT_ANALOG) |            \
375
                                     PIN_CR(GPIOC_SYS_INT_N, PIN_MODE_OUTPUT_50M, PIN_CNF_OUTPUT_OPENDRAIN) |           \
376
                                     PIN_CR(GPIOC_PIN2, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
377
                                     PIN_CR(GPIOC_PATH_DCSTAT, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |           \
378
                                     PIN_CR(GPIOC_PIN4, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
379
                                     PIN_CR(GPIOC_PATH_DCEN, PIN_MODE_OUTPUT_50M, PIN_CNF_OUTPUT_PUSHPULL) |       \
380
                                     PIN_CR(GPIOC_DRIVE_ENC2B, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |           \
381
                                     PIN_CR(GPIOC_DRIVE_ENC2A, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING))
382
#define VAL_GPIOCCRH                (PIN_CR(GPIOC_SYS_PD_N, PIN_MODE_OUTPUT_50M, PIN_CNF_OUTPUT_OPENDRAIN) |       \
383
                                     PIN_CR(GPIOC_SYS_REG_EN, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |            \
384
                                     PIN_CR(GPIOC_SYS_UART_RX, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |           \
385
                                     PIN_CR(GPIOC_SYS_UART_TX, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |           \
386
                                     PIN_CR(GPIOC_PIN12, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                 \
387
                                     PIN_CR(GPIOC_ACCEL_SS_N, PIN_MODE_OUTPUT_50M, PIN_CNF_OUTPUT_PUSHPULL) |      \
388
                                     PIN_CR(GPIOC_GYRO_SS_N, PIN_MODE_OUTPUT_50M, PIN_CNF_OUTPUT_PUSHPULL) |       \
389
                                     PIN_CR(GPIOC_PIN15, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING))
390
#define VAL_GPIOCODR                (PIN_ODR_HIGH(GPIOC_DRIVE_SENSE1) |                                            \
391
                                     PIN_ODR_LOW(GPIOC_SYS_INT_N) |                                                \
392
                                     PIN_ODR_LOW(GPIOC_PIN2) |                                                     \
393
                                     PIN_ODR_HIGH(GPIOC_PATH_DCSTAT) |                                             \
394
                                     PIN_ODR_LOW(GPIOC_PIN4) |                                                     \
395
                                     PIN_ODR_LOW(GPIOC_PATH_DCEN) |                                                \
396
                                     PIN_ODR_HIGH(GPIOC_DRIVE_ENC2B) |                                             \
397
                                     PIN_ODR_HIGH(GPIOC_DRIVE_ENC2A) |                                             \
398
                                     PIN_ODR_HIGH(GPIOC_SYS_PD_N) |                                                \
399
                                     PIN_ODR_HIGH(GPIOC_SYS_REG_EN) |                                              \
400
                                     PIN_ODR_HIGH(GPIOC_SYS_UART_RX) |                                             \
401
                                     PIN_ODR_HIGH(GPIOC_SYS_UART_TX) |                                             \
402
                                     PIN_ODR_LOW(GPIOC_PIN12) |                                                    \
403
                                     PIN_ODR_HIGH(GPIOC_ACCEL_SS_N) |                                              \
404
                                     PIN_ODR_HIGH(GPIOC_GYRO_SS_N) |                                               \
405
                                     PIN_ODR_LOW(GPIOC_PIN15))
406

  
407
/*
408
 * GPIOD setup:
409
 *
410
 * PD0  - OSC_IN                    (input floating)
411
 * PD1  - OSC_OUT                   (input floating)
412
 * PD2  - SYS_WARMRST_N             (output opendrain high 50MHz)
413
 * PD3  - PIN3                      (input floating)
414
 * PD4  - PIN4                      (input floating)
415
 * PD5  - PIN5                      (input floating)
416
 * PD6  - PIN6                      (input floating)
417
 * PD7  - PIN7                      (input floating)
418
 * PD8  - PIN8                      (input floating)
419
 * PD9  - PIN9                      (input floating)
420
 * PD10 - PIN10                     (input floating)
421
 * PD11 - PIN11                     (input floating)
422
 * PD12 - PIN12                     (input floating)
423
 * PD13 - PIN13                     (input floating)
424
 * PD14 - PIN14                     (input floating)
425
 * PD15 - PIN15                     (input floating)
426
 */
427
#define VAL_GPIODCRL                (PIN_CR(GPIOD_OSC_IN, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                \
428
                                     PIN_CR(GPIOD_OSC_OUT, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |               \
429
                                     PIN_CR(GPIOD_SYS_WARMRST_N, PIN_MODE_OUTPUT_50M, PIN_CNF_OUTPUT_OPENDRAIN) |  \
430
                                     PIN_CR(GPIOD_PIN3, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
431
                                     PIN_CR(GPIOD_PIN4, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
432
                                     PIN_CR(GPIOD_PIN5, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
433
                                     PIN_CR(GPIOD_PIN6, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
434
                                     PIN_CR(GPIOD_PIN7, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING))
435
#define VAL_GPIODCRH                (PIN_CR(GPIOD_PIN8, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
436
                                     PIN_CR(GPIOD_PIN9, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
437
                                     PIN_CR(GPIOD_PIN10, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                 \
438
                                     PIN_CR(GPIOD_PIN11, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                 \
439
                                     PIN_CR(GPIOD_PIN12, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                 \
440
                                     PIN_CR(GPIOD_PIN13, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                 \
441
                                     PIN_CR(GPIOD_PIN14, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                 \
442
                                     PIN_CR(GPIOD_PIN15, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING))
443
#define VAL_GPIODODR                (PIN_ODR_HIGH(GPIOD_OSC_IN) |                                                  \
444
                                     PIN_ODR_HIGH(GPIOD_OSC_OUT) |                                                 \
445
                                     PIN_ODR_HIGH(GPIOD_SYS_WARMRST_N) |                                           \
446
                                     PIN_ODR_LOW(GPIOD_PIN3) |                                                     \
447
                                     PIN_ODR_LOW(GPIOD_PIN4) |                                                     \
448
                                     PIN_ODR_LOW(GPIOD_PIN5) |                                                     \
449
                                     PIN_ODR_LOW(GPIOD_PIN6) |                                                     \
450
                                     PIN_ODR_LOW(GPIOD_PIN7) |                                                     \
451
                                     PIN_ODR_LOW(GPIOD_PIN8) |                                                     \
452
                                     PIN_ODR_LOW(GPIOD_PIN9) |                                                     \
453
                                     PIN_ODR_LOW(GPIOD_PIN10) |                                                    \
454
                                     PIN_ODR_LOW(GPIOD_PIN11) |                                                    \
455
                                     PIN_ODR_LOW(GPIOD_PIN12) |                                                    \
456
                                     PIN_ODR_LOW(GPIOD_PIN13) |                                                    \
457
                                     PIN_ODR_LOW(GPIOD_PIN14) |                                                    \
458
                                     PIN_ODR_LOW(GPIOD_PIN15))
459

  
460
/*
461
 * GPIOE setup:
462
 *
463
 * PE0  - PIN0                      (input floating)
464
 * PE1  - PIN1                      (input floating)
465
 * PE2  - PIN2                      (input floating)
466
 * PE3  - PIN3                      (input floating)
467
 * PE4  - PIN4                      (input floating)
468
 * PE5  - PIN5                      (input floating)
469
 * PE6  - PIN6                      (input floating)
470
 * PE7  - PIN7                      (input floating)
471
 * PE8  - PIN8                      (input floating)
472
 * PE9  - PIN9                      (input floating)
473
 * PE10 - PIN10                     (input floating)
474
 * PE11 - PIN11                     (input floating)
475
 * PE12 - PIN12                     (input floating)
476
 * PE13 - PIN13                     (input floating)
477
 * PE14 - PIN14                     (input floating)
478
 * PE15 - PIN15                     (input floating)
479
 */
480
#define VAL_GPIOECRL                (PIN_CR(GPIOE_PIN0, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
481
                                     PIN_CR(GPIOE_PIN1, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
482
                                     PIN_CR(GPIOE_PIN2, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
483
                                     PIN_CR(GPIOE_PIN3, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
484
                                     PIN_CR(GPIOE_PIN4, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
485
                                     PIN_CR(GPIOE_PIN5, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
486
                                     PIN_CR(GPIOE_PIN6, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
487
                                     PIN_CR(GPIOE_PIN7, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING))
488
#define VAL_GPIOECRH                (PIN_CR(GPIOE_PIN8, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
489
                                     PIN_CR(GPIOE_PIN9, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
490
                                     PIN_CR(GPIOE_PIN10, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                 \
491
                                     PIN_CR(GPIOE_PIN11, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                 \
492
                                     PIN_CR(GPIOE_PIN12, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                 \
493
                                     PIN_CR(GPIOE_PIN13, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                 \
494
                                     PIN_CR(GPIOE_PIN14, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                 \
495
                                     PIN_CR(GPIOE_PIN15, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING))
496
#define VAL_GPIOEODR                (PIN_ODR_LOW(GPIOE_PIN0) |                                                     \
497
                                     PIN_ODR_LOW(GPIOE_PIN1) |                                                     \
498
                                     PIN_ODR_LOW(GPIOE_PIN2) |                                                     \
499
                                     PIN_ODR_LOW(GPIOE_PIN3) |                                                     \
500
                                     PIN_ODR_LOW(GPIOE_PIN4) |                                                     \
501
                                     PIN_ODR_LOW(GPIOE_PIN5) |                                                     \
502
                                     PIN_ODR_LOW(GPIOE_PIN6) |                                                     \
503
                                     PIN_ODR_LOW(GPIOE_PIN7) |                                                     \
504
                                     PIN_ODR_LOW(GPIOE_PIN8) |                                                     \
505
                                     PIN_ODR_LOW(GPIOE_PIN9) |                                                     \
506
                                     PIN_ODR_LOW(GPIOE_PIN10) |                                                    \
507
                                     PIN_ODR_LOW(GPIOE_PIN11) |                                                    \
508
                                     PIN_ODR_LOW(GPIOE_PIN12) |                                                    \
509
                                     PIN_ODR_LOW(GPIOE_PIN13) |                                                    \
510
                                     PIN_ODR_LOW(GPIOE_PIN14) |                                                    \
511
                                     PIN_ODR_LOW(GPIOE_PIN15))
512

  
513
/*
514
 * GPIOF setup:
515
 *
516
 * PF0  - PIN0                      (input floating)
517
 * PF1  - PIN1                      (input floating)
518
 * PF2  - PIN2                      (input floating)
519
 * PF3  - PIN3                      (input floating)
520
 * PF4  - PIN4                      (input floating)
521
 * PF5  - PIN5                      (input floating)
522
 * PF6  - PIN6                      (input floating)
523
 * PF7  - PIN7                      (input floating)
524
 * PF8  - PIN8                      (input floating)
525
 * PF9  - PIN9                      (input floating)
526
 * PF10 - PIN10                     (input floating)
527
 * PF11 - PIN11                     (input floating)
528
 * PF12 - PIN12                     (input floating)
529
 * PF13 - PIN13                     (input floating)
530
 * PF14 - PIN14                     (input floating)
531
 * PF15 - PIN15                     (input floating)
532
 */
533
#define VAL_GPIOFCRL                (PIN_CR(GPIOF_PIN0, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
534
                                     PIN_CR(GPIOF_PIN1, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
535
                                     PIN_CR(GPIOF_PIN2, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
536
                                     PIN_CR(GPIOF_PIN3, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
537
                                     PIN_CR(GPIOF_PIN4, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
538
                                     PIN_CR(GPIOF_PIN5, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
539
                                     PIN_CR(GPIOF_PIN6, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
540
                                     PIN_CR(GPIOF_PIN7, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING))
541
#define VAL_GPIOFCRH                (PIN_CR(GPIOF_PIN8, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
542
                                     PIN_CR(GPIOF_PIN9, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
543
                                     PIN_CR(GPIOF_PIN10, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                 \
544
                                     PIN_CR(GPIOF_PIN11, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                 \
545
                                     PIN_CR(GPIOF_PIN12, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                 \
546
                                     PIN_CR(GPIOF_PIN13, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                 \
547
                                     PIN_CR(GPIOF_PIN14, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                 \
548
                                     PIN_CR(GPIOF_PIN15, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING))
549
#define VAL_GPIOFODR                (PIN_ODR_LOW(GPIOF_PIN0) |                                                     \
550
                                     PIN_ODR_LOW(GPIOF_PIN1) |                                                     \
551
                                     PIN_ODR_LOW(GPIOF_PIN2) |                                                     \
552
                                     PIN_ODR_LOW(GPIOF_PIN3) |                                                     \
553
                                     PIN_ODR_LOW(GPIOF_PIN4) |                                                     \
554
                                     PIN_ODR_LOW(GPIOF_PIN5) |                                                     \
555
                                     PIN_ODR_LOW(GPIOF_PIN6) |                                                     \
556
                                     PIN_ODR_LOW(GPIOF_PIN7) |                                                     \
557
                                     PIN_ODR_LOW(GPIOF_PIN8) |                                                     \
558
                                     PIN_ODR_LOW(GPIOF_PIN9) |                                                     \
559
                                     PIN_ODR_LOW(GPIOF_PIN10) |                                                    \
560
                                     PIN_ODR_LOW(GPIOF_PIN11) |                                                    \
561
                                     PIN_ODR_LOW(GPIOF_PIN12) |                                                    \
562
                                     PIN_ODR_LOW(GPIOF_PIN13) |                                                    \
563
                                     PIN_ODR_LOW(GPIOF_PIN14) |                                                    \
564
                                     PIN_ODR_LOW(GPIOF_PIN15))
565

  
566
/*
567
 * GPIOG setup:
568
 *
569
 * PG0  - PIN0                      (input floating)
570
 * PG1  - PIN1                      (input floating)
571
 * PG2  - PIN2                      (input floating)
572
 * PG3  - PIN3                      (input floating)
573
 * PG4  - PIN4                      (input floating)
574
 * PG5  - PIN5                      (input floating)
575
 * PG6  - PIN6                      (input floating)
576
 * PG7  - PIN7                      (input floating)
577
 * PG8  - PIN8                      (input floating)
578
 * PG9  - PIN9                      (input floating)
579
 * PG10 - PIN10                     (input floating)
580
 * PG11 - PIN11                     (input floating)
581
 * PG12 - PIN12                     (input floating)
582
 * PG13 - PIN13                     (input floating)
583
 * PG14 - PIN14                     (input floating)
584
 * PG15 - PIN15                     (input floating)
585
 */
586
#define VAL_GPIOGCRL                (PIN_CR(GPIOG_PIN0, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
587
                                     PIN_CR(GPIOG_PIN1, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
588
                                     PIN_CR(GPIOG_PIN2, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
589
                                     PIN_CR(GPIOG_PIN3, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
590
                                     PIN_CR(GPIOG_PIN4, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
591
                                     PIN_CR(GPIOG_PIN5, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
592
                                     PIN_CR(GPIOG_PIN6, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
593
                                     PIN_CR(GPIOG_PIN7, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING))
594
#define VAL_GPIOGCRH                (PIN_CR(GPIOG_PIN8, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
595
                                     PIN_CR(GPIOG_PIN9, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                  \
596
                                     PIN_CR(GPIOG_PIN10, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                 \
597
                                     PIN_CR(GPIOG_PIN11, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                 \
598
                                     PIN_CR(GPIOG_PIN12, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                 \
599
                                     PIN_CR(GPIOG_PIN13, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                 \
600
                                     PIN_CR(GPIOG_PIN14, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING) |                 \
601
                                     PIN_CR(GPIOG_PIN15, PIN_MODE_INPUT, PIN_CNF_INPUT_FLOATING))
602
#define VAL_GPIOGODR                (PIN_ODR_LOW(GPIOG_PIN0) |                                                     \
603
                                     PIN_ODR_LOW(GPIOG_PIN1) |                                                     \
604
                                     PIN_ODR_LOW(GPIOG_PIN2) |                                                     \
605
                                     PIN_ODR_LOW(GPIOG_PIN3) |                                                     \
606
                                     PIN_ODR_LOW(GPIOG_PIN4) |                                                     \
607
                                     PIN_ODR_LOW(GPIOG_PIN5) |                                                     \
608
                                     PIN_ODR_LOW(GPIOG_PIN6) |                                                     \
609
                                     PIN_ODR_LOW(GPIOG_PIN7) |                                                     \
610
                                     PIN_ODR_LOW(GPIOG_PIN8) |                                                     \
611
                                     PIN_ODR_LOW(GPIOG_PIN9) |                                                     \
612
                                     PIN_ODR_LOW(GPIOG_PIN10) |                                                    \
613
                                     PIN_ODR_LOW(GPIOG_PIN11) |                                                    \
614
                                     PIN_ODR_LOW(GPIOG_PIN12) |                                                    \
615
                                     PIN_ODR_LOW(GPIOG_PIN13) |                                                    \
616
                                     PIN_ODR_LOW(GPIOG_PIN14) |                                                    \
617
                                     PIN_ODR_LOW(GPIOG_PIN15))
618

  
619
#if !defined(_FROM_ASM_)
620
#ifdef __cplusplus
621
extern "C" {
622
#endif
623
  void boardInit(void);
624
#ifdef __cplusplus
625
}
626
#endif
627
#endif /* _FROM_ASM_ */
628

  
629
#endif /* _BOARD_H_ */
modules/DiWheelDrive_1-1/board.mk
1
################################################################################
2
# AMiRo-OS is an operating system designed for the Autonomous Mini Robot       #
3
# (AMiRo) platform.                                                            #
4
# Copyright (C) 2016..2018  Thomas Schöpping et al.                            #
5
#                                                                              #
6
# This program is free software: you can redistribute it and/or modify         #
7
# it under the terms of the GNU General Public License as published by         #
8
# the Free Software Foundation, either version 3 of the License, or            #
9
# (at your option) any later version.                                          #
10
#                                                                              #
11
# This program is distributed in the hope that it will be useful,              #
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of               #
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                #
14
# GNU General Public License for more details.                                 #
15
#                                                                              #
16
# You should have received a copy of the GNU General Public License            #
17
# along with this program.  If not, see <http://www.gnu.org/licenses/>.        #
18
#                                                                              #
19
# This research/work was supported by the Cluster of Excellence Cognitive      #
20
# Interaction Technology 'CITEC' (EXC 277) at Bielefeld University, which is   #
21
# funded by the German Research Foundation (DFG).                              #
22
################################################################################
23

  
24

  
25

  
26
# absolute path to this directory
27
BOARD_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
28

  
29
# include paths
30
BOARDINC = $(BOARD_DIR)
31

  
32
# C source files
33
BOARDSRC = $(BOARD_DIR)board.c
34

  
35
# linker path
36
BOARDLD = $(AMIROOS)/hal/ports
modules/DiWheelDrive_1-1/chconf.h
1
/*
2
AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
3
Copyright (C) 2016..2018  Thomas Schöpping et al.
4

  
5
This program is free software: you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation, either version 3 of the License, or
8
(at your option) any later version.
9

  
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
GNU General Public License for more details.
14

  
15
You should have received a copy of the GNU General Public License
16
along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
*/
18

  
19
/**
20
 * @file    os/modules/DiWheelDrive/chconf.h
21
 * @brief   ChibiOS Configuration file for the DiWheelDrive v1.1 module.
22
 * @details Contains the application specific kernel settings.
23
 *
24
 * @addtogroup config
25
 * @details Kernel related settings and hooks.
26
 * @{
27
 */
28

  
29
#ifndef _CHCONF_H_
30
#define _CHCONF_H_
31

  
32
#include <aosconf.h>
33

  
34
/*===========================================================================*/
35
/**
36
 * @name System timers settings
37
 * @{
38
 */
39
/*===========================================================================*/
40

  
41
/**
42
 * @brief   System time counter resolution.
43
 * @note    Allowed values are 16 or 32 bits.
44
 */
45
#define CH_CFG_ST_RESOLUTION                16
46

  
47
/**
48
 * @brief   System tick frequency.
49
 * @details Frequency of the system timer that drives the system ticks. This
50
 *          setting also defines the system tick time unit.
51
 */
52
#if (AMIROOS_CFG_TESTS_ENABLE != true) || defined(__DOXYGEN__)
53
#define CH_CFG_ST_FREQUENCY                 1000000UL
54
#else
55
#define CH_CFG_ST_FREQUENCY                 100000UL
56
#endif
57

  
58
/**
59
 * @brief   Time delta constant for the tick-less mode.
60
 * @note    If this value is zero then the system uses the classic
61
 *          periodic tick. This value represents the minimum number
62
 *          of ticks that is safe to specify in a timeout directive.
63
 *          The value one is not valid, timeouts are rounded up to
64
 *          this value.
65
 */
66
#if (AMIROOS_CFG_TESTS_ENABLE != true) || defined(__DOXYGEN__)
67
#define CH_CFG_ST_TIMEDELTA                 10
68
#else
69
#define CH_CFG_ST_TIMEDELTA                 2
70
#endif
71

  
72
/** @} */
73

  
74
/*===========================================================================*/
75
/**
76
 * @name Port specific settings
77
 * @{
78
 */
79
/*===========================================================================*/
80

  
81
/**
82
 * @brief   NVIC VTOR initialization offset.
83
 * @details On initialization, the code at this address in the flash memory will be executed.
84
 */
85
#define CORTEX_VTOR_INIT 0x00006000U
86

  
87
/** @} */
88

  
89
#include <aos_chconf.h>
90

  
91
#endif  /* _CHCONF_H_ */
92

  
93
/** @} */
modules/DiWheelDrive_1-1/halconf.h
1
/*
2
AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
3
Copyright (C) 2016..2018  Thomas Schöpping et al.
4

  
5
This program is free software: you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation, either version 3 of the License, or
8
(at your option) any later version.
9

  
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
GNU General Public License for more details.
14

  
15
You should have received a copy of the GNU General Public License
16
along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
*/
18

  
19
/**
20
 * @file    os/modules/DiWheelDrive/halconf.h
21
 * @brief   HAL configuration header for the DiWheelDrive v1.1 module.
22
 * @details HAL configuration file, this file allows to enable or disable the
23
 *          various device drivers from your application. You may also use
24
 *          this file in order to override the device drivers default settings.
25
 *
26
 * @addtogroup HAL_CONF
27
 * @{
28
 */
29

  
30
#ifndef _HALCONF_H_
31
#define _HALCONF_H_
32

  
33
/**
34
 * @brief   Enables the PAL subsystem.
35
 */
36
#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)
37
#define HAL_USE_PAL                 TRUE
38
#endif
39

  
40
/**
41
 * @brief   Enables the ADC subsystem.
42
 */
43
#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
44
#define HAL_USE_ADC                 FALSE
45
#endif
46

  
47
/**
48
 * @brief   Enables the CAN subsystem.
49
 */
50
#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
51
#define HAL_USE_CAN                 TRUE
52
#endif
53

  
54
/**
55
 * @brief   Enables the DAC subsystem.
56
 */
57
#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
58
#define HAL_USE_DAC                 FALSE
59
#endif
60

  
61
/**
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff