Stefan Mueller
/
RS485
Allows RS485 communication using MAX485 chip
RS485.cpp@1:916e1dd538ce, 2015-11-14 (annotated)
- 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?
User | Revision | Line number | New 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 |