Add USART2 support and modify system clock configuration

- Implemented USART2 initialization and interrupt handling.
- Added a function to send data to the server via USART2.
- Updated the main application to utilize USART2 for communication.
- Changed system clock configuration to use HSE and PLL for higher frequency.
- Adjusted SPI1 baud rate prescaler for improved performance.
- Enhanced LED control logic based on RFID card detection.
- Updated project configuration to reflect new USART2 settings.
This commit is contained in:
2025-05-18 14:53:54 +02:00
parent 9676a8de3f
commit f8c5650c95
11 changed files with 311 additions and 115 deletions
+8 -1
View File
@@ -53,7 +53,7 @@ void MX_GPIO_Init(void)
HAL_GPIO_WritePin(SS_GPIO_Port, SS_Pin, GPIO_PIN_RESET);
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(PN532_RST_GPIO_Port, PN532_RST_Pin, GPIO_PIN_RESET);
HAL_GPIO_WritePin(GPIOB, PN532_RST_Pin|RED_LED_Pin|ORANGE_LED_Pin|GREEN_LED_Pin, GPIO_PIN_RESET);
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(PN532_REQ_GPIO_Port, PN532_REQ_Pin, GPIO_PIN_SET);
@@ -72,6 +72,13 @@ void MX_GPIO_Init(void)
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
/*Configure GPIO pins : RED_LED_Pin ORANGE_LED_Pin GREEN_LED_Pin */
GPIO_InitStruct.Pin = RED_LED_Pin|ORANGE_LED_Pin|GREEN_LED_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
}
/* USER CODE BEGIN 2 */