14#include <RHGenericDriver.h>
22#define RH_E32_MAX_PAYLOAD_LEN 58
31#define RH_E32_HEADER_LEN 5
34#define RH_E32_MAX_MESSAGE_LEN (RH_E32_MAX_PAYLOAD_LEN-RH_E32_HEADER_LEN)
37#define RH_E32_COMMAND_WRITE_PARAMS_SAVE 0xC0
38#define RH_E32_COMMAND_READ_PARAMS 0xC1
39#define RH_E32_COMMAND_WRITE_PARAMS_NOSAVE 0xC2
40#define RH_E32_COMMAND_READ_VERSION 0xC3
41#define RH_E32_COMMAND_RESET 0xC4
44#define RH_E32_PARAM_SPED_UART_MODE_MASK 0xC0
45#define RH_E32_PARAM_SPED_UART_MODE_8N1 0x00
46#define RH_E32_PARAM_SPED_UART_MODE_8O1 0x40
47#define RH_E32_PARAM_SPED_UART_MODE_8E1 0x80
49#define RH_E32_PARAM_SPED_UART_BAUD_MASK 0x38
50#define RH_E32_PARAM_SPED_UART_BAUD_1200 0x00
51#define RH_E32_PARAM_SPED_UART_BAUD_2400 0x08
52#define RH_E32_PARAM_SPED_UART_BAUD_4800 0x10
53#define RH_E32_PARAM_SPED_UART_BAUD_9600 0x18
54#define RH_E32_PARAM_SPED_UART_BAUD_19200 0x20
55#define RH_E32_PARAM_SPED_UART_BAUD_38400 0x28
56#define RH_E32_PARAM_SPED_UART_BAUD_57600 0x30
57#define RH_E32_PARAM_SPED_UART_BAUD_115200 0x38
59#define RH_E32_PARAM_SPED_DATARATE_MASK 0x07
60#define RH_E32_PARAM_SPED_DATARATE_1KBPS 0x00
61#define RH_E32_PARAM_SPED_DATARATE_2KBPS 0x01
62#define RH_E32_PARAM_SPED_DATARATE_5KBPS 0x02
63#define RH_E32_PARAM_SPED_DATARATE_8KBPS 0x03
64#define RH_E32_PARAM_SPED_DATARATE_10KBPS 0x04
65#define RH_E32_PARAM_SPED_DATARATE_15KBPS 0x05
66#define RH_E32_PARAM_SPED_DATARATE_20KBPS 0x06
67#define RH_E32_PARAM_SPED_DATARATE_25KBPS 0x07
69#define RH_E32_PARAM_OPTION_FIXED_MASK 0x80
71#define RH_E32_PARAM_OPTION_IODRIVE_MASK 0x40
73#define RH_E32_PARAM_OPTION_WAKEUP_TIME_MASK 0x38
74#define RH_E32_PARAM_OPTION_WAKEUP_TIME_250MS 0x00
75#define RH_E32_PARAM_OPTION_WAKEUP_TIME_500MS 0x08
76#define RH_E32_PARAM_OPTION_WAKEUP_TIME_750MS 0x10
77#define RH_E32_PARAM_OPTION_WAKEUP_TIME_1000MS 0x18
78#define RH_E32_PARAM_OPTION_WAKEUP_TIME_1250MS 0x20
79#define RH_E32_PARAM_OPTION_WAKEUP_TIME_1500MS 0x28
80#define RH_E32_PARAM_OPTION_WAKEUP_TIME_1750MS 0x30
81#define RH_E32_PARAM_OPTION_WAKEUP_TIME_2000MS 0x38
83#define RH_E32_PARAM_OPTION_FEC_MASK 0x04
85#define RH_E32_PARAM_OPTION_POWER_MASK 0x03
86#define RH_E32_PARAM_OPTION_POWER_30DBM 0x00
87#define RH_E32_PARAM_OPTION_POWER_27DBM 0x01
88#define RH_E32_PARAM_OPTION_POWER_24DBM 0x02
89#define RH_E32_PARAM_OPTION_POWER_21DBM 0x03
232 DataRate1kbps = RH_E32_PARAM_SPED_DATARATE_1KBPS,
233 DataRate2kbps = RH_E32_PARAM_SPED_DATARATE_2KBPS,
234 DataRate5kbps = RH_E32_PARAM_SPED_DATARATE_5KBPS,
235 DataRate8kbps = RH_E32_PARAM_SPED_DATARATE_8KBPS,
236 DataRate10kbps = RH_E32_PARAM_SPED_DATARATE_10KBPS,
237 DataRate15kbps = RH_E32_PARAM_SPED_DATARATE_15KBPS,
238 DataRate20kbps = RH_E32_PARAM_SPED_DATARATE_20KBPS,
239 DataRate25kbps = RH_E32_PARAM_SPED_DATARATE_25KBPS
246 Power30dBm = RH_E32_PARAM_OPTION_POWER_30DBM,
247 Power27dBm = RH_E32_PARAM_OPTION_POWER_27DBM,
248 Power24dBm = RH_E32_PARAM_OPTION_POWER_24DBM,
249 Power21dBm = RH_E32_PARAM_OPTION_POWER_21DBM,
257 BaudRate1200 = RH_E32_PARAM_SPED_UART_BAUD_1200,
258 BaudRate2400 = RH_E32_PARAM_SPED_UART_BAUD_2400,
259 BaudRate4800 = RH_E32_PARAM_SPED_UART_BAUD_4800,
260 BaudRate9600 = RH_E32_PARAM_SPED_UART_BAUD_9600,
261 BaudRate19200 = RH_E32_PARAM_SPED_UART_BAUD_19200,
262 BaudRate38400 = RH_E32_PARAM_SPED_UART_BAUD_38400,
263 BaudRate57600 = RH_E32_PARAM_SPED_UART_BAUD_57600,
264 BaudRate115200 = RH_E32_PARAM_SPED_UART_BAUD_115200,
270 Parity8N1 = RH_E32_PARAM_SPED_UART_MODE_8N1,
271 Parity8O1 = RH_E32_PARAM_SPED_UART_MODE_8O1,
272 Parity8E1 = RH_E32_PARAM_SPED_UART_MODE_8E1,
282 RH_E32(Stream *s=&Serial, uint8_t m0_pin = 4, uint8_t m1_pin = 5, uint8_t aux_pin = 8);
313 bool recv(uint8_t* buf, uint8_t* len);
322 bool send(
const uint8_t* data, uint8_t len);
442 uint8_t _buf[RH_E32_MAX_PAYLOAD_LEN];
Abstract base class for a RadioHead driver.
Definition RHGenericDriver.h:42
virtual RHMode mode()
Definition RHGenericDriver.cpp:165
Driver to send and receive unaddressed, unreliable datagrams via a EBYTE E32-TTL-1W and similar seria...
Definition RH_E32.h:224
bool setDataRate(DataRate rate)
bool setBaudRate(BaudRate rate=BaudRate9600, Parity parity=Parity8N1)
OperatingMode
Defines values to be passed to setOperatinMode.
Definition RH_E32.h:361
@ ModeNormal
Normal mode for sending and receiving messages.
Definition RH_E32.h:362
@ ModePowerSaving
Receiver sleeps until a message is received.
Definition RH_E32.h:364
@ ModeSleep
Use during parameter setting.
Definition RH_E32.h:365
@ ModeWakeUp
Adds a long preamble to transmission to allow destination receivers to wake up.
Definition RH_E32.h:363
PowerLevel
Values to be passed to setPower() to control the transmitter power.
Definition RH_E32.h:245
bool setFrequency(uint16_t frequency)
bool readParameters(Parameters ¶ms)
bool recv(uint8_t *buf, uint8_t *len)
Parity
Values to be passed to setBaudRate() to control the parity of the serial connection to the radio.
Definition RH_E32.h:269
bool setPower(PowerLevel level)
BaudRate
Values to be passed to setBaudRate() to control the radio serial connection baud rate.
Definition RH_E32.h:256
RH_E32(Stream *s=&Serial, uint8_t m0_pin=4, uint8_t m1_pin=5, uint8_t aux_pin=8)
bool writeParameters(Parameters ¶ms, bool save=false)
void setOperatingMode(OperatingMode mode)
DataRate
Values to be passed to setDataRate() to control the on-air data rate.
Definition RH_E32.h:231
uint8_t maxMessageLength()
bool send(const uint8_t *data, uint8_t len)
Structure for reading and writing radio control parameters.
Definition RH_E32.h:372
uint8_t head
0xc2 (no save) or 0xc0 (save)
Definition RH_E32.h:373
uint8_t option
Various control options.
Definition RH_E32.h:378
uint8_t sped
Data and baud rate parameters.
Definition RH_E32.h:376
uint8_t addl
Low address byte (not used by this driver)
Definition RH_E32.h:375
uint8_t chan
Radio channel.
Definition RH_E32.h:377
uint8_t addh
High address byte (not used by this driver)
Definition RH_E32.h:374