File tree 3 files changed +35
-29
lines changed
3 files changed +35
-29
lines changed Original file line number Diff line number Diff line change 1
1
name =ArduinoRS485
2
- version =1.0.4
2
+ version =1.0.5
3
3
author =Arduino
4
4
maintainer =Arduino <
[email protected] >
5
5
sentence =Enables sending and receiving data using the RS-485 standard with RS-485 shields, like the MKR 485 Shield.
Original file line number Diff line number Diff line change 21
21
#define _RS485_H_INCLUDED
22
22
23
23
#include < Arduino.h>
24
+ #include " RS485_defs.h"
24
25
25
- #ifdef PIN_SERIAL1_TX
26
- #define RS485_DEFAULT_TX_PIN PIN_SERIAL1_TX
27
- #else
28
- #define RS485_DEFAULT_TX_PIN 1
29
- #endif
30
-
31
- #ifdef __AVR__
32
- #define RS485_DEFAULT_DE_PIN 2
33
- #define RS485_DEFAULT_RE_PIN -1
34
- #elif defined(ESP32) || defined(ESP8266)
35
- #define RS485_DEFAULT_DE_PIN 0
36
- #define RS485_DEFAULT_RE_PIN 0
37
- #else
38
- #define RS485_DEFAULT_DE_PIN A6
39
- #define RS485_DEFAULT_RE_PIN A5
40
- #endif
41
-
42
- #if defined(ESP8266)
43
- #define RS485_SER_CONF_TYPE SerialConfig
44
- #elif defined(ESP32)
45
- #define RS485_SER_CONF_TYPE uint32_t
46
- #else
47
- #define RS485_SER_CONF_TYPE uint16_t
48
- #endif
49
-
50
-
51
- #define RS485_DEFAULT_PRE_DELAY 50
52
- #define RS485_DEFAULT_POST_DELAY 50
53
26
54
27
class RS485Class : public Stream {
55
28
public:
Original file line number Diff line number Diff line change
1
+ #ifndef _ARDUINO_RS485_DEFS_H_INCLUDED
2
+ #define _ARDUINO_RS485_DEFS_H_INCLUDED
3
+
4
+ #ifdef PIN_SERIAL1_TX
5
+ #define RS485_DEFAULT_TX_PIN PIN_SERIAL1_TX
6
+ #else
7
+ #define RS485_DEFAULT_TX_PIN 1
8
+ #endif
9
+
10
+ #ifdef __AVR__
11
+ #define RS485_DEFAULT_DE_PIN 2
12
+ #define RS485_DEFAULT_RE_PIN -1
13
+ #elif defined(ESP32 ) || defined(ESP8266 )
14
+ #define RS485_DEFAULT_DE_PIN 0
15
+ #define RS485_DEFAULT_RE_PIN 0
16
+ #else
17
+ #define RS485_DEFAULT_DE_PIN A6
18
+ #define RS485_DEFAULT_RE_PIN A5
19
+ #endif
20
+
21
+ #if defined(ESP8266 )
22
+ #define RS485_SER_CONF_TYPE SerialConfig
23
+ #elif defined(ESP32 )
24
+ #define RS485_SER_CONF_TYPE uint32_t
25
+ #else
26
+ #define RS485_SER_CONF_TYPE uint16_t
27
+ #endif
28
+
29
+
30
+ #define RS485_DEFAULT_PRE_DELAY 50
31
+ #define RS485_DEFAULT_POST_DELAY 50
32
+
33
+ #endif
You can’t perform that action at this time.
0 commit comments