|
@@ -107,7 +107,6 @@ void HAL_MspInit(void)
|
|
|
*/
|
|
|
void HAL_ADC_MspInit(ADC_HandleTypeDef* hadc)
|
|
|
{
|
|
|
-
|
|
|
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
|
|
if(hadc->Instance==ADC1)
|
|
|
{
|
|
@@ -139,10 +138,8 @@ void HAL_ADC_MspInit(ADC_HandleTypeDef* hadc)
|
|
|
* @param hadc: ADC handle pointer
|
|
|
* @retval None
|
|
|
*/
|
|
|
-
|
|
|
void HAL_ADC_MspDeInit(ADC_HandleTypeDef* hadc)
|
|
|
{
|
|
|
-
|
|
|
if(hadc->Instance==ADC1)
|
|
|
{
|
|
|
/* USER CODE BEGIN ADC1_MspDeInit 0 */
|
|
@@ -171,7 +168,6 @@ void HAL_ADC_MspDeInit(ADC_HandleTypeDef* hadc)
|
|
|
*/
|
|
|
void HAL_ETH_MspInit(ETH_HandleTypeDef* heth)
|
|
|
{
|
|
|
-
|
|
|
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
|
|
if(heth->Instance==ETH)
|
|
|
{
|
|
@@ -237,10 +233,8 @@ void HAL_ETH_MspInit(ETH_HandleTypeDef* heth)
|
|
|
* @param heth: ETH handle pointer
|
|
|
* @retval None
|
|
|
*/
|
|
|
-
|
|
|
void HAL_ETH_MspDeInit(ETH_HandleTypeDef* heth)
|
|
|
{
|
|
|
-
|
|
|
if(heth->Instance==ETH)
|
|
|
{
|
|
|
/* USER CODE BEGIN ETH_MspDeInit 0 */
|
|
@@ -275,6 +269,194 @@ void HAL_ETH_MspDeInit(ETH_HandleTypeDef* heth)
|
|
|
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+* @brief LTDC MSP Initialization
|
|
|
+* This function configures the hardware resources used in this example
|
|
|
+* @param hltdc: LTDC handle pointer
|
|
|
+* @retval None
|
|
|
+*/
|
|
|
+void HAL_LTDC_MspInit(LTDC_HandleTypeDef* hltdc)
|
|
|
+{
|
|
|
+ GPIO_InitTypeDef GPIO_InitStruct = {0};
|
|
|
+ if(hltdc->Instance==LTDC)
|
|
|
+ {
|
|
|
+ /* USER CODE BEGIN LTDC_MspInit 0 */
|
|
|
+
|
|
|
+ /* USER CODE END LTDC_MspInit 0 */
|
|
|
+ /* Peripheral clock enable */
|
|
|
+ __HAL_RCC_LTDC_CLK_ENABLE();
|
|
|
+
|
|
|
+ __HAL_RCC_GPIOI_CLK_ENABLE();
|
|
|
+ __HAL_RCC_GPIOF_CLK_ENABLE();
|
|
|
+ __HAL_RCC_GPIOH_CLK_ENABLE();
|
|
|
+ __HAL_RCC_GPIOA_CLK_ENABLE();
|
|
|
+ __HAL_RCC_GPIOB_CLK_ENABLE();
|
|
|
+ __HAL_RCC_GPIOG_CLK_ENABLE();
|
|
|
+ /**LTDC GPIO Configuration
|
|
|
+ PI9 ------> LTDC_VSYNC
|
|
|
+ PI10 ------> LTDC_HSYNC
|
|
|
+ PI11 ------> LTDC_G6
|
|
|
+ PF10 ------> LTDC_DE
|
|
|
+ PH4 ------> LTDC_G5
|
|
|
+ PA6 ------> LTDC_G2
|
|
|
+ PB1 ------> LTDC_R6
|
|
|
+ PB10 ------> LTDC_G4
|
|
|
+ PH9 ------> LTDC_R3
|
|
|
+ PH10 ------> LTDC_R4
|
|
|
+ PH11 ------> LTDC_R5
|
|
|
+ PG6 ------> LTDC_R7
|
|
|
+ PG7 ------> LTDC_CLK
|
|
|
+ PA8 ------> LTDC_B3
|
|
|
+ PH14 ------> LTDC_G3
|
|
|
+ PI2 ------> LTDC_G7
|
|
|
+ PG12 ------> LTDC_B4
|
|
|
+ PB8 ------> LTDC_B6
|
|
|
+ PB9 ------> LTDC_B7
|
|
|
+ PI5 ------> LTDC_B5
|
|
|
+ */
|
|
|
+ GPIO_InitStruct.Pin = GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_2|GPIO_PIN_5;
|
|
|
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
|
|
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
|
|
|
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
|
|
+ GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
|
|
|
+ HAL_GPIO_Init(GPIOI, &GPIO_InitStruct);
|
|
|
+
|
|
|
+ GPIO_InitStruct.Pin = GPIO_PIN_11;
|
|
|
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
|
|
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
|
|
|
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
|
|
+ GPIO_InitStruct.Alternate = GPIO_AF9_LTDC;
|
|
|
+ HAL_GPIO_Init(GPIOI, &GPIO_InitStruct);
|
|
|
+
|
|
|
+ GPIO_InitStruct.Pin = GPIO_PIN_10;
|
|
|
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
|
|
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
|
|
|
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
|
|
+ GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
|
|
|
+ HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);
|
|
|
+
|
|
|
+ GPIO_InitStruct.Pin = GPIO_PIN_4;
|
|
|
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
|
|
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
|
|
|
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
|
|
+ GPIO_InitStruct.Alternate = GPIO_AF9_LTDC;
|
|
|
+ HAL_GPIO_Init(GPIOH, &GPIO_InitStruct);
|
|
|
+
|
|
|
+ GPIO_InitStruct.Pin = GPIO_PIN_6;
|
|
|
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
|
|
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
|
|
|
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
|
|
+ GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
|
|
|
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
|
|
+
|
|
|
+ GPIO_InitStruct.Pin = GPIO_PIN_1;
|
|
|
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
|
|
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
|
|
|
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
|
|
+ GPIO_InitStruct.Alternate = GPIO_AF9_LTDC;
|
|
|
+ HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
|
|
+
|
|
|
+ GPIO_InitStruct.Pin = GPIO_PIN_10|GPIO_PIN_8|GPIO_PIN_9;
|
|
|
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
|
|
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
|
|
|
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
|
|
+ GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
|
|
|
+ HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
|
|
+
|
|
|
+ GPIO_InitStruct.Pin = GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_11|GPIO_PIN_14;
|
|
|
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
|
|
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
|
|
|
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
|
|
+ GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
|
|
|
+ HAL_GPIO_Init(GPIOH, &GPIO_InitStruct);
|
|
|
+
|
|
|
+ GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7;
|
|
|
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
|
|
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
|
|
|
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
|
|
+ GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
|
|
|
+ HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);
|
|
|
+
|
|
|
+ GPIO_InitStruct.Pin = GPIO_PIN_8;
|
|
|
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
|
|
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
|
|
|
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
|
|
+ GPIO_InitStruct.Alternate = GPIO_AF13_LTDC;
|
|
|
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
|
|
+
|
|
|
+ GPIO_InitStruct.Pin = GPIO_PIN_12;
|
|
|
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
|
|
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
|
|
|
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
|
|
+ GPIO_InitStruct.Alternate = GPIO_AF9_LTDC;
|
|
|
+ HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);
|
|
|
+
|
|
|
+ /* USER CODE BEGIN LTDC_MspInit 1 */
|
|
|
+
|
|
|
+ /* USER CODE END LTDC_MspInit 1 */
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+* @brief LTDC MSP De-Initialization
|
|
|
+* This function freeze the hardware resources used in this example
|
|
|
+* @param hltdc: LTDC handle pointer
|
|
|
+* @retval None
|
|
|
+*/
|
|
|
+void HAL_LTDC_MspDeInit(LTDC_HandleTypeDef* hltdc)
|
|
|
+{
|
|
|
+ if(hltdc->Instance==LTDC)
|
|
|
+ {
|
|
|
+ /* USER CODE BEGIN LTDC_MspDeInit 0 */
|
|
|
+
|
|
|
+ /* USER CODE END LTDC_MspDeInit 0 */
|
|
|
+ /* Peripheral clock disable */
|
|
|
+ __HAL_RCC_LTDC_CLK_DISABLE();
|
|
|
+
|
|
|
+ /**LTDC GPIO Configuration
|
|
|
+ PI9 ------> LTDC_VSYNC
|
|
|
+ PI10 ------> LTDC_HSYNC
|
|
|
+ PI11 ------> LTDC_G6
|
|
|
+ PF10 ------> LTDC_DE
|
|
|
+ PH4 ------> LTDC_G5
|
|
|
+ PA6 ------> LTDC_G2
|
|
|
+ PB1 ------> LTDC_R6
|
|
|
+ PB10 ------> LTDC_G4
|
|
|
+ PH9 ------> LTDC_R3
|
|
|
+ PH10 ------> LTDC_R4
|
|
|
+ PH11 ------> LTDC_R5
|
|
|
+ PG6 ------> LTDC_R7
|
|
|
+ PG7 ------> LTDC_CLK
|
|
|
+ PA8 ------> LTDC_B3
|
|
|
+ PH14 ------> LTDC_G3
|
|
|
+ PI2 ------> LTDC_G7
|
|
|
+ PG12 ------> LTDC_B4
|
|
|
+ PB8 ------> LTDC_B6
|
|
|
+ PB9 ------> LTDC_B7
|
|
|
+ PI5 ------> LTDC_B5
|
|
|
+ */
|
|
|
+ HAL_GPIO_DeInit(GPIOI, GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_11|GPIO_PIN_2
|
|
|
+ |GPIO_PIN_5);
|
|
|
+
|
|
|
+ HAL_GPIO_DeInit(GPIOF, GPIO_PIN_10);
|
|
|
+
|
|
|
+ HAL_GPIO_DeInit(GPIOH, GPIO_PIN_4|GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_11
|
|
|
+ |GPIO_PIN_14);
|
|
|
+
|
|
|
+ HAL_GPIO_DeInit(GPIOA, GPIO_PIN_6|GPIO_PIN_8);
|
|
|
+
|
|
|
+ HAL_GPIO_DeInit(GPIOB, GPIO_PIN_1|GPIO_PIN_10|GPIO_PIN_8|GPIO_PIN_9);
|
|
|
+
|
|
|
+ HAL_GPIO_DeInit(GPIOG, GPIO_PIN_6|GPIO_PIN_7|GPIO_PIN_12);
|
|
|
+
|
|
|
+ /* USER CODE BEGIN LTDC_MspDeInit 1 */
|
|
|
+
|
|
|
+ /* USER CODE END LTDC_MspDeInit 1 */
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* @brief QSPI MSP Initialization
|
|
|
* This function configures the hardware resources used in this example
|
|
@@ -283,7 +465,6 @@ void HAL_ETH_MspDeInit(ETH_HandleTypeDef* heth)
|
|
|
*/
|
|
|
void HAL_QSPI_MspInit(QSPI_HandleTypeDef* hqspi)
|
|
|
{
|
|
|
-
|
|
|
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
|
|
if(hqspi->Instance==QUADSPI)
|
|
|
{
|
|
@@ -344,10 +525,8 @@ void HAL_QSPI_MspInit(QSPI_HandleTypeDef* hqspi)
|
|
|
* @param hqspi: QSPI handle pointer
|
|
|
* @retval None
|
|
|
*/
|
|
|
-
|
|
|
void HAL_QSPI_MspDeInit(QSPI_HandleTypeDef* hqspi)
|
|
|
{
|
|
|
-
|
|
|
if(hqspi->Instance==QUADSPI)
|
|
|
{
|
|
|
/* USER CODE BEGIN QUADSPI_MspDeInit 0 */
|
|
@@ -383,7 +562,6 @@ void HAL_QSPI_MspDeInit(QSPI_HandleTypeDef* hqspi)
|
|
|
*/
|
|
|
void HAL_RTC_MspInit(RTC_HandleTypeDef* hrtc)
|
|
|
{
|
|
|
-
|
|
|
if(hrtc->Instance==RTC)
|
|
|
{
|
|
|
/* USER CODE BEGIN RTC_MspInit 0 */
|
|
@@ -404,10 +582,8 @@ void HAL_RTC_MspInit(RTC_HandleTypeDef* hrtc)
|
|
|
* @param hrtc: RTC handle pointer
|
|
|
* @retval None
|
|
|
*/
|
|
|
-
|
|
|
void HAL_RTC_MspDeInit(RTC_HandleTypeDef* hrtc)
|
|
|
{
|
|
|
-
|
|
|
if(hrtc->Instance==RTC)
|
|
|
{
|
|
|
/* USER CODE BEGIN RTC_MspDeInit 0 */
|
|
@@ -430,7 +606,6 @@ void HAL_RTC_MspDeInit(RTC_HandleTypeDef* hrtc)
|
|
|
*/
|
|
|
void HAL_SD_MspInit(SD_HandleTypeDef* hsd)
|
|
|
{
|
|
|
-
|
|
|
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
|
|
if(hsd->Instance==SDMMC1)
|
|
|
{
|
|
@@ -478,10 +653,8 @@ void HAL_SD_MspInit(SD_HandleTypeDef* hsd)
|
|
|
* @param hsd: SD handle pointer
|
|
|
* @retval None
|
|
|
*/
|
|
|
-
|
|
|
void HAL_SD_MspDeInit(SD_HandleTypeDef* hsd)
|
|
|
{
|
|
|
-
|
|
|
if(hsd->Instance==SDMMC1)
|
|
|
{
|
|
|
/* USER CODE BEGIN SDMMC1_MspDeInit 0 */
|
|
@@ -518,7 +691,6 @@ void HAL_SD_MspDeInit(SD_HandleTypeDef* hsd)
|
|
|
*/
|
|
|
void HAL_SPI_MspInit(SPI_HandleTypeDef* hspi)
|
|
|
{
|
|
|
-
|
|
|
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
|
|
if(hspi->Instance==SPI2)
|
|
|
{
|
|
@@ -554,10 +726,8 @@ void HAL_SPI_MspInit(SPI_HandleTypeDef* hspi)
|
|
|
* @param hspi: SPI handle pointer
|
|
|
* @retval None
|
|
|
*/
|
|
|
-
|
|
|
void HAL_SPI_MspDeInit(SPI_HandleTypeDef* hspi)
|
|
|
{
|
|
|
-
|
|
|
if(hspi->Instance==SPI2)
|
|
|
{
|
|
|
/* USER CODE BEGIN SPI2_MspDeInit 0 */
|
|
@@ -588,7 +758,6 @@ void HAL_SPI_MspDeInit(SPI_HandleTypeDef* hspi)
|
|
|
*/
|
|
|
void HAL_TIM_PWM_MspInit(TIM_HandleTypeDef* htim_pwm)
|
|
|
{
|
|
|
-
|
|
|
if(htim_pwm->Instance==TIM2)
|
|
|
{
|
|
|
/* USER CODE BEGIN TIM2_MspInit 0 */
|
|
@@ -611,7 +780,6 @@ void HAL_TIM_PWM_MspInit(TIM_HandleTypeDef* htim_pwm)
|
|
|
*/
|
|
|
void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* htim_base)
|
|
|
{
|
|
|
-
|
|
|
if(htim_base->Instance==TIM3)
|
|
|
{
|
|
|
/* USER CODE BEGIN TIM3_MspInit 0 */
|
|
@@ -661,7 +829,6 @@ void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* htim_base)
|
|
|
|
|
|
void HAL_TIM_MspPostInit(TIM_HandleTypeDef* htim)
|
|
|
{
|
|
|
-
|
|
|
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
|
|
if(htim->Instance==TIM2)
|
|
|
{
|
|
@@ -712,10 +879,8 @@ void HAL_TIM_MspPostInit(TIM_HandleTypeDef* htim)
|
|
|
* @param htim_pwm: TIM_PWM handle pointer
|
|
|
* @retval None
|
|
|
*/
|
|
|
-
|
|
|
void HAL_TIM_PWM_MspDeInit(TIM_HandleTypeDef* htim_pwm)
|
|
|
{
|
|
|
-
|
|
|
if(htim_pwm->Instance==TIM2)
|
|
|
{
|
|
|
/* USER CODE BEGIN TIM2_MspDeInit 0 */
|
|
@@ -736,10 +901,8 @@ void HAL_TIM_PWM_MspDeInit(TIM_HandleTypeDef* htim_pwm)
|
|
|
* @param htim_base: TIM_Base handle pointer
|
|
|
* @retval None
|
|
|
*/
|
|
|
-
|
|
|
void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* htim_base)
|
|
|
{
|
|
|
-
|
|
|
if(htim_base->Instance==TIM3)
|
|
|
{
|
|
|
/* USER CODE BEGIN TIM3_MspDeInit 0 */
|
|
@@ -795,7 +958,6 @@ void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* htim_base)
|
|
|
*/
|
|
|
void HAL_UART_MspInit(UART_HandleTypeDef* huart)
|
|
|
{
|
|
|
-
|
|
|
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
|
|
if(huart->Instance==USART1)
|
|
|
{
|
|
@@ -854,10 +1016,8 @@ void HAL_UART_MspInit(UART_HandleTypeDef* huart)
|
|
|
* @param huart: UART handle pointer
|
|
|
* @retval None
|
|
|
*/
|
|
|
-
|
|
|
void HAL_UART_MspDeInit(UART_HandleTypeDef* huart)
|
|
|
{
|
|
|
-
|
|
|
if(huart->Instance==USART1)
|
|
|
{
|
|
|
/* USER CODE BEGIN USART1_MspDeInit 0 */
|
|
@@ -903,7 +1063,7 @@ static void HAL_FMC_MspInit(void){
|
|
|
/* USER CODE BEGIN FMC_MspInit 0 */
|
|
|
|
|
|
/* USER CODE END FMC_MspInit 0 */
|
|
|
- GPIO_InitTypeDef GPIO_InitStruct;
|
|
|
+ GPIO_InitTypeDef GPIO_InitStruct ={0};
|
|
|
if (FMC_Initialized) {
|
|
|
return;
|
|
|
}
|