Allows RS485 communication using MAX485 chip

Dependents:   Multiple_7SegDisplays

Fork of RS485 by Stefan Mueller

Committer:
shivanandgowdakr
Date:
Tue Aug 21 10:21:52 2018 +0000
Revision:
2:302837c859de
Parent:
1:916e1dd538ce
No changes;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
NeoBelerophon 0:10a8f9128f73 1 #include "RS485.h"
NeoBelerophon 0:10a8f9128f73 2
NeoBelerophon 0:10a8f9128f73 3 RS485::RS485(PinName tx, PinName rx, PinName mode, const char *name) : Serial( tx, rx, name), m_modePin(mode)
NeoBelerophon 0:10a8f9128f73 4 {
NeoBelerophon 1:916e1dd538ce 5 m_modePin = 0;
NeoBelerophon 0:10a8f9128f73 6 }
NeoBelerophon 0:10a8f9128f73 7
NeoBelerophon 0:10a8f9128f73 8 int RS485::_getc() {
NeoBelerophon 0:10a8f9128f73 9 return _base_getc();
NeoBelerophon 0:10a8f9128f73 10 }
NeoBelerophon 0:10a8f9128f73 11
NeoBelerophon 0:10a8f9128f73 12 int RS485::_putc(int c) {
NeoBelerophon 0:10a8f9128f73 13 m_modePin = 1;
NeoBelerophon 0:10a8f9128f73 14 int ret = _base_putc(c);
NeoBelerophon 0:10a8f9128f73 15 m_modePin = 0;
NeoBelerophon 0:10a8f9128f73 16 return ret;
NeoBelerophon 0:10a8f9128f73 17 }
NeoBelerophon 0:10a8f9128f73 18