Allows RS485 communication using MAX485 chip

Dependencies:   mbed

Committer:
NeoBelerophon
Date:
Sat Nov 14 11:55:10 2015 +0000
Revision:
1:916e1dd538ce
Parent:
0:10a8f9128f73
little fixes

Who changed what in which revision?

UserRevisionLine numberNew contents of line
NeoBelerophon 0:10a8f9128f73 1 #include <mbed.h>
NeoBelerophon 0:10a8f9128f73 2 class RS485 : public Serial
NeoBelerophon 0:10a8f9128f73 3 {
NeoBelerophon 0:10a8f9128f73 4 public:
NeoBelerophon 0:10a8f9128f73 5 /** Create a RS485 Serial port using MAX485, connected to the specified transmit and receive pins
NeoBelerophon 0:10a8f9128f73 6 *
NeoBelerophon 0:10a8f9128f73 7 * @param tx Transmit pin
NeoBelerophon 0:10a8f9128f73 8 * @param rx Receive pin
NeoBelerophon 0:10a8f9128f73 9 * @param mode Rx TX Mode pin
NeoBelerophon 0:10a8f9128f73 10 *
NeoBelerophon 0:10a8f9128f73 11 * @note
NeoBelerophon 0:10a8f9128f73 12 * Either tx or rx may be specified as NC if unused
NeoBelerophon 0:10a8f9128f73 13 */
NeoBelerophon 0:10a8f9128f73 14 RS485(PinName tx, PinName rx, PinName mode, const char *name=NULL);
NeoBelerophon 0:10a8f9128f73 15
NeoBelerophon 0:10a8f9128f73 16 protected:
NeoBelerophon 0:10a8f9128f73 17 virtual int _putc(int c);
NeoBelerophon 0:10a8f9128f73 18 virtual int _getc();
NeoBelerophon 0:10a8f9128f73 19
NeoBelerophon 0:10a8f9128f73 20 private:
NeoBelerophon 0:10a8f9128f73 21 DigitalOut m_modePin;
NeoBelerophon 0:10a8f9128f73 22
NeoBelerophon 0:10a8f9128f73 23 };