aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPiotr Esden-Tempski2010-01-15 00:03:29 +0100
committerPiotr Esden-Tempski2010-01-15 00:03:29 +0100
commit667f32bd455ca3996d62514a2c16a7c3aa737bbf (patch)
treef8d8d0e57a4844568e1f60750bdec6a2858474de /lib
parentafc9cc84deb1ab2093501f5d5595f0d01f03e42f (diff)
Added USART_ prefix to bit definitions.
This matches the new convention used throughout libopenstm32.
Diffstat (limited to 'lib')
-rw-r--r--lib/usart.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/usart.c b/lib/usart.c
index fdcc932..abed18b 100644
--- a/lib/usart.c
+++ b/lib/usart.c
@@ -30,9 +30,9 @@ void usart_set_baudrate(u32 usart, u32 baud)
void usart_set_databits(u32 usart, u32 bits)
{
if (bits == 8)
- USART_CR1(usart) &= ~CR1_M; /* 8 data bits */
+ USART_CR1(usart) &= ~USART_CR1_M; /* 8 data bits */
else
- USART_CR1(usart) |= CR1_M; /* 9 data bits */
+ USART_CR1(usart) |= USART_CR1_M; /* 9 data bits */
}
void usart_set_stopbits(u32 usart, u32 stopbits)
@@ -73,12 +73,12 @@ void usart_set_flow_control(u32 usart, u32 flowcontrol)
void usart_enable(u32 usart)
{
- USART_CR1(usart) |= CR1_UE;
+ USART_CR1(usart) |= USART_CR1_UE;
}
void usart_disable(u32 usart)
{
- USART_CR1(usart) &= ~CR1_UE;
+ USART_CR1(usart) &= ~USART_CR1_UE;
}
void usart_send(u32 usart, u16 data)
@@ -87,13 +87,13 @@ void usart_send(u32 usart, u16 data)
USART_DR(usart) = (data & 0x1ff);
/* Wait until the data has been transferred into the shift register. */
- while ((USART_SR(usart) & SR_TXE) == 0);
+ while ((USART_SR(usart) & USART_SR_TXE) == 0);
}
u16 usart_recv(u32 usart)
{
/* Wait until the data is ready to be received. */
- while ((USART_SR(usart) & SR_RXNE) == 0);
+ while ((USART_SR(usart) & USART_SR_RXNE) == 0);
/* Receive data. */
return USART_DR(usart) & 0x1ff;