cancel
Showing results for 
Search instead for 
Did you mean: 

STM32f-Discovery USART send BREAK

vendor
Associate II
Posted on January 09, 2014 at 17:19

I have setup the USART to Tx/Rx however my application requires sending a Break. The STM32F programmer's manual refernces sending Idle and Break, provides an example and register for sending an idle character but not the Break, please assist. 

Specifically trying to interface the Maxim DS2480 USART to 1Wire interface.

4 REPLIES 4
Posted on January 09, 2014 at 17:34

USART_SendBreak(USART2);

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
vendor
Associate II
Posted on January 09, 2014 at 19:22

Clive,

I thank you for the quick reply. 

USART_SendBreak(xxx) is undefined.  A global search for this command does not show up. It is not defined in the STM32F0xx_usart.c or .h file (or anywhere else)

If you could just send me the c code (using IAR dev system) that would be greatly appreciated.

I thank you in advance for your assistance.

 

Rick

Posted on January 09, 2014 at 19:44

You failed to accurately describe your board/part, I assumed an F1

For an F0

/**
* @brief Enables the specified USART's Request.
* @param USARTx: where x can be 1 or 2 to select the USART peripheral.
* @param USART_Request: specifies the USART request.
* This parameter can be any combination of the following values:
* @arg USART_Request_TXFRQ: Transmit data flush ReQuest
* @arg USART_Request_RXFRQ: Receive data flush ReQuest
* @arg USART_Request_MMRQ: Mute Mode ReQuest
* @arg USART_Request_SBKRQ: Send Break ReQuest
* @arg USART_Request_ABRRQ: Auto Baud Rate ReQuest
* @param NewState: new state of the DMA interface when reception error occurs.
* This parameter can be: ENABLE or DISABLE.
* @retval None
*/
void USART_RequestCmd(USART_TypeDef* USARTx, uint32_t USART_Request, FunctionalState NewState)
{
/* Check the parameters */
assert_param(IS_USART_ALL_PERIPH(USARTx));
assert_param(IS_USART_REQUEST(USART_Request));
assert_param(IS_FUNCTIONAL_STATE(NewState));
if (NewState != DISABLE)
{
/* Enable the USART ReQuest by setting the dedicated request bit in the RQR
register.*/
USARTx->RQR |= USART_Request;
}
else
{
/* Disable the USART ReQuest by clearing the dedicated request bit in the RQR
register.*/
USARTx->RQR &= (uint32_t)~USART_Request;
}
}

Send me a full license for IAR, I'll see what I can do.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
vendor
Associate II
Posted on January 09, 2014 at 19:55

Thank You .