STC15W408AS library 0.15.0
Loading...
Searching...
No Matches
uart1_mode0.h
Go to the documentation of this file.
1#ifndef STC15_UART1MODE0H
2#define STC15_UART1MODE0H
3
4#include <stdint.h>
5
6#include <sys.h>
7#include <bits.h>
8#include <interrupt.h>
9#include <uart1_8bit_shared.h>
10
39typedef enum
40#if __SDCC_VERSION_MAJOR == 4 && __SDCC_VERSION_MINOR >= 5
41 : uint32_t
42#endif
43{
44 baudrate_921600 = 921600U,
45 baudrate_5529600 = 5529600U
47
52
66#define uart1_mode0_init(baudRate) \
67do \
68{ \
69 enable_mcu_interrupts(); \
70 disable_uart1_interrupt(); \
71 PCON &= 0x3F; \
72 SCON = 0; \
73 baudRate == baudrate_921600 ? \
74 bit_clr(AUXR, CBIT5) : bit_set(AUXR, SBIT5);\
75} while (0)
76
78
79
80#endif
uart1_mode0_baudrate_t
UART1 baud rate enumeration.
Definition uart1_mode0.h:43