Allows RS485 communication using MAX485 chip

Dependents:   Multiple_7SegDisplays

Fork of RS485 by Stefan Mueller

RS485.cpp

Committer:
shivanandgowdakr
Date:
2018-08-21
Revision:
2:302837c859de
Parent:
1:916e1dd538ce

File content as of revision 2:302837c859de:

#include "RS485.h"

RS485::RS485(PinName tx, PinName rx, PinName mode, const char *name) : Serial( tx, rx, name), m_modePin(mode)
{   
    m_modePin = 0;
}

int RS485::_getc() { 
    return _base_getc();
}

int RS485::_putc(int c) {
    m_modePin = 1;
    int ret = _base_putc(c);
    m_modePin = 0;
    return ret;
}