Da Vinci Firmware 1
Firmware for the DaVinci-M rocket avionics board.
Loading...
Searching...
No Matches
main.h File Reference

: Header for main.c file. This file contains the common defines of the application. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void HAL_TIM_MspPostInit (TIM_HandleTypeDef *htim)
 
void Error_Handler (void)
 This function is executed in case of error occurrence.
 

Variables

QSPI_HandleTypeDef hqspi
 HAL QSPI handle for the external flash memory.
 
SPI_HandleTypeDef hspi2
 HAL SPI handle for Sensor Bus 1 (e.g., IMU, Baro).
 
SPI_HandleTypeDef hspi3
 HAL SPI handle for Sensor Bus 2 (e.g., secondary sensors).
 
TIM_HandleTypeDef htim15
 HAL Timer handle for the buzzer PWM.
 
uint8_t mainp
 Status flag for the main parachute pyro channel.
 
uint8_t drogue
 Status flag for the drogue parachute pyro channel.
 
bool flag_kf
 RTOS event flag to trigger the Kalman Filter task.
 
bool flag_MPC
 RTOS event flag to trigger the MPC task.
 
bool flag_flash
 RTOS event flag to trigger the data logging task.
 
bool flag_attitude
 RTOS event flag to trigger the attitude estimation task.
 

Detailed Description

: Header for main.c file. This file contains the common defines of the application.

Author
Francesco Abate, Tommaso Gualtierotti
Attention

Copyright (c) 2025 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.

— Doxygen Main Page and Groups —

/**

Definition in file main.h.

Function Documentation

◆ Error_Handler()

void Error_Handler ( void  )

This function is executed in case of error occurrence.

Return values
None

Definition at line 2042 of file main.c.

2043{
2044 /* USER CODE BEGIN Error_Handler_Debug */
2045 /* User can add his own implementation to report the HAL error return state */
2046 __disable_irq();
2047 while (1)
2048 {
2049 }
2050 /* USER CODE END Error_Handler_Debug */
2051}

Referenced by buzzer_init(), HAL_FDCAN_MspInit(), HAL_PCD_MspInit(), HAL_QSPI_MspInit(), HAL_SPI_MspInit(), HAL_UART_MspInit(), main(), MX_ADC1_Init(), MX_ADC2_Init(), MX_ADC3_Init(), MX_FDCAN1_Init(), MX_QUADSPI_Init(), MX_SPI1_Init(), MX_SPI2_Init(), MX_SPI3_Init(), MX_TIM13_Init(), MX_TIM15_Init(), MX_TIM2_Init(), MX_TIM6_Init(), MX_TIM7_Init(), MX_UART4_Init(), MX_USART1_UART_Init(), MX_USB_OTG_FS_PCD_Init(), PeriphCommonClock_Config(), StartReceiveVel_Task(), and SystemClock_Config().

Here is the caller graph for this function:

◆ HAL_TIM_MspPostInit()

void HAL_TIM_MspPostInit ( TIM_HandleTypeDef *  htim)

TIM2 GPIO Configuration PA2 ---—> TIM2_CH3

TIM15 GPIO Configuration PE6 ---—> TIM15_CH2

Definition at line 739 of file stm32h7xx_hal_msp.c.

740{
741 GPIO_InitTypeDef GPIO_InitStruct = {0};
742 if(htim->Instance==TIM2)
743 {
744 /* USER CODE BEGIN TIM2_MspPostInit 0 */
745
746 /* USER CODE END TIM2_MspPostInit 0 */
747 __HAL_RCC_GPIOA_CLK_ENABLE();
751 GPIO_InitStruct.Pin = TIM2_CH3_PWM_AIRBRAKES_Pin;
752 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
753 GPIO_InitStruct.Pull = GPIO_NOPULL;
754 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
755 GPIO_InitStruct.Alternate = GPIO_AF1_TIM2;
756 HAL_GPIO_Init(TIM2_CH3_PWM_AIRBRAKES_GPIO_Port, &GPIO_InitStruct);
757
758 /* USER CODE BEGIN TIM2_MspPostInit 1 */
759
760 /* USER CODE END TIM2_MspPostInit 1 */
761 }
762 else if(htim->Instance==TIM15)
763 {
764 /* USER CODE BEGIN TIM15_MspPostInit 0 */
765
766 /* USER CODE END TIM15_MspPostInit 0 */
767
768 __HAL_RCC_GPIOE_CLK_ENABLE();
772 GPIO_InitStruct.Pin = TIM15_CH2_BUZZER_Pin;
773 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
774 GPIO_InitStruct.Pull = GPIO_NOPULL;
775 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
776 GPIO_InitStruct.Alternate = GPIO_AF4_TIM15;
777 HAL_GPIO_Init(TIM15_CH2_BUZZER_GPIO_Port, &GPIO_InitStruct);
778
779 /* USER CODE BEGIN TIM15_MspPostInit 1 */
780
781 /* USER CODE END TIM15_MspPostInit 1 */
782 }
783
784}

Referenced by MX_TIM15_Init(), and MX_TIM2_Init().

Here is the caller graph for this function: