/** ****************************************************************************** * @file Display/LCD_PicturesFromSDCard/Src/main.c * @author MCD Application Team * @version V1.0.0 * @date 17-February-2017 * @brief This file provides main program functions * Modefi Fujisekk.LTD * ADD 2017/11 Error Dedlock is Clear * ADD 2017/12 UART printf File Name8.3OK * ADD 2017/12/8 RTC Date Time * ADD 2017/12/20 UART Recive Use Interrupt ****************************************************************************** * @attention * *

© Copyright © 2017 STMicroelectronics International N.V. * All rights reserved.

* * Redistribution and use in source and binary forms, with or without * modification, are permitted, provided that the following conditions are met: * * 1. Redistribution of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of STMicroelectronics nor the names of other * contributors to this software may be used to endorse or promote products * derived from this software without specific written permission. * 4. This software, including modifications and/or derivative works of this * software, must execute solely and exclusively on microcontroller or * microprocessor devices manufactured by or for STMicroelectronics. * 5. Redistribution and use of this software other than as permitted under * this license is void and will automatically terminate your rights under * this license. * * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************** */ /* Includes ------------------------------------------------------------------*/ #include "main.h" /** @addtogroup STM32F4xx_HAL_Applications * @{ */ /** @addtogroup LCD_PicturesFromSDCard * @{ */ /* ADD printf to USART 2017/12/2 */ /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* ADD printf to USART 2017/12/2 */ /* UART handler declaration */ UART_HandleTypeDef UartHandle; /* ADD printf RTC 2017/12/8 */ /* RTC handler declaration */ RTC_HandleTypeDef RtcHandle; FATFS SD_FatFs; /* File system object for SD card logical drive */ char SD_Path[4]; /* SD card logical drive path */ char* pDirectoryFiles[MAX_BMP_FILES]; uint8_t ubNumberOfFiles = 0; uint32_t uwBmplen = 0; /* Buffers used for displaying Time and Date */ uint8_t aShowTime[50] = {0}; uint8_t aShowDate[50] = {0}; /* Buffer defined in internal SRAM memory */ uint8_t uwInternelBuffer[LCD_SCREEN_WIDTH*LCD_SCREEN_HEIGHT*RGB565_BYTE_PER_PIXEL]; /* Private function prototypes -----------------------------------------------*/ static void SystemClock_Config(void); static void Error_Handler(void); static void RTC_CalendarConfig(void); static void RTC_CalendarShow(uint8_t *showtime, uint8_t *showdate); int check_Date_Time( uint8_t *aShowTime); int RTC_CalendarConf_Param(uint8_t *aShowTime); /* Private functions ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ /* ADD printf to USART 2017/12/2 */ /* ADD getline fromUART 2017/12/13 */ /* #define GETCHAR_PROTOTYPE int fgetc(FILE *f) */ #ifdef __GNUC__ /* With GCC, small printf (option LD Linker->Libraries->Small printf set to 'Yes') calls __io_putchar() */ #define PUTCHAR_PROTOTYPE int __io_putchar(int ch) #define GETCHAR_PROTOTYPE int __io_getchar(void) #else #define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f) #define GETCHAR_PROTOTYPE int fgetc( FILE *f) #define FGETS_PROTOTYPE char * fgets(char *str ,int len , FILE *f) #endif /* __GNUC__ */ /* UART handler declaration */ __IO ITStatus UartReady = RESET; /* Buffer used for reception */ uint8_t aRxBuffer[RXBUFFERSIZE]; /** * @brief Main program * @param None * @retval None */ int main(void) { uint32_t counter = 0; uint8_t str[32]; int16_t result; /* STM32F4xx HAL library initialization: - Configure the Flash prefetch - Systick timer is configured by default as source of time base, but user can eventually implement his proper time base source (a general purpose timer for example or other time source), keeping in mind that Time base duration should be kept 1ms since PPP_TIMEOUT_VALUEs are defined and handled in milliseconds basis. - Set NVIC Group Priority to 4 - Low Level Initialization */ HAL_Init(); /* Configure the system clock to 100 MHz */ SystemClock_Config(); /* Configure LED4 */ BSP_LED_Init(LED4); /* ADD printf to USART 2017/12/2 */ /*##-1- Configure the UART peripheral ######################################*/ /* Put the USART peripheral in the Asynchronous mode (UART Mode) */ /* UART configured as follows: - Word Length = 8 Bits (7 data bit + 1 parity bit) : BE CAREFUL : Program 7 data bits + 1 parity bit in PC HyperTerminal - Stop Bit = One Stop bit - Parity = ODD parity - BaudRate = 9600 baud - Hardware flow control disabled (RTS and CTS signals) */ UartHandle.Instance = USARTx; UartHandle.Init.BaudRate = 9600; UartHandle.Init.WordLength = UART_WORDLENGTH_8B; UartHandle.Init.StopBits = UART_STOPBITS_1; UartHandle.Init.Parity = UART_PARITY_ODD; UartHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE; UartHandle.Init.Mode = UART_MODE_TX_RX; UartHandle.Init.OverSampling = UART_OVERSAMPLING_16; if(HAL_UART_DeInit(&UartHandle) != HAL_OK) { Error_Handler(); } if (HAL_UART_Init(&UartHandle) != HAL_OK) { /* Initialization Error */ Error_Handler(); } /* Output a message on Hyperterminal using printf function */ printf("\n\r UART Printf Example: retarget the C library printf function to the UART\n\r SET Calender YES?\n\r"); /* ADD 2017/12/17 Uart Recive Intrrupt */ /*##-2- Put UART peripheral in reception process ###########################*/ fgets((uint8_t *)aRxBuffer,4, 0); /* Reset transmission flag */ // printf ((char*)str,"%s OK",aRxBuffer); result=-1; if(strncmp(aRxBuffer, "YES",3) ==0){ printf("KeyIn YYMMDDHHMMSS\n\r"); /* test UART Recive 2017/12/13 */ while(result<0){ fgets(aShowTime,13,0 ); memcpy(str,aShowTime ,13); result=check_Date_Time(str); printf("Palam=%d",-(result)); } } /*##-1- Configure the RTC peripheral #######################################*/ /* Configure RTC prescaler and RTC data registers */ /* RTC configured as follows: - Hour Format = Format 24 - Asynch Prediv = Value according to source clock - Synch Prediv = Value according to source clock - OutPut = Output Disable - OutPutPolarity = High Polarity - OutPutType = Open Drain */ RtcHandle.Instance = RTC; RtcHandle.Init.HourFormat = RTC_HOURFORMAT_24; RtcHandle.Init.AsynchPrediv = RTC_ASYNCH_PREDIV; RtcHandle.Init.SynchPrediv = RTC_SYNCH_PREDIV; RtcHandle.Init.OutPut = RTC_OUTPUT_DISABLE; RtcHandle.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH; RtcHandle.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN; if (HAL_RTC_Init(&RtcHandle) != HAL_OK) { /* Initialization Error */ Error_Handler(); } /*##-2- Check if Data stored in BackUp register1: No Need to reconfigure RTC#*/ /* Read the Back Up Register 1 Data */ if ((HAL_RTCEx_BKUPRead(&RtcHandle, RTC_BKP_DR1) != 0x32F2) || (result == 0)) { /* Configure RTC Calendar */ RTC_CalendarConf_Param(aShowTime); } else { /* Check if the Power On Reset flag is set */ if (__HAL_RCC_GET_FLAG(RCC_FLAG_PORRST) != RESET) { /* Turn on LED4: Power on reset occurred */ BSP_LED_On(LED4); } /* Check if Pin Reset flag is set */ if (__HAL_RCC_GET_FLAG(RCC_FLAG_PINRST) != RESET) { /* Turn on LED3: External reset occurred */ BSP_LED_On(LED3); } /* Clear source Reset Flag */ __HAL_RCC_CLEAR_RESET_FLAGS(); } /*##-1- Configure LCD ######################################################*/ /* LCD Initialization */ BSP_LCD_Init(); /* Clear the LCD */ BSP_LCD_Clear(LCD_COLOR_WHITE); /* Configure Key Button */ BSP_PB_Init(BUTTON_WAKEUP, BUTTON_MODE_GPIO); /* SD Initialization */ BSP_SD_Init(); /* Set the font Size */ BSP_LCD_SetFont(&Font16); /* Set the Text Color */ BSP_LCD_SetTextColor(LCD_COLOR_RED); /* Set the Back Color */ BSP_LCD_SetBackColor(LCD_COLOR_WHITE); while(BSP_SD_IsDetected() != SD_PRESENT) { BSP_LCD_DisplayStringAt(0, 112, (uint8_t*)"Please insert SD Card", CENTER_MODE); } /* Clear the LCD */ BSP_LCD_Clear(LCD_COLOR_WHITE); /*##-2- Link the SD Card disk I/O driver ###################################*/ if(FATFS_LinkDriver(&SD_Driver, SD_Path) == 0) { /*##-3- Initialize the Directory Files pointers (heap) ###################*/ for (counter = 0; counter < MAX_BMP_FILES; counter++) { pDirectoryFiles[counter] = malloc(MAX_BMP_FILE_NAME); if(pDirectoryFiles[counter] == NULL) { BSP_LCD_DisplayStringAt(0, 112, (uint8_t*)"Cannot allocate memory", CENTER_MODE); Error_Handler(); } } /* Get the BMP file names on root directory */ ubNumberOfFiles = Storage_GetDirectoryBitmapFiles("/Media", pDirectoryFiles); if (ubNumberOfFiles == 0) { for (counter = 0; counter < MAX_BMP_FILES; counter++) { free(pDirectoryFiles[counter]); } BSP_LCD_DisplayStringAt(0, 112, (uint8_t*)"No Bitmap files...", CENTER_MODE); Error_Handler(); } } else { /* FatFs Initialization Error */ Error_Handler(); } BSP_LCD_DisplayStringAt(0, 128, aShowTime, CENTER_MODE); /* Main infinite loop */ while(1) { counter = 0; while (counter < ubNumberOfFiles) { /* Format the string 2017/12/7 Change %-11.11s -12.12*/ sprintf ((char*)str, "Media/%-12.12s", pDirectoryFiles[counter]); if (Storage_CheckBitmapFile((const char*)str, &uwBmplen) == 0) { /* Open a file and copy its content to an internal buffer */ Storage_OpenReadFile(uwInternelBuffer, (const char*)str); /* Write bmp file on LCD frame buffer */ BSP_LCD_DrawBitmap(0, 0, uwInternelBuffer); printf("BitMapPicture %s Drowd\n\r",str); printf("TIME %s\n\r",aShowTime); /* Wait for Key button pressed */ while (BSP_PB_GetState(BUTTON_WAKEUP) == RESET) { } /* Clear the LCD */ BSP_LCD_Clear(LCD_COLOR_BLACK); BSP_LCD_DisplayStringAt(0, 112, (uint8_t*)aShowTime, CENTER_MODE); /* Wait for Key button released */ while (BSP_PB_GetState(BUTTON_WAKEUP) == SET) { } /* Clear the LCD */ //BSP_LCD_Clear(LCD_COLOR_BLACK); /*##-3- Display the updated Time and Date ################################*/ RTC_CalendarShow(aShowTime, aShowDate); while(BSP_SD_IsDetected() != SD_PRESENT) { BSP_LCD_DisplayStringAt(0, 112, (uint8_t*)"Please insert SD Card ", CENTER_MODE); BSP_LCD_DisplayStringAt(0, 128, (uint8_t*)"Reset the board ", CENTER_MODE); } /* Jump to the next image */ counter++; }else{ /*ADD 2017/11 Error Dedlock Clear */ BSP_LCD_DisplayStringAt(0, 112, (uint8_t*)"Chck Err Bitmap file", CENTER_MODE); printf("BitMapPicture %s Brokn\n\r",str); while (BSP_PB_GetState(BUTTON_WAKEUP) == RESET) { } /* Wait for Key button released */ while (BSP_PB_GetState(BUTTON_WAKEUP) == SET) { } counter++; } } } } /* Add 2017/12/20 RTC Set */ /* Check Format*/ int check_Date_Time( uint8_t *DateTime) { int work,Palam; /* date time MIN,MAX */ int datimecheck[2][6]={{17,1,1,0,0,0},{20,12,31,23,59,59}}; int a; if(DateTime[12]!=0x0d) { return -1; } else{ for(a=6;a>0 ;a--){ DateTime[a*2]=0; Palam=atoi(DateTime+((a-1)*2)); if(Palam< datimecheck[0][a-1] || Palam > datimecheck[1][a-1]) { printf("ERROR %s \r\n", DateTime); return -(a+1); } } return 0; } // work=atoi(char const * (DateTime[0])); } /** * @brief This function is executed in case of error occurrence. * @param None * @retval None */ static void Error_Handler(void) { /* Turn LED4 on */ BSP_LED_On(LED4); while(1) { } } /** * @brief System Clock Configuration * The system Clock is configured as follow : * System Clock source = PLL (HSE) * SYSCLK(Hz) = 100000000 * HCLK(Hz) = 100000000 * AHB Prescaler = 1 * APB1 Prescaler = 2 * APB2 Prescaler = 1 * HSE Frequency(Hz) = 8000000 * PLL_M = 8 * PLL_N = 200 * PLL_P = 2 * PLL_Q = 7 * PLL_R = 2 * VDD(V) = 3.3 * Main regulator output voltage = Scale1 mode * Flash Latency(WS) = 3 * @param None * @retval None */ static void SystemClock_Config(void) { RCC_ClkInitTypeDef RCC_ClkInitStruct; RCC_OscInitTypeDef RCC_OscInitStruct; HAL_StatusTypeDef ret = HAL_OK; /* Enable Power Control clock */ __HAL_RCC_PWR_CLK_ENABLE(); /* The voltage scaling allows optimizing the power consumption when the device is clocked below the maximum system frequency, to update the voltage scaling value regarding system frequency refer to product datasheet. */ __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); /* Enable HSE Oscillator and activate PLL with HSE as source */ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; RCC_OscInitStruct.PLL.PLLM = 8; RCC_OscInitStruct.PLL.PLLN = 200; RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; RCC_OscInitStruct.PLL.PLLQ = 7; RCC_OscInitStruct.PLL.PLLR = 2; ret = HAL_RCC_OscConfig(&RCC_OscInitStruct); if(ret != HAL_OK) { while(1) { ; } } /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 clocks dividers */ RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; ret = HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3); if(ret != HAL_OK) { while(1) { ; } } }/** * @brief Configure the current time and date. * @param None * @retval None */ static void RTC_CalendarConfig(void) { RTC_DateTypeDef sdatestructure; RTC_TimeTypeDef stimestructure; /*##-1- Configure the Date #################################################*/ /* Set Date: Tuesday February 18th 2016 */ sdatestructure.Year = 0x16; sdatestructure.Month = RTC_MONTH_FEBRUARY; sdatestructure.Date = 0x18; sdatestructure.WeekDay = RTC_WEEKDAY_TUESDAY; if(HAL_RTC_SetDate(&RtcHandle,&sdatestructure,RTC_FORMAT_BCD) != HAL_OK) { /* Initialization Error */ Error_Handler(); } /*##-2- Configure the Time #################################################*/ /* Set Time: 02:00:00 */ stimestructure.Hours = 0x02; stimestructure.Minutes = 0x00; stimestructure.Seconds = 0x00; stimestructure.TimeFormat = RTC_HOURFORMAT12_AM; stimestructure.DayLightSaving = RTC_DAYLIGHTSAVING_NONE ; stimestructure.StoreOperation = RTC_STOREOPERATION_RESET; if (HAL_RTC_SetTime(&RtcHandle, &stimestructure, RTC_FORMAT_BCD) != HAL_OK) { /* Initialization Error */ Error_Handler(); } /*##-3- Writes a data in a RTC Backup data Register1 #######################*/ HAL_RTCEx_BKUPWrite(&RtcHandle, RTC_BKP_DR1, 0x32F2); } /* Configuer USE Ascii Data YYMMDDHHMMSS WeekDay=SMTUhFs*/ int RTC_CalendarConf_Param(uint8_t *Date_Time) { RTC_DateTypeDef sdatestructure; RTC_TimeTypeDef stimestructure; int a; a=6; /* YYMMDDHHMMSS PalaMeters=6 */ /*##-2- Configure the Time #################################################*/ Date_Time[a*2]=0; a--; stimestructure.Seconds =atoi(Date_Time+(a*2)); Date_Time[a*2]=0; a--; stimestructure.Minutes =atoi(Date_Time+(a*2)); Date_Time[a*2]=0; a--; stimestructure.Hours = atoi(Date_Time+(a*2)); stimestructure.TimeFormat = RTC_HOURFORMAT12_AM; stimestructure.DayLightSaving = RTC_DAYLIGHTSAVING_NONE ; stimestructure.StoreOperation = RTC_STOREOPERATION_RESET; if (HAL_RTC_SetTime(&RtcHandle, &stimestructure, RTC_FORMAT_BCD) != HAL_OK) { /* Initialization Error */ Error_Handler(); } /*##-1- Configure the Date DD MM YY ########################################*/ Date_Time[a*2]=0; a--; sdatestructure.Date =atoi(Date_Time+(a*2)); Date_Time[a*2]=0; a--; sdatestructure.Month =atoi(Date_Time+(a*2)); Date_Time[a*2]=0; a--; sdatestructure.Year =atoi(Date_Time+(a*2)); /* NG? */ sdatestructure.WeekDay = RTC_WEEKDAY_TUESDAY; if(HAL_RTC_SetDate(&RtcHandle,&sdatestructure,RTC_FORMAT_BCD) != HAL_OK) { /* Initialization Error */ Error_Handler(); } /*##-3- Writes a data in a RTC Backup data Register1 #######################*/ HAL_RTCEx_BKUPWrite(&RtcHandle, RTC_BKP_DR1, 0x32F2); return (a); } /** * @brief Display the current time and date. * @param showtime : pointer to buffer * @param showdate : pointer to buffer * @retval None */ static void RTC_CalendarShow(uint8_t *showtime, uint8_t *showdate) { RTC_DateTypeDef sdatestructureget; RTC_TimeTypeDef stimestructureget; /* Get the RTC current Time */ HAL_RTC_GetTime(&RtcHandle, &stimestructureget, RTC_FORMAT_BIN); /* Get the RTC current Date */ HAL_RTC_GetDate(&RtcHandle, &sdatestructureget, RTC_FORMAT_BIN); /* Display time Format : hh:mm:ss */ sprintf((char *)showtime, "%2d:%2d:%2d", stimestructureget.Hours, stimestructureget.Minutes, stimestructureget.Seconds); /* Display date Format : mm-dd-yy */ sprintf((char *)showdate, "%2d-%2d-%2d", sdatestructureget.Month, sdatestructureget.Date, 2000 + sdatestructureget.Year); } #ifdef USE_FULL_ASSERT /** * @brief Reports the name of the source file and the source line number * where the assert_param error has occurred. * @param file: pointer to the source file name * @param line: assert_param error line source number * @retval None */ void assert_failed(uint8_t* file, uint32_t line) { /* User can add his own implementation to report the file name and line number, ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ /* Infinite loop */ while (1): { } } #endif /** * @brief Retargets the C library printf function to the USART. * @param None * @retval None HAL_UART_Transmit(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint32_t Timeout); */ PUTCHAR_PROTOTYPE { /* Place your implementation of fputc here */ /* e.g. write a character to the USART6 and Loop until the end of transmission */ HAL_UART_Transmit(&UartHandle, (uint8_t *)&ch, 1, 0xFFFF); return ch; } /** * @brief Retargets the C library printf function to the USART. * @param None * @retval None HAL_UART_Receive(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint32_t Timeout); */ GETCHAR_PROTOTYPE { /* Place your implementation of fputc here */ /* e.g. read a character to the USART6 and Loop until the end of */ char ch; HAL_UART_Receive_IT(&UartHandle, (uint8_t *)&ch, 1); return ch; } FGETS_PROTOTYPE { UartReady = RESET; HAL_UART_Receive_IT(&UartHandle, (uint8_t *)str, len ); while (UartReady != SET) { BSP_LED_On(LED4); HAL_Delay(100); BSP_LED_Off(LED4); HAL_Delay(100); BSP_LED_On(LED4); HAL_Delay(100); BSP_LED_Off(LED4); HAL_Delay(500); } UartReady = RESET; } /** * @brief System Clock Configuration * The system Clock is configured as follow : * System Clock source = PLL (HSE) * SYSCLK(Hz) = 100000000 * HCLK(Hz) = 100000000 * AHB Prescaler = 1 * APB1 Prescaler = 2 * APB2 Prescaler = 1 * HSE Frequency(Hz) = 8000000 * PLL_M = 8 * PLL_N = 200 * PLL_P = 2 * PLL_Q = 7 * PLL_R = 2 * VDD(V) = 3.3 * Main regulator output voltage = Scale1 mode * Flash Latency(WS) = 3 * @param None * @retval None */ /** 2017/12/17 ADD * @brief Rx Transfer completed callback * @param UartHandle: UART handle * @note This example shows a simple way to report end of DMA Rx transfer, and * you can add your own implementation. * @retval None */ void HAL_UART_RxCpltCallback(UART_HandleTypeDef *UartHandle) { /* Set transmission flag: transfer complete */ UartReady = SET; } /** * @brief UART error callbacks * @param UartHandle: UART handle * @note This example shows a simple way to report transfer error, and you can * add your own implementation. * @retval None */ void HAL_UART_ErrorCallback(UART_HandleTypeDef *UartHandle) { Error_Handler(); } /** * @brief This function is executed in case of error occurrence. * @param None * @retval None */ /** * @} */ /** * @} */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/