STC15W408AS library 0.12.0
Loading...
Searching...
No Matches
Enumerations
UART1 Mode 0

Enumerations

enum  uart1_mode0_baudrate_t { baudrate_921600 = 921600U , baudrate_5529600 = 5529600U }
 UART1 baud rate enumeration.
 

init

UART1 initialization functions

#define uart1_mode0_init(baudRate)
 Initializes UART1 in Mode 0.
 

Detailed Description

Functions and data structures for UART1 communication in Mode 0.

Mode 0 provides synchronous communication with fixed baud rate.

Serial data enters and exits through RxD. TxD outputs the shift clock. Eight data bits are transmitted/received with the least-significant (LSB) first. The baud rate is fixed at 1/12 (or 1/2) the System clock cycle.

Attention
Baud rate is biased by frequency divider
See also
uart1_send_byte()
uart1_receive_byte()
is_uart1_send_byte_complete()
is_uart1_receive_byte_complete()
Author
Michael Golovanov

Macro Definition Documentation

◆ uart1_mode0_init

#define uart1_mode0_init (   baudRate)
Value:
do \
{ \
enable_mcu_interrupts(); \
enable_uart1_interrupt(); \
PCON &= 0x3F; \
SCON = 0; \
baudRate == baudrate_921600 ? \
bit_clr(AUXR, CBIT5) : bit_set(AUXR, SBIT5);\
} while (0)

Initializes UART1 in Mode 0.

Must be called before any UART communication is initiated.

Parameters
baudRateuart1_mode0_baudrate_t The desired baud rate.
Attention
Baud rate is biased by frequency divider.