Changeset 63 for ctrl/firmware/Main/CubeMX/Core
- Timestamp:
- Jan 15, 2025, 10:01:55 AM (18 hours ago)
- Location:
- ctrl/firmware/Main/CubeMX/Core
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
ctrl/firmware/Main/CubeMX/Core/Inc/stm32h7xx_it.h
r54 r63 54 54 void DebugMon_Handler(void); 55 55 void DMA1_Stream0_IRQHandler(void); 56 void USART3_IRQHandler(void); 56 57 void SDMMC1_IRQHandler(void); 57 58 void TIM7_IRQHandler(void); -
ctrl/firmware/Main/CubeMX/Core/Src/gpio.c
r62 r63 156 156 HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); 157 157 158 /*Configure GPIO pins : PD11 PD12 PD14 PD15159 PD0 PD1 PD3 PD4160 PD5 PD6 */161 GPIO_InitStruct.Pin = GPIO_PIN_11|GPIO_PIN_12|GPIO_PIN_14|GPIO_PIN_15162 |GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_3|GPIO_PIN_4163 |GPIO_PIN_5|GPIO_PIN_6;164 GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;165 GPIO_InitStruct.Pull = GPIO_NOPULL;166 HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);167 168 158 /*Configure GPIO pin : GSM_STATUS_Pin */ 169 159 GPIO_InitStruct.Pin = GSM_STATUS_Pin; … … 171 161 GPIO_InitStruct.Pull = GPIO_NOPULL; 172 162 HAL_GPIO_Init(GSM_STATUS_GPIO_Port, &GPIO_InitStruct); 163 164 /*Configure GPIO pins : PD14 PD15 PD0 PD1 165 PD3 PD4 PD5 PD6 */ 166 GPIO_InitStruct.Pin = GPIO_PIN_14|GPIO_PIN_15|GPIO_PIN_0|GPIO_PIN_1 167 |GPIO_PIN_3|GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6; 168 GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; 169 GPIO_InitStruct.Pull = GPIO_NOPULL; 170 HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); 173 171 174 172 /*Configure GPIO pins : PG2 PG3 PG4 PG5 -
ctrl/firmware/Main/CubeMX/Core/Src/stm32h7xx_it.c
r54 r63 23 23 /* Private includes ----------------------------------------------------------*/ 24 24 /* USER CODE BEGIN Includes */ 25 26 #include "gsm_thread.h" 27 25 28 /* USER CODE END Includes */ 26 29 … … 59 62 extern DMA_HandleTypeDef hdma_spi4_tx; 60 63 extern SPI_HandleTypeDef hspi4; 64 extern UART_HandleTypeDef huart3; 61 65 extern TIM_HandleTypeDef htim7; 62 66 … … 178 182 179 183 /** 184 * @brief This function handles USART3 global interrupt. 185 */ 186 void USART3_IRQHandler(void) 187 { 188 /* USER CODE BEGIN USART3_IRQn 0 */ 189 190 /* USER CODE END USART3_IRQn 0 */ 191 HAL_UART_IRQHandler(&huart3); 192 /* USER CODE BEGIN USART3_IRQn 1 */ 193 194 /* USER CODE END USART3_IRQn 1 */ 195 } 196 197 /** 180 198 * @brief This function handles SDMMC1 global interrupt. 181 199 */ … … 221 239 /* USER CODE BEGIN 1 */ 222 240 241 void HAL_UART_RxCpltCallback(UART_HandleTypeDef * huart) 242 { 243 if (huart->Instance == USART3) gsmUnitSentData(); 244 } 245 246 //------------------------------------------------------------------------------ 247 223 248 /* USER CODE END 1 */ -
ctrl/firmware/Main/CubeMX/Core/Src/usart.c
r61 r63 49 49 huart3.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE; 50 50 huart3.Init.ClockPrescaler = UART_PRESCALER_DIV1; 51 huart3.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT; 51 huart3.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_SWAP_INIT|UART_ADVFEATURE_DMADISABLEONERROR_INIT; 52 huart3.AdvancedInit.Swap = UART_ADVFEATURE_SWAP_ENABLE; 53 huart3.AdvancedInit.DMADisableonRxError = UART_ADVFEATURE_DMA_DISABLEONRXERROR; 52 54 if (HAL_UART_Init(&huart3) != HAL_OK) 53 55 { … … 107 109 PD8 ------> USART3_TX 108 110 PD9 ------> USART3_RX 111 PD11 ------> USART3_CTS 112 PD12 ------> USART3_RTS 109 113 */ 110 GPIO_InitStruct.Pin = GPIO_PIN_8|GPIO_PIN_9 ;114 GPIO_InitStruct.Pin = GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_11|GPIO_PIN_12; 111 115 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; 112 116 GPIO_InitStruct.Pull = GPIO_NOPULL; … … 115 119 HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); 116 120 121 /* USART3 interrupt Init */ 122 HAL_NVIC_SetPriority(USART3_IRQn, 0, 0); 123 HAL_NVIC_EnableIRQ(USART3_IRQn); 117 124 /* USER CODE BEGIN USART3_MspInit 1 */ 118 125 … … 135 142 PD8 ------> USART3_TX 136 143 PD9 ------> USART3_RX 144 PD11 ------> USART3_CTS 145 PD12 ------> USART3_RTS 137 146 */ 138 HAL_GPIO_DeInit(GPIOD, GPIO_PIN_8|GPIO_PIN_9 );147 HAL_GPIO_DeInit(GPIOD, GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_11|GPIO_PIN_12); 139 148 149 /* USART3 interrupt Deinit */ 150 HAL_NVIC_DisableIRQ(USART3_IRQn); 140 151 /* USER CODE BEGIN USART3_MspDeInit 1 */ 141 152
Note: See TracChangeset
for help on using the changeset viewer.