STC15W408AS library 0.12.0
Loading...
Searching...
No Matches
Macros
UART1 8-bit send/receive functions

Macros

#define uart1_send_byte(byte)
 Sends a single byte over UART1.
 
#define is_uart1_send_byte_complete()   (TI)
 Checks if UART1 send byte operation is complete.
 
#define uart1_receive_byte(byte)
 Receives a single byte over UART1.
 
#define is_uart1_receive_byte_complete()   (RI)
 Checks if UART1 receive byte operation is complete.
 

Detailed Description

UART1 routines used in all UART1 modes.

This header file included in UART1 mode headers and do not need to be included explicitly.

Author
Michael Golovanov

Macro Definition Documentation

◆ is_uart1_receive_byte_complete

#define is_uart1_receive_byte_complete ( )    (RI)

Checks if UART1 receive byte operation is complete.

Attention
Use this function only in UART 1interrupt service routine.

◆ is_uart1_send_byte_complete

#define is_uart1_send_byte_complete ( )    (TI)

Checks if UART1 send byte operation is complete.

Attention
Use this function only in UART 1interrupt service routine.

◆ uart1_receive_byte

#define uart1_receive_byte (   byte)
Value:
do { \
RI=0; \
while(!RI); \
byte = SBUF; \
} while (0)

Receives a single byte over UART1.

The function blocks until the byte is fully received.

Parameters
byteuint8_t the 8-bit data value to be received (0-255).
Note
Requires UART1 to be previously initialized and started.
Uses polling (blocking) method for receveive.
Warning
Should not be called from interrupt service routines

◆ uart1_send_byte

#define uart1_send_byte (   byte)
Value:
do \
{ \
SBUF = byte; \
while (!TI); \
TI = 0; \
} while (0)

Sends a single byte over UART1.

Transmits the specified byte through UART1. The function blocks until the byte is fully transmitted.

Note
Requires UART1 to be previously initialized and started.
Uses polling (blocking) method for transmission.
Parameters
byteuint8_t byte to be sent
Warning
Should not be called from interrupt service routines