📄 uart.c
字号:
/* ------------------------------------------------------------------------
File : uart.c
Descr : Initialisation routine for the AVR's onchip UART.
History: 11APR.00; Henk B&B; Created.
--------------------------------------------------------------------------- */
#include "general.h"
/* ------------------------------------------------------------------------ */
void uart_init( BYTE baud )
{
/* Set the Baud Rate Register */
UBRR0L = baud;
/* Set the UART Control Register: enable receive and send */
UCSR0B = BIT(RXEN0) | BIT(TXEN0);
/* Enable interrupts */
/*UCSR0B |= BIT(RXCIE0) | BIT(TXCIE0);*/
}
/* ------------------------------------------------------------------------ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -