cancel
Showing results for 
Search instead for 
Did you mean: 

How to use HAL_USART_Transmit ?

antonius
Senior
Posted on May 07, 2015 at 02:06

Hi Guys,

How can I use HAL_USART_Transmit ? I've initialized USART1... And I want to transmit a test message on the task :

void StartTask02(void const * argument)
{
/* USER CODE BEGIN StartTask02 */
/* Infinite loop */
for(;;)
{
HAL_GPIO_TogglePin(GPIOE, GPIO_PIN_5 );
HAL_Delay(200);
HAL_GPIO_TogglePin(GPIOE, GPIO_PIN_6 );
HAL_USART1_Transmit(''I want to send message here, anyone can help ?..............'');
//HAL_Delay(3500);
osDelay(1);
}
/* USER CODE END StartTask02 */
}

HAL_USART_Transmit Function Name HAL_StatusTypeDef HAL_USART_Transmit (USART_HandleTypeDef * husart, uint8_t * pTxData, uint16_t Size, uint32_t Timeout) Function Description Simplex Send an amount of data in blocking mode. Parameters husart: Pointer to a USART_HandleTypeDef structure that contains the configuration information for the specified USART module. pTxData: Pointer to data buffer
1 REPLY 1
George.P
Associate III
Posted on May 07, 2015 at 13:00

Hello,

try this

HAL_UART_Transmit(&huart1, ''Hello world!/r/n'', 16, 1000);

George