aboutsummaryrefslogtreecommitdiff
path: root/src/stm32/setup.h
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2023-03-10 12:26:33 +0100
committerlonkaars <loek@pipeframe.xyz>2023-03-10 12:26:33 +0100
commitc6563a099ce05d9291a0c27fdbab3ffd9efddc48 (patch)
tree82504aef99696e69ee425be2154e084e54e627ca /src/stm32/setup.h
parent5253459673bb006ef1313dfd2dfeea56f6d2ebaa (diff)
initial merge of #26
Diffstat (limited to 'src/stm32/setup.h')
-rw-r--r--src/stm32/setup.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/stm32/setup.h b/src/stm32/setup.h
new file mode 100644
index 0000000..66d5ff3
--- /dev/null
+++ b/src/stm32/setup.h
@@ -0,0 +1,24 @@
+#pragma once
+
+#include <stm32f0xx_hal_spi.h>
+#include <stm32f0xx_hal_uart.h>
+#include <stm32f0xx_hal_tim.h>
+#include <stm32f0xx_hal_gpio.h>
+
+#define HH_IO_SPI_PINS (GPIO_PIN_5 | GPIO_PIN_7)
+#define HH_IO_SPI_PORT GPIOA
+
+extern UART_HandleTypeDef huart2; // NOLINT
+extern GPIO_InitTypeDef spi_gpio; // NOLINT
+extern SPI_HandleTypeDef hspi1; // NOLINT
+extern TIM_HandleTypeDef htim3; // NOLINT
+
+// required HAL setup functions
+void HAL_MspInit(); // NOLINT
+void HAL_UART_MspInit(UART_HandleTypeDef *huart); // NOLINT
+void HAL_SPI_MspInit(SPI_HandleTypeDef* hspi); // NOLINT
+void HAL_SPI_MspDeInit(SPI_HandleTypeDef* hspi); // NOLINT
+void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* htim_base); // NOLINT
+void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* htim_base); // NOLINT
+void HardFault_Handler(); // NOLINT
+void SysTick_Handler(); // NOLINT