ECRobot C++ API for LEGO MINDSTORMS NXT
1.0.10
|
00001 // 00002 // Rs485.h 00003 // 00004 // Copyright 2010 by Takashi Chikamasa, Simone Casale Brunet, Jon C. Martin and Robert W. Kramer 00005 // 00006 00007 #ifndef RS485_H_ 00008 #define RS485_H_ 00009 00010 00011 extern "C" 00012 { 00013 #include "ecrobot_interface.h" 00014 #include "rtoscalls.h" 00015 }; 00016 00017 namespace ecrobot 00018 { 00028 class Rs485 00029 { 00030 public: 00034 static const U32 MAX_RS485_DATA_LENGTH = 64; 00035 00039 static const U32 LEGO_DEFAULT_BAUD_RATE = 921600; 00040 00050 Rs485(U32 baudRate = LEGO_DEFAULT_BAUD_RATE); 00051 00057 ~Rs485(void); 00058 00066 U32 send(U8* data, U32 offset, U32 length); 00067 00075 U32 receive(U8* data, U32 offset, U32 length) const; 00076 }; 00077 } 00078 00079 #endif