diff --git a/Firmware/carteHRI.uvoptx b/Firmware/carteHRI.uvoptx
index 8f2521d..4d80943 100644
--- a/Firmware/carteHRI.uvoptx
+++ b/Firmware/carteHRI.uvoptx
@@ -1,814 +1,827 @@
1.0
### uVision Project, (C) Keil Software
*.c
*.s*; *.src; *.a*
*.obj
*.lib
*.txt; *.h; *.inc
*.plm
*.cpp
0
0
0
Target 1
0x4
ARM-ADS
168000000
1
1
0
1
0
1
65535
0
0
0
79
66
8
.\lst\
1
1
1
0
1
1
0
1
0
0
0
0
1
1
1
1
1
1
1
0
0
1
0
1
18
0
User Manual (MCBSTM32F400)
C:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\MDK\Boards\Keil\MCBSTM32F400\Documentation\mcbstm32f200.chm
1
Schematics (MCBSTM32F400)
C:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\MDK\Boards\Keil\MCBSTM32F400\Documentation\mcbstm32f400-schematics.pdf
2
Getting Started (STM32F4-Discovery)
C:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\MDK\Boards\ST\STM32F4-Discovery\Documentation\DM00037368.pdf
3
User Manual (STM32F4-Discovery)
C:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\MDK\Boards\ST\STM32F4-Discovery\Documentation\DM00039084.pdf
4
Bill of Materials (STM32F4-Discovery)
C:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\MDK\Boards\ST\STM32F4-Discovery\Documentation\stm32f4discovery_bom.zip
5
Gerber Files (STM32F4-Discovery)
C:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\MDK\Boards\ST\STM32F4-Discovery\Documentation\stm32f4discovery_gerber.zip
6
Schematics (STM32F4-Discovery)
C:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\MDK\Boards\ST\STM32F4-Discovery\Documentation\stm32f4discovery_sch.zip
7
MCBSTM32F400 Evaluation Board Web Page (MCBSTM32F400)
http://www.keil.com/mcbstm32f400/
8
STM32F4-Discovery Web Page (STM32F4-Discovery)
http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1199/PF252419
0
1
1
1
1
1
1
1
1
1
0
1
1
1
0
1
1
1
1
0
0
11
STLink\ST-LINKIII-KEIL_SWO.dll
0
ARMRTXEVENTFLAGS
-L50 -Z18 -C0 -M0 -T0
0
DLGDARM
(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0)
0
DLGTARM
(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0)
0
ARMDBGFLAGS
-T0
0
DLGUARM
(105=-1,-1,-1,-1,0)
0
ST-LINKIII-KEIL_SWO
-U303030303030303030303031 -O8398 -S1 -C0 -A0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO19 -TC168000000 -TP21 -TDS8053 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC800 -FN1 -FF0STM32F4xx_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F407VG$CMSIS\Flash\STM32F4xx_1024.FLM)
0
UL2CM3
UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_1024 -FS08000000 -FL0100000 -FP0($$Device:STM32F407VG$Flash\STM32F4xx_1024.FLM))
0
1
uart_txBuffer[0]
1
1
uart_txBuffer[1]
2
1
demoSineOutput
3
1
ctrl_motorPosHall
4
1
ctrl_timestamp
0
2
motorCurrentDebug
1
2
motorTargetCurrentDebug
2
2
ctrl_motorTorque_mNm_c
3
2
motorTorque_mNm_dbg
4
2
motorTorque_mNm
5
2
nCycles
6
2
motorPosCod,0x0A
7
2
CurrentSensOffset,0x0A
8
2
motorCurrent_mA_mean
9
2
motorCurrent_mA
10
2
ADCValuesBuffer,0x0A
11
2
motorCurrent_mA
12
2
motorCurrentSum
13
2
debugVar01,0x0A
14
2
adcValues1,0x0A
15
2
motorCurrent_mA
0
0
1
1
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
STM32_files
1
0
0
0
1
1
1
0
0
0
0
.\src\system_stm32f4xx.c
system_stm32f4xx.c
0
0
1
2
2
0
0
0
0
.\startup_stm32f4xx.s
startup_stm32f4xx.s
0
0
SRC
1
0
0
0
2
3
1
0
0
0
0
.\src\main.c
main.c
0
0
2
4
1
0
0
0
0
.\src\communication.c
communication.c
0
0
2
5
1
0
0
0
0
.\src\controller.c
controller.c
0
0
STM32_libs
1
0
0
0
3
6
1
0
0
0
0
C:\STM32F4-Discovery_FW_V1.1.0\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_gpio.c
stm32f4xx_gpio.c
0
0
3
7
1
0
0
0
0
C:\STM32F4-Discovery_FW_V1.1.0\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_rcc.c
stm32f4xx_rcc.c
0
0
3
8
1
0
0
0
0
C:\STM32F4-Discovery_FW_V1.1.0\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_tim.c
stm32f4xx_tim.c
0
0
3
9
1
0
0
0
0
C:\STM32F4-Discovery_FW_V1.1.0\Libraries\STM32F4xx_StdPeriph_Driver\src\misc.c
misc.c
0
0
3
10
1
0
0
0
0
C:\STM32F4-Discovery_FW_V1.1.0\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_exti.c
stm32f4xx_exti.c
0
0
3
11
1
0
0
0
0
C:\STM32F4-Discovery_FW_V1.1.0\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_syscfg.c
stm32f4xx_syscfg.c
0
0
3
12
1
0
0
0
0
C:\STM32F4-Discovery_FW_V1.1.0\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_adc.c
stm32f4xx_adc.c
0
0
3
13
1
0
0
0
0
C:\STM32F4-Discovery_FW_V1.1.0\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_dac.c
stm32f4xx_dac.c
0
0
3
14
1
0
0
0
0
C:\STM32F4-Discovery_FW_V1.1.0\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_dma.c
stm32f4xx_dma.c
0
0
3
15
1
0
0
0
0
C:\STM32F4-Discovery_FW_V1.1.0\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_usart.c
stm32f4xx_usart.c
0
0
3
16
4
0
0
0
0
C:\STM32F4-Discovery_FW_V1.1.0\Libraries\CMSIS\Lib\ARM\arm_cortexM4lf_math.lib
arm_cortexM4lf_math.lib
0
0
3
17
1
0
0
0
0
C:\STM32F4-Discovery_FW_V1.1.0\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_i2c.c
stm32f4xx_i2c.c
0
0
SRC_drivers
1
0
0
0
4
18
1
0
0
0
0
.\src\drivers\adc.c
adc.c
0
0
4
19
1
0
0
0
0
.\src\drivers\callback_timers.c
callback_timers.c
0
0
4
20
1
0
0
0
0
.\src\drivers\dac.c
dac.c
0
0
4
21
1
0
0
0
0
.\src\drivers\h_bridge.c
h_bridge.c
0
0
4
22
1
0
0
0
0
.\src\drivers\incr_encoder.c
incr_encoder.c
0
0
4
23
1
0
0
0
0
.\src\drivers\uart.c
uart.c
0
0
4
24
1
0
0
0
0
.\src\drivers\hall.c
hall.c
0
0
4
25
1
0
0
0
0
.\src\drivers\led.c
led.c
0
0
4
26
1
0
0
0
0
.\src\drivers\debug_gpio.c
debug_gpio.c
0
0
4
27
1
0
0
0
0
.\src\drivers\button.c
button.c
0
0
4
28
1
0
0
0
0
.\src\drivers\i2c.c
i2c.c
0
0
4
29
1
0
0
0
0
.\src\drivers\mpu_6050.c
mpu_6050.c
0
0
+
+ 4
+ 30
+ 1
+ 0
+ 0
+ 0
+ 0
+ .\src\drivers\external_motorboard.c
+ external_motorboard.c
+ 0
+ 0
+
SRC_lib
1
0
0
0
5
- 30
+ 31
1
0
0
0
0
.\src\lib\basic_filter.c
basic_filter.c
0
0
5
- 31
+ 32
1
0
0
0
0
.\src\lib\pid.c
pid.c
0
0
5
- 32
+ 33
1
0
0
0
0
.\src\lib\utils.c
utils.c
0
0
5
- 33
+ 34
1
0
0
0
0
.\src\lib\circular_buffer.c
circular_buffer.c
0
0
diff --git a/Firmware/carteHRI.uvprojx b/Firmware/carteHRI.uvprojx
index 43e992c..078714b 100644
--- a/Firmware/carteHRI.uvprojx
+++ b/Firmware/carteHRI.uvprojx
@@ -1,606 +1,611 @@
2.1
### uVision Project, (C) Keil Software
Target 1
0x4
ARM-ADS
STM32F407VG
STMicroelectronics
Keil.STM32F4xx_DFP.2.5.0
http://www.keil.com/pack
IROM(0x08000000,0x100000) IRAM(0x20000000,0x20000) IRAM2(0x10000000,0x10000) CPUTYPE("Cortex-M4") FPU2 CLOCK(168000000) ELITTLE
UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_1024 -FS08000000 -FL0100000 -FP0($$Device:STM32F407VG$Flash\STM32F4xx_1024.FLM))
6103
$$Device:STM32F407VG$Device\Include\stm32f4xx.h
$$Device:STM32F407VG$SVD\STM32F40x.svd
0
0
0
0
0
0
1
.\output\
motorControl
1
0
1
1
1
.\lst\
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
3
1
SARMCM3.DLL
-REMAP -MPU
DCM.DLL
-pCM4
SARMCM3.DLL
-REMAP -MPU
TCM.DLL
-pCM4
1
0
0
0
16
0
1
1
1
1
1
1
1
0
1
1
1
0
1
1
1
0
1
1
1
0
11
STLink\ST-LINKIII-KEIL_SWO.dll
1
0
0
1
1
4096
1
BIN\UL2CM3.DLL
"" ()
0
0
1
1
1
1
1
1
1
0
1
1
0
1
1
0
0
1
1
1
1
1
1
1
1
1
0
0
"Cortex-M4"
0
0
0
1
1
0
0
2
1
0
8
0
0
0
3
3
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
1
0
0
0x0
0x0
0
0x0
0x0
0
0x0
0x0
0
0x0
0x0
0
0x0
0x0
0
0x0
0x0
0
0x20000000
0x20000
1
0x8000000
0x100000
0
0x0
0x0
1
0x0
0x0
1
0x0
0x0
1
0x0
0x0
1
0x8000000
0x100000
1
0x0
0x0
0
0x0
0x0
0
0x0
0x0
0
0x0
0x0
0
0x20000000
0x20000
0
0x10000000
0x10000
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
USE_STDPERIPH_DRIVER STM32F4XX ARM_MATH_CM4
..\CodeUC;.\inc;.\src;C:\STM32F4-Discovery_FW_V1.1.0\Libraries\CMSIS\ST\STM32F4xx\Include;C:\STM32F4-Discovery_FW_V1.1.0\Libraries\STM32F4xx_StdPeriph_Driver\inc;C:\STM32F4-Discovery_FW_V1.1.0\Utilities\STM32F4-Discovery;C:\STM32F4-Discovery_FW_V1.1.0\Libraries\CMSIS\Include
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0x08000000
0x20000000
STM32_files
system_stm32f4xx.c
1
.\src\system_stm32f4xx.c
startup_stm32f4xx.s
2
.\startup_stm32f4xx.s
SRC
main.c
1
.\src\main.c
communication.c
1
.\src\communication.c
controller.c
1
.\src\controller.c
STM32_libs
stm32f4xx_gpio.c
1
C:\STM32F4-Discovery_FW_V1.1.0\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_gpio.c
stm32f4xx_rcc.c
1
C:\STM32F4-Discovery_FW_V1.1.0\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_rcc.c
stm32f4xx_tim.c
1
C:\STM32F4-Discovery_FW_V1.1.0\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_tim.c
misc.c
1
C:\STM32F4-Discovery_FW_V1.1.0\Libraries\STM32F4xx_StdPeriph_Driver\src\misc.c
stm32f4xx_exti.c
1
C:\STM32F4-Discovery_FW_V1.1.0\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_exti.c
stm32f4xx_syscfg.c
1
C:\STM32F4-Discovery_FW_V1.1.0\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_syscfg.c
stm32f4xx_adc.c
1
C:\STM32F4-Discovery_FW_V1.1.0\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_adc.c
stm32f4xx_dac.c
1
C:\STM32F4-Discovery_FW_V1.1.0\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_dac.c
stm32f4xx_dma.c
1
C:\STM32F4-Discovery_FW_V1.1.0\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_dma.c
stm32f4xx_usart.c
1
C:\STM32F4-Discovery_FW_V1.1.0\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_usart.c
arm_cortexM4lf_math.lib
4
C:\STM32F4-Discovery_FW_V1.1.0\Libraries\CMSIS\Lib\ARM\arm_cortexM4lf_math.lib
stm32f4xx_i2c.c
1
C:\STM32F4-Discovery_FW_V1.1.0\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_i2c.c
SRC_drivers
adc.c
1
.\src\drivers\adc.c
callback_timers.c
1
.\src\drivers\callback_timers.c
dac.c
1
.\src\drivers\dac.c
h_bridge.c
1
.\src\drivers\h_bridge.c
incr_encoder.c
1
.\src\drivers\incr_encoder.c
uart.c
1
.\src\drivers\uart.c
hall.c
1
.\src\drivers\hall.c
led.c
1
.\src\drivers\led.c
debug_gpio.c
1
.\src\drivers\debug_gpio.c
button.c
1
.\src\drivers\button.c
i2c.c
1
.\src\drivers\i2c.c
mpu_6050.c
1
.\src\drivers\mpu_6050.c
+
+ external_motorboard.c
+ 1
+ .\src\drivers\external_motorboard.c
+
SRC_lib
basic_filter.c
1
.\src\lib\basic_filter.c
pid.c
1
.\src\lib\pid.c
utils.c
1
.\src\lib\utils.c
circular_buffer.c
1
.\src\lib\circular_buffer.c
diff --git a/Firmware/src/drivers/external_motorboard.c b/Firmware/src/drivers/external_motorboard.c
new file mode 100644
index 0000000..1eb9926
--- /dev/null
+++ b/Firmware/src/drivers/external_motorboard.c
@@ -0,0 +1,27 @@
+#include "external_motorboard.h"
+
+/**
+ * @brief Initializes the motorboard driver.
+ */
+void emot_Init(void)
+{
+ // Not implemented yet.
+}
+
+/**
+ * @brief Set the motor torque.
+ * @param torque the torque the motor should apply [N.m].
+ */
+void emot_SetTorque(float32_t torque)
+{
+
+}
+
+/**
+ * @brief Gets the current motor shaft position.
+ * @return the motor position given by the encoder [deg].
+ */
+float32_t emot_GetPosition(void)
+{
+ return 0.0f;
+}
diff --git a/Firmware/src/drivers/external_motorboard.h b/Firmware/src/drivers/external_motorboard.h
new file mode 100644
index 0000000..6d9549a
--- /dev/null
+++ b/Firmware/src/drivers/external_motorboard.h
@@ -0,0 +1,28 @@
+#ifndef __EXTERNAL_MOTORBOARD_H
+#define __EXTERNAL_MOTORBOARD_H
+
+#include "../main.h"
+
+/** @defgroup ExtMotorboard Driver / External motorboard
+ * @brief Driver for an external motorboard.
+ *
+ * This driver controls an external motorboard, controlled through a serial
+ * link. This allows driving larger motors.
+ *
+ * Call emot_Init() first in the initialization code. Then, call
+ * emot_SetTorque() to set the motor torque, and emot_GetPosition() to get the
+ * motor shaft position.
+ *
+ * @addtogroup ExtMotorboard
+ * @{
+ */
+
+void emot_Init(void);
+void emot_SetTorque(float32_t torque);
+float32_t emot_GetPosition(void);
+
+/**
+ * @}
+ */
+
+#endif