summaryrefslogtreecommitdiff
path: root/trunk/reprap/firmware/FiveD_GCode/FiveD_GCode_Interpreter/intercom.h
blob: fbfd83d2764eedd143d0b49b9e2a3f811e0d8be6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
 * Class to handle internal communications in the machine via RS485
 *
 * Adrian Bowyer 3 July 2009
 *
 */
 
#ifndef INTERCOM_H
#define INTERCOM_H

#if MOTHERBOARD > 1

#define IC_BUFFER 10
#define MASTER_ADDRESS "00"

//our RS485 pins
#define RX_ENABLE_PIN	13
#define TX_ENABLE_PIN	12

 
class intercom
{
  private:
    char myBuffer[IC_BUFFER];
    bool ok;
    void getPacket(char* string, int len);
    
  public:
    intercom();
    void sendPacket(byte address, char* string);
    void sendPacketWithReply(byte address, char* string, char* reply);

};

extern intercom talker;

#endif
#endif