Trinity Devboard PCB V1.0 Firmware. FreeRTOS is setup and the MCU reads IMU data over SPI fand Magnetometer data over I2C, each with a seperate task. Sensordata is then run though MadgwickAHRS and send over USB as serial packet data to use in trinity visualizer. Bare minimum functionality works and is replicated from the first prototype.

This commit is contained in:
2026-09-13 19:51:03 +02:00
commit 7ee381de58
1630 changed files with 632404 additions and 0 deletions
+105
View File
@@ -0,0 +1,105 @@
/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file : main.h
* @brief : Header for main.c file.
* This file contains the common defines of the application.
******************************************************************************
* @attention
*
* Copyright (c) 2026 STMicroelectronics.
* All rights reserved.
*
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "stm32wbxx_hal.h"
#include "app_conf.h"
#include "app_entry.h"
#include "app_common.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
/* Exported types ------------------------------------------------------------*/
/* USER CODE BEGIN ET */
/* USER CODE END ET */
/* Exported constants --------------------------------------------------------*/
/* USER CODE BEGIN EC */
/* USER CODE END EC */
/* Exported macro ------------------------------------------------------------*/
/* USER CODE BEGIN EM */
/* USER CODE END EM */
void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);
/* Exported functions prototypes ---------------------------------------------*/
void Error_Handler(void);
/* USER CODE BEGIN EFP */
/* USER CODE END EFP */
/* Private defines -----------------------------------------------------------*/
#define SPI2_SD_MOSI_Pin GPIO_PIN_1
#define SPI2_SD_MOSI_GPIO_Port GPIOC
#define SPI2_SD_MISO_Pin GPIO_PIN_2
#define SPI2_SD_MISO_GPIO_Port GPIOC
#define GPIO_CONNECT_LED_Pin GPIO_PIN_0
#define GPIO_CONNECT_LED_GPIO_Port GPIOA
#define GPIO_STATUS_LED_Pin GPIO_PIN_1
#define GPIO_STATUS_LED_GPIO_Port GPIOA
#define GPIO_DEBUG_LED_Pin GPIO_PIN_2
#define GPIO_DEBUG_LED_GPIO_Port GPIOA
#define GPIO_SPI1_IMU_CS_Pin GPIO_PIN_3
#define GPIO_SPI1_IMU_CS_GPIO_Port GPIOA
#define SPI1_IMU_SCK_Pin GPIO_PIN_5
#define SPI1_IMU_SCK_GPIO_Port GPIOA
#define SPI1_IMU_MISO_Pin GPIO_PIN_6
#define SPI1_IMU_MISO_GPIO_Port GPIOA
#define SPI1_IMU_MOSI_Pin GPIO_PIN_7
#define SPI1_IMU_MOSI_GPIO_Port GPIOA
#define SPI2_SD_SCK_Pin GPIO_PIN_9
#define SPI2_SD_SCK_GPIO_Port GPIOA
#define GPIO_SPI2_SD_CD_Pin GPIO_PIN_5
#define GPIO_SPI2_SD_CD_GPIO_Port GPIOC
#define GPIO_SPI2_SD_CS_Pin GPIO_PIN_6
#define GPIO_SPI2_SD_CS_GPIO_Port GPIOC
#define GPIO_IMU_INT_Pin GPIO_PIN_10
#define GPIO_IMU_INT_GPIO_Port GPIOA
#define GPIO_MAGN_INT_Pin GPIO_PIN_11
#define GPIO_MAGN_INT_GPIO_Port GPIOC
#define GPIO_SD_LDO_EN_Pin GPIO_PIN_12
#define GPIO_SD_LDO_EN_GPIO_Port GPIOC
/* USER CODE BEGIN Private defines */
/* USER CODE END Private defines */
#ifdef __cplusplus
}
#endif
#endif /* __MAIN_H */