STC15W408AS library 0.12.0
Loading...
Searching...
No Matches
Macros | Functions
Simple UART1

Macros

#define uart1_init(uart_baudrate)
 Initiazlize UART1.
 

Functions

int putchar (int ch)
 Send character to UART1.
 
int getchar (void)
 Receive character from UART1.
 

Detailed Description

Functions and data structures related to exchange data thru UART1

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_init

#define uart1_init (   uart_baudrate)
Value:
do { \
uart1_mode1_timer2_1T_init(RxD_P30_TxD_P31); \
uart1_mode1_timer2_1T_start_ext(uart_baudrate); \
} while(0)
@ RxD_P30_TxD_P31
RxD on P3.0 and TxD on P3.1 pins.
Definition uart1_shared.h:25

Initiazlize UART1.

Initialize uart using Timer2. Set timer according to baudrate

Parameters
uart_baudrateuint32_t uart baudrate, like 9600 and etc

Function Documentation

◆ getchar()

int getchar ( void  )

Receive character from UART1.

This method need for scanf

Returns
received char

◆ putchar()

int putchar ( int  ch)

Send character to UART1.

This method need for printf

Parameters
chcharacter to send
Returns
char sended to UART