uart.h

来自「基于ATmega64单片机以及vs1003的SD卡方案的MP3播放源代码」· C头文件 代码 · 共 37 行

H
37
字号
/*****************************************************/
/*            File name : UART.h                                                    */
/* Description : header file for UART.c                                       */
/* Platform     : AVRStudio4.13 + WinAVR20070525  for AVR     */
/* Author       : Michael Zhang - 章其波                            */
/* Email         : sudazqb@163.com                                          */
/* MSN          : zhangqibo_1985@hotmail.com                          */
/* Date          : 2006-12-26                                                    */
/* NOT FOR COMMERCIAL USE,     ALL RIGHT RESERVED!         */
/*****************************************************/
/* Change Log:                                                                      */
/*                   20061226: modify for AVRGCC, fdevopen();        */
/*                   20061226: original version from ATmel's datasheet*/
/*****************************************************/

/* Environment: WinAVR 20060421*/
/* This program is designed for standard io stream */
/* It use the function fdevopen(int*,int*) */
#ifndef __UART_H__
#define __UART_H__

#include<avr/io.h>
#include<stdio.h>

//#define FOSC   7372800
#define FOSC   F_CPU
//#define BAUD   115200
#define BAUD   115200

#define MYUBRR FOSC/BAUD/16-1

extern int USART_putchar(char CH);
extern int USART_getchar(void);
extern void COM_Initial(unsigned int UBRR_val);

#endif

⌨️ 快捷键说明

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