/* USARTx configured as follow:
- BaudRate = 115200 baud
- Word Length = 8 Bits
- One Stop Bit
- No parity
- Hardware flow control disabled (RTS and CTS signals)
- Receive and transmit enabled
*/
USART_InitStructure.USART_BaudRate = 115200;
USART_InitStructure.USART_WordLength = USART_WordLength_8b;
USART_InitStructure.USART_StopBits = USART_StopBits_1;
USART_InitStructure.USART_Parity = USART_Parity_No;
USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;
STM_EVAL_COMInit(COM1, &USART_InitStructure);
/* Initialize the LCD */
#ifdef USE_STM32100B_EVAL
STM32100B_LCD_Init();
#elif defined (USE_STM3210B_EVAL)
STM3210B_LCD_Init();
#elif defined (USE_STM3210E_EVAL)
STM3210E_LCD_Init();
#elif defined (USE_STM3210C_EVAL)
STM3210C_LCD_Init();
#elif defined (USE_STM32100E_EVAL)
STM32100E_LCD_Init();
#endif
/* Display message on STM3210X-EVAL LCD *************************************/
/* Clear the LCD */
LCD_Clear(LCD_COLOR_WHITE);
/* Set the LCD Back Color */
LCD_SetBackColor(LCD_COLOR_BLUE);
/* Set the LCD Text Color */
LCD_SetTextColor(LCD_COLOR_WHITE);
LCD_DisplayStringLine(LCD_LINE_0, (uint8_t *)MESSAGE1);
LCD_DisplayStringLine(LCD_LINE_1, (uint8_t *)MESSAGE2);
LCD_DisplayStringLine(LCD_LINE_2, (uint8_t *)MESSAGE3);
/* Retarget the C library printf function to the USARTx, can be USART1 or USART2
depending on the EVAL board you are using ********************************/
printf("\n\r %s", MESSAGE1);
printf(" %s", MESSAGE2);
printf(" %s\n\r", MESSAGE3);
/* Turn on leds available on STM3210X-EVAL **********************************/
STM_EVAL_LEDOn(LED1);
STM_EVAL_LEDOn(LED2);
STM_EVAL_LEDOn(LED3);
STM_EVAL_LEDOn(LED4);
while (USART_GetFlagStatus(EVAL_COM1, USART_FLAG_TC) == RESET)
{}
return ch;
}
#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) */