STM32F4 USART Functions

Some useful functions to send data…

void putchar(USART_TypeDef* myUSART, uint32_t data)
{
myUSART->DR = (char)data;
while(((myUSART->SR >> 6) & 0x01) == 0);
}

void putstr(USART_TypeDef* myUSART, char *data)
{
while(*data)
putchar(myUSART,*data++);
}

Advertisements

About atomsoft

Starting a small company. Trying to build it from ground up. Only 2 employees so far. Nothing serious yet but soon!

2 responses to “STM32F4 USART Functions”

  1. bluehash says :

    Hello, I’m here because one of our forum members posted your link in our STM32 forum( http://forum.arm-hq.com ). You are welcome to join us and be a part of our community.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: