From 01a12fdad10b5995495e1a4236fdfb1a583979ab Mon Sep 17 00:00:00 2001 From: Joe Zhao Date: Fri, 16 May 2014 13:48:41 +0800 Subject: First Commit --- rs422lib/rsbus.h | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 rs422lib/rsbus.h (limited to 'rs422lib/rsbus.h') diff --git a/rs422lib/rsbus.h b/rs422lib/rsbus.h new file mode 100644 index 0000000..036195d --- /dev/null +++ b/rs422lib/rsbus.h @@ -0,0 +1,41 @@ +/* + * rsbus.h + * + * Created on: 2014-4-26 + * Author: Tuowen + */ + +// DE RSOUT.RSPIN HIGH ENABLE +// RE LOW ENABLE -> ALWAYS ENABLE +// RECEIVE QUERY -> Conditional FNC call +// Process -> Output (Done in main program) +// SMCLK set to 4MHZ + + +#ifndef RSBUS_H_ +#define RSBUS_H_ + +#include +#include"precomp.h" + +#define TYPE0 (0x00) //TYPE 0 is a dummy used for debug + +#define TYPE1 (0x01) +#define TYPE2 (0x02) + +#define STBIT0 (0x5B) +#define STBIT1 (0xAD) +#define EDBIT0 (0xA4) +#define EDBIT1 (0x52) + +#define TXLEN (4) + +#define RSMAX (20) + +typedef void (*rshdlr)(unsigned char*,int); + +void rsbus_init(rshdlr); + +void rsbus_w(int addr,unsigned char* buf,unsigned int len); + +#endif /* RSBUS_H_ */ -- cgit v1.2.3-70-g09d2