代码搜索结果
找到约 10,000 项符合
USART 的代码
usart.ewp
1
Debug
AVR
usart.h
#ifndef USART_H
#define USART_H
#ifdef USART_C
void UsartInit(void);
int PutChar(char c);
void SendNbyte(unsigned char *p,unsigned char L);
void PutStr(unsigned char *Str);
#else
extern void U
usart.c
#define USART_C
#include "includes.h"
int usart_putchar(char c)
{
if (c == '\n')
usart_putchar('\r');
while(UCSRA&(1
usart.c
#define USART_C
#include "includes.h"
void put_char(unsigned char ch)
{
/* if(ch == '\n')
{
usart_putchar('\r');
} */
while(!(UCSRA&(1
usart.h
#ifndef USART_H
#define USART_H
#ifdef USART_C
void put_char(unsigned char ch);
void InitSerial(void);
void put_string(unsigned char *sting);
#else
extern void put_char(unsigned char ch);
exte
usart.c
#include "includes.h"
#define USART_C
int usart_putchar(char c)
{
if (c == '\n')
usart_putchar('\r');
while(UCSRA & (1
usart.h
#if !defined(USART_H)
#define USART_H
#if defined UCART_C
int usart_putchar(char c);
void init_usart(void);
#else
extern int usart_putchar(char c);
extern void init_usart(void);
#endif
#endif
usart.h
//波特率9600/9个数据位/1个停止位/奇校验/收发开启/接收中断
void usart_init(void)
{
UCSRA=0x01;
UCSRB=0x9C;
UCSRC=0xB6;
UBRRH=0x00;
UBRRL=0x2f;
PORTD&=~(1
usart._h
//波特率9600/9个数据位/1个停止位/奇校验/收发开启/接收中断
void usart_init(void)
{
UCSRA=0x01;
UCSRB=0x9C;
UCSRC=0xB6;
UBRRH=0x00;
UBRRL=0x2f;
PORTD&=~0x08; //MAX485平时工作在接收状态
DDRD|=0x08;
}
//------
usart.h
#define BAUDRATE 9600 //波特率
#define F_CPU 7327800
//波特率9600/9个数据位/1个停止位/奇校验/收发开启/接收中断
void usart_init(void)
{
UCSRA=0x01;//多机通讯模式(MPCM=1)
UCSRB=0x9C;
UCSRC=0xB6;
UBRRL=