⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uart.h

📁 AVR平台下的CanOpen协议桟源码包括应用
💻 H
字号:
/* ------------------------------------------------------------------------
File   : uart.h

Descr  : Include file for the AVR's onchip UART.

History: 11APR.00; Henk B&B; Created.
--------------------------------------------------------------------------- */

/* ------------------------------------------------------------------------ */
/* The AVR baud rate generator generates a baud rate according to:
       baudrate = clockfreqency / 16*(UBRR + 1)
   with UBRR is the contents of the UART Baud Rate Register.

   With a clock of 4 MHz:
     baudrate  UBRR  %Err
     --------  ----  ----
        2400    103   0.2
        4800     51   0.2
        9600     25   0.2
       19200     12   0.2
*/

#define BAUD_9600  25
#define BAUD_4800  51

/* ------------------------------------------------------------------------ */
/* Function prototypes */

void uart_init( BYTE baud );

/* ------------------------------------------------------------------------ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -