RadioHead
RH_ASK.h
1 // RH_ASK.h
2 //
3 // Copyright (C) 2014 Mike McCauley
4 // $Id: RH_ASK.h,v 1.18 2017/07/25 05:26:50 mikem Exp $
5 
6 #ifndef RH_ASK_h
7 #define RH_ASK_h
8 
9 #include <RHGenericDriver.h>
10 
11 // Maximum message length (including the headers, byte count and FCS) we are willing to support
12 // This is pretty arbitrary
13 #define RH_ASK_MAX_PAYLOAD_LEN 67
14 
15 // The length of the headers we add (To, From, Id, Flags)
16 // The headers are inside the payload and are therefore protected by the FCS
17 #define RH_ASK_HEADER_LEN 4
18 
19 // This is the maximum message length that can be supported by this library.
20 // Can be pre-defined to a smaller size (to save SRAM) prior to including this header
21 // Here we allow for 1 byte message length, 4 bytes headers, user data and 2 bytes of FCS
22 #ifndef RH_ASK_MAX_MESSAGE_LEN
23  #define RH_ASK_MAX_MESSAGE_LEN (RH_ASK_MAX_PAYLOAD_LEN - RH_ASK_HEADER_LEN - 3)
24 #endif
25 
26 #if !defined(RH_ASK_RX_SAMPLES_PER_BIT)
27 /// Number of samples per bit
28  #define RH_ASK_RX_SAMPLES_PER_BIT 8
29 #endif //RH_ASK_RX_SAMPLES_PER_BIT
30 
31 /// The size of the receiver ramp. Ramp wraps modulo this number
32 #define RH_ASK_RX_RAMP_LEN 160
33 
34 // Ramp adjustment parameters
35 // Standard is if a transition occurs before RH_ASK_RAMP_TRANSITION (80) in the ramp,
36 // the ramp is retarded by adding RH_ASK_RAMP_INC_RETARD (11)
37 // else by adding RH_ASK_RAMP_INC_ADVANCE (29)
38 // If there is no transition it is adjusted by RH_ASK_RAMP_INC (20)
39 /// Internal ramp adjustment parameter
40 #define RH_ASK_RAMP_INC (RH_ASK_RX_RAMP_LEN/RH_ASK_RX_SAMPLES_PER_BIT)
41 /// Internal ramp adjustment parameter
42 #define RH_ASK_RAMP_TRANSITION RH_ASK_RX_RAMP_LEN/2
43 /// Internal ramp adjustment parameter
44 #define RH_ASK_RAMP_ADJUST 9
45 /// Internal ramp adjustment parameter
46 #define RH_ASK_RAMP_INC_RETARD (RH_ASK_RAMP_INC-RH_ASK_RAMP_ADJUST)
47 /// Internal ramp adjustment parameter
48 #define RH_ASK_RAMP_INC_ADVANCE (RH_ASK_RAMP_INC+RH_ASK_RAMP_ADJUST)
49 
50 /// Outgoing message bits grouped as 6-bit words
51 /// 36 alternating 1/0 bits, followed by 12 bits of start symbol (together called the preamble)
52 /// Followed immediately by the 4-6 bit encoded byte count,
53 /// message buffer and 2 byte FCS
54 /// Each byte from the byte count on is translated into 2x6-bit words
55 /// Caution, each symbol is transmitted LSBit first,
56 /// but each byte is transmitted high nybble first
57 /// This is the number of 6 bit nibbles in the preamble
58 #define RH_ASK_PREAMBLE_LEN 8
59 
60 /////////////////////////////////////////////////////////////////////
61 /// \class RH_ASK RH_ASK.h <RH_ASK.h>
62 /// \brief Driver to send and receive unaddressed, unreliable datagrams via inexpensive ASK (Amplitude Shift Keying) or
63 /// OOK (On Off Keying) RF transceivers.
64 ///
65 /// The message format and software technology is based on our earlier VirtualWire library
66 /// (http://www.airspayce.com/mikem/arduino/VirtualWire), with which it is compatible.
67 /// See http://www.airspayce.com/mikem/arduino/VirtualWire.pdf for more details.
68 /// VirtualWire is now obsolete and unsupported and is replaced by this library.
69 ///
70 /// RH_ASK is a Driver for Arduino, Maple and others that provides features to send short
71 /// messages, without addressing, retransmit or acknowledgment, a bit like UDP
72 /// over wireless, using ASK (amplitude shift keying). Supports a number of
73 /// inexpensive radio transmitters and receivers. All that is required is
74 /// transmit data, receive data and (for transmitters, optionally) a PTT
75 /// transmitter enable. Can also be used over various analog connections (not just a data radio),
76 /// such as the audio channel of an A/V sender, or long TTL lines.
77 ///
78 /// It is intended to be compatible with the RF Monolithics (www.rfm.com)
79 /// Virtual Wire protocol, but this has not been tested.
80 ///
81 /// Does not use the Arduino UART. Messages are sent with a training preamble,
82 /// message length and checksum. Messages are sent with 4-to-6 bit encoding
83 /// for good DC balance, and a CRC checksum for message integrity.
84 ///
85 /// But why not just use a UART connected directly to the
86 /// transmitter/receiver? As discussed in the RFM documentation, ASK receivers
87 /// require a burst of training pulses to synchronize the transmitter and
88 /// receiver, and also requires good balance between 0s and 1s in the message
89 /// stream in order to maintain the DC balance of the message. UARTs do not
90 /// provide these. They work a bit with ASK wireless, but not as well as this
91 /// code.
92 ///
93 /// \par Theory of operation
94 ///
95 /// See ASH Transceiver Software Designer's Guide of 2002.08.07
96 /// http://wireless.murata.com/media/products/apnotes/tr_swg05.pdf?ref=rfm.com
97 ///
98 /// http://web.engr.oregonstate.edu/~moon/research/files/cas2_mar_07_dpll.pdf while not directly relevant
99 /// is also interesting.
100 ///
101 /// \par Implementation Details
102 ///
103 /// Messages of up to RH_ASK_MAX_PAYLOAD_LEN (67) bytes can be sent
104 /// Each message is transmitted as:
105 ///
106 /// - 36 bit training preamble consisting of 0-1 bit pairs
107 /// - 12 bit start symbol 0xb38
108 /// - 1 byte of message length byte count (4 to 30), count includes byte count and FCS bytes
109 /// - n message bytes (uincluding 4 bytes of header), maximum n is RH_ASK_MAX_MESSAGE_LEN + 4 (64)
110 /// - 2 bytes FCS, sent low byte-hi byte
111 ///
112 /// Everything after the start symbol is encoded 4 to 6 bits, Therefore a byte in the message
113 /// is encoded as 2x6 bit symbols, sent hi nybble, low nybble. Each symbol is sent LSBit
114 /// first. The message may consist of any binary digits.
115 ///
116 /// The Arduino Diecimila clock rate is 16MHz => 62.5ns/cycle.
117 /// For an RF bit rate of 2000 bps, need 500microsec bit period.
118 /// The ramp requires 8 samples per bit period, so need 62.5microsec per sample => interrupt tick is 62.5microsec.
119 ///
120 /// The maximum packet length consists of
121 /// (6 + 2 + RH_ASK_MAX_MESSAGE_LEN*2) * 6 = 768 bits = 0.384 secs (at 2000 bps).
122 /// where RH_ASK_MAX_MESSAGE_LEN is RH_ASK_MAX_PAYLOAD_LEN - 7 (= 60).
123 /// The code consists of an ISR interrupt handler. Most of the work is done in the interrupt
124 /// handler for both transmit and receive, but some is done from the user level. Expensive
125 /// functions like CRC computations are always done in the user level.
126 ///
127 /// \par Supported Hardware
128 ///
129 /// A range of communications
130 /// hardware is supported. The ones listed below are available in common retail
131 /// outlets in Australia and other countries for under $10 per unit. Many
132 /// other modules may also work with this software.
133 ///
134 /// Runs on a wide range of Arduino processors using Arduino IDE 1.0 or later.
135 /// Also runs on on Energia,
136 /// with MSP430G2553 / G2452 and Arduino with ATMega328 (courtesy Yannick DEVOS - XV4Y),
137 /// but untested by us. It also runs on Teensy 3.0 (courtesy of Paul
138 /// Stoffregen), but untested by us. Also compiles and runs on ATtiny85 in
139 /// Arduino environment, courtesy r4z0r7o3. Also compiles on maple-ide-v0.0.12,
140 /// and runs on Maple, flymaple 1.1 etc. Runs on ATmega8/168 (Arduino Diecimila,
141 /// Uno etc), ATmega328 and can run on almost any other AVR8 platform,
142 /// without relying on the Arduino framework, by properly configuring the
143 /// library editing the RH_ASK.h header file for describing the access
144 /// to IO pins and for setting up the timer.
145 /// Runs on ChipKIT Core supported processors such as Uno32 etc.
146 ///
147 /// - Receivers
148 /// - RX-B1 (433.92MHz) (also known as ST-RX04-ASK)
149 /// - RFM83C from HopeRF http://www.hoperfusa.com/details.jsp?pid=126
150 /// - SYN480R and other similar ASK receivers
151 /// - Transmitters:
152 /// - TX-C1 (433.92MHz)
153 /// - RFM85 from HopeRF http://www.hoperfusa.com/details.jsp?pid=127
154 /// - SYN115, F115 and other similar ASK transmitters
155 /// - Transceivers
156 /// - DR3100 (433.92MHz)
157 ///
158 /// \par Connecting to Arduino
159 ///
160 /// Most transmitters can be connected to Arduino like this:
161 /// \code
162 /// Arduino Transmitter
163 /// GND------------------------------GND
164 /// D12------------------------------Data
165 /// 5V-------------------------------VCC
166 /// \endcode
167 ///
168 /// Most receivers can be connected to Arduino like this:
169 /// \code
170 /// Arduino Receiver
171 /// GND------------------------------GND
172 /// D11------------------------------Data
173 /// 5V-------------------------------VCC
174 /// SHUT (not connected)
175 /// WAKEB (not connected)
176 /// GND |
177 /// ANT |- connect to your antenna syetem
178 /// \endcode
179 ///
180 /// RH_ASK works with ATTiny85, using Arduino 1.0.5 and tinycore from
181 /// https://code.google.com/p/arduino-tiny/downloads/detail?name=arduino-tiny-0100-0018.zip
182 /// Tested with the examples ask_transmitter and ask_receiver on ATTiny85.
183 /// Caution: The RAM memory requirements on an ATTiny85 are *very* tight. Even the bare bones
184 /// ask_transmitter sketch barely fits in eh RAM available on the ATTiny85. Its unlikely to work on
185 /// smaller ATTinys such as the ATTiny45 etc. If you have wierd behaviour, consider
186 /// reducing the size of RH_ASK_MAX_PAYLOAD_LEN to the minimum you can work with.
187 /// Caution: the default internal clock speed on an ATTiny85 is 1MHz. You MUST set the internal clock speed
188 /// to 8MHz. You can do this with Arduino IDE, tineycore and ArduinoISP by setting the board type to "ATtiny85@8MHz',
189 /// setting theProgrammer to 'Arduino as ISP' and selecting Tools->Burn Bootloader. This does not actually burn a
190 /// bootloader into the tiny, it just changes the fuses so the chip runs at 8MHz.
191 /// If you run the chip at 1MHz, you will get RK_ASK speeds 1/8th of the expected.
192 ///
193 /// Initialise RH_ASK for ATTiny85 like this:
194 /// \code
195 /// // #include <SPI.h> // comment this out, not needed
196 /// RH_ASK driver(2000, 4, 3); // 200bps, TX on D3 (pin 2), RX on D4 (pin 3)
197 /// \endcode
198 /// then:
199 /// Connect D3 (pin 2) as the output to the transmitter
200 /// Connect D4 (pin 3) as the input from the receiver.
201 ///
202 ///
203 /// For testing purposes you can connect 2 Arduino RH_ASK instances directly, by
204 /// connecting pin 12 of one to 11 of the other and vice versa, like this for a duplex connection:
205 ///
206 /// \code
207 /// Arduino 1 wires Arduino 1
208 /// D11-----------------------------D12
209 /// D12-----------------------------D11
210 /// GND-----------------------------GND
211 /// \endcode
212 ///
213 /// You can also connect 2 RH_ASK instances over a suitable analog
214 /// transmitter/receiver, such as the audio channel of an A/V transmitter/receiver. You may need
215 /// buffers at each end of the connection to convert the 0-5V digital output to a suitable analog voltage.
216 ///
217 /// Measured power output from RFM85 at 5V was 18dBm.
218 ///
219 /// \par ESP8266
220 /// This module has been tested with the ESP8266 using an ESP-12 on a breakout board
221 /// ESP-12E SMD Adaptor Board with Power Regulator from tronixlabs
222 /// http://tronixlabs.com.au/wireless/esp8266/esp8266-esp-12e-smd-adaptor-board-with-power-regulator-australia/
223 /// compiled on Arduino 1.6.5 and the ESP8266 support 2.0 installed with Board Manager.
224 /// CAUTION: do not use pin 11 for IO with this chip: it will cause the sketch to hang. Instead
225 /// use constructor arguments to configure different pins, eg:
226 /// \code
227 /// RH_ASK driver(2000, 2, 4, 5);
228 /// \endcode
229 /// Which will initialise the driver at 2000 bps, recieve on GPIO2, transmit on GPIO4, PTT on GPIO5.
230 /// Caution: on the tronixlabs breakout board, pins 4 and 5 may be labelled vice-versa.
231 ///
232 /// \par Timers
233 /// The RH_ASK driver uses a timer-driven interrupt to generate 8 interrupts per bit period. RH_ASK
234 /// takes over a timer on Arduino-like platforms. By default it takes over Timer 1. You can force it
235 /// to use Timer 2 instead by enabling the define RH_ASK_ARDUINO_USE_TIMER2 near the top of RH_ASK.cpp
236 /// On Arduino Zero it takes over timer TC3. On Arduino Due it takes over timer
237 /// TC0. On ESP8266, takes over timer0 (which conflicts with ServoTimer0).
238 ///
239 /// Caution: ATTiny85 has only 2 timers, one (timer 0) usually used for
240 /// millis() and one (timer 1) for PWM analog outputs. The RH_ASK Driver
241 /// library, when built for ATTiny85, takes over timer 0, which prevents use
242 /// of millis() etc but does permit analog outputs. This will affect the accuracy of millis() and time
243 /// measurement.
244 class RH_ASK : public RHGenericDriver
245 {
246 public:
247  /// Constructor.
248  /// At present only one instance of RH_ASK per sketch is supported.
249  /// \param[in] speed The desired bit rate in bits per second
250  /// \param[in] rxPin The pin that is used to get data from the receiver
251  /// \param[in] txPin The pin that is used to send data to the transmitter
252  /// \param[in] pttPin The pin that is connected to the transmitter controller. It will be set HIGH to enable the transmitter (unless pttInverted is true).
253  /// \param[in] pttInverted true if you desire the pttin to be inverted so that LOW wil enable the transmitter.
254  RH_ASK(uint16_t speed = 2000, uint8_t rxPin = 11, uint8_t txPin = 12, uint8_t pttPin = 10, bool pttInverted = false);
255 
256  /// Initialise the Driver transport hardware and software.
257  /// Make sure the Driver is properly configured before calling init().
258  /// \return true if initialisation succeeded.
259  virtual bool init();
260 
261  /// Tests whether a new message is available
262  /// from the Driver.
263  /// On most drivers, this will also put the Driver into RHModeRx mode until
264  /// a message is actually received bythe transport, when it wil be returned to RHModeIdle.
265  /// This can be called multiple times in a timeout loop
266  /// \return true if a new, complete, error-free uncollected message is available to be retreived by recv()
267  virtual bool available();
268 
269  /// Turns the receiver on if it not already on.
270  /// If there is a valid message available, copy it to buf and return true
271  /// else return false.
272  /// If a message is copied, *len is set to the length (Caution, 0 length messages are permitted).
273  /// You should be sure to call this function frequently enough to not miss any messages
274  /// It is recommended that you call it in your main loop.
275  /// \param[in] buf Location to copy the received message
276  /// \param[in,out] len Pointer to available space in buf. Set to the actual number of octets copied.
277  /// \return true if a valid message was copied to buf
278  virtual bool recv(uint8_t* buf, uint8_t* len);
279 
280  /// Waits until any previous transmit packet is finished being transmitted with waitPacketSent().
281  /// Then loads a message into the transmitter and starts the transmitter. Note that a message length
282  /// of 0 is NOT permitted.
283  /// \param[in] data Array of data to be sent
284  /// \param[in] len Number of bytes of data to send (> 0)
285  /// \return true if the message length was valid and it was correctly queued for transmit
286  virtual bool send(const uint8_t* data, uint8_t len);
287 
288  /// Returns the maximum message length
289  /// available in this Driver.
290  /// \return The maximum legal message length
291  virtual uint8_t maxMessageLength();
292 
293  /// If current mode is Rx or Tx changes it to Idle. If the transmitter or receiver is running,
294  /// disables them.
295  void setModeIdle();
296 
297  /// If current mode is Tx or Idle, changes it to Rx.
298  /// Starts the receiver in the RF69.
299  void setModeRx();
300 
301  /// If current mode is Rx or Idle, changes it to Rx. F
302  /// Starts the transmitter in the RF69.
303  void setModeTx();
304 
305  /// dont call this it used by the interrupt handler
306  void handleTimerInterrupt();
307 
308  /// Returns the current speed in bits per second
309  /// \return The current speed in bits per second
310  uint16_t speed() { return _speed;}
311 
312 #if (RH_PLATFORM == RH_PLATFORM_ESP8266)
313  /// ESP8266 timer0 increment value
314  uint32_t _timerIncrement;
315 #endif
316 
317 protected:
318  /// Helper function for calculating timer ticks
319  uint8_t timerCalc(uint16_t speed, uint16_t max_ticks, uint16_t *nticks);
320 
321  /// Set up the timer and its interrutps so the interrupt handler is called at the right frequency
322  void timerSetup();
323 
324  /// Read the rxPin in a platform dependent way, taking into account whether it is inverted or not
325  bool readRx();
326 
327  /// Write the txPin in a platform dependent way
328  void writeTx(bool value);
329 
330  /// Write the txPin in a platform dependent way, taking into account whether it is inverted or not
331  void writePtt(bool value);
332 
333  /// Translates a 6 bit symbol to its 4 bit plaintext equivalent
334  uint8_t symbol_6to4(uint8_t symbol);
335 
336  /// The receiver handler function, called a 8 times the bit rate
337  void receiveTimer();
338 
339  /// The transmitter handler function, called a 8 times the bit rate
340  void transmitTimer();
341 
342  /// Check whether the latest received message is complete and uncorrupted
343  /// We should always check the FCS at user level, not interrupt level
344  /// since it is slow
345  void validateRxBuf();
346 
347  /// Configure bit rate in bits per second
348  uint16_t _speed;
349 
350  /// The configure receiver pin
351  uint8_t _rxPin;
352 
353  /// The configure transmitter pin
354  uint8_t _txPin;
355 
356  /// The configured transmitter enable pin
357  uint8_t _pttPin;
358 
359  /// True of the sense of the rxPin is to be inverted
361 
362  /// True of the sense of the pttPin is to be inverted
364 
365  // Used in the interrupt handlers
366  /// Buf is filled but not validated
367  volatile bool _rxBufFull;
368 
369  /// Buf is full and valid
370  volatile bool _rxBufValid;
371 
372  /// Last digital input from the rx data pin
373  volatile bool _rxLastSample;
374 
375  /// This is the integrate and dump integral. If there are <5 0 samples in the PLL cycle
376  /// the bit is declared a 0, else a 1
377  volatile uint8_t _rxIntegrator;
378 
379  /// PLL ramp, varies between 0 and RH_ASK_RX_RAMP_LEN-1 (159) over
380  /// RH_ASK_RX_SAMPLES_PER_BIT (8) samples per nominal bit time.
381  /// When the PLL is synchronised, bit transitions happen at about the
382  /// 0 mark.
383  volatile uint8_t _rxPllRamp;
384 
385  /// Flag indicates if we have seen the start symbol of a new message and are
386  /// in the processes of reading and decoding it
387  volatile uint8_t _rxActive;
388 
389  /// Last 12 bits received, so we can look for the start symbol
390  volatile uint16_t _rxBits;
391 
392  /// How many bits of message we have received. Ranges from 0 to 12
393  volatile uint8_t _rxBitCount;
394 
395  /// The incoming message buffer
396  uint8_t _rxBuf[RH_ASK_MAX_PAYLOAD_LEN];
397 
398  /// The incoming message expected length
399  volatile uint8_t _rxCount;
400 
401  /// The incoming message buffer length received so far
402  volatile uint8_t _rxBufLen;
403 
404  /// Index of the next symbol to send. Ranges from 0 to vw_tx_len
405  uint8_t _txIndex;
406 
407  /// Bit number of next bit to send
408  uint8_t _txBit;
409 
410  /// Sample number for the transmitter. Runs 0 to 7 during one bit interval
411  uint8_t _txSample;
412 
413  /// The transmitter buffer in _symbols_ not data octets
414  uint8_t _txBuf[(RH_ASK_MAX_PAYLOAD_LEN * 2) + RH_ASK_PREAMBLE_LEN];
415 
416  /// Number of symbols in _txBuf to be sent;
417  uint8_t _txBufLen;
418 
419 };
420 
421 /// @example ask_reliable_datagram_client.pde
422 /// @example ask_reliable_datagram_server.pde
423 /// @example ask_transmitter.pde
424 /// @example ask_receiver.pde
425 #endif
uint8_t _txBit
Bit number of next bit to send.
Definition: RH_ASK.h:408
void setModeRx()
Definition: RH_ASK.cpp:410
uint8_t _txSample
Sample number for the transmitter. Runs 0 to 7 during one bit interval.
Definition: RH_ASK.h:411
uint8_t symbol_6to4(uint8_t symbol)
Translates a 6 bit symbol to its 4 bit plaintext equivalent.
Definition: RH_ASK.cpp:677
void writeTx(bool value)
Write the txPin in a platform dependent way.
Definition: RH_ASK.cpp:547
uint8_t timerCalc(uint16_t speed, uint16_t max_ticks, uint16_t *nticks)
Helper function for calculating timer ticks.
Definition: RH_ASK.cpp:104
Driver to send and receive unaddressed, unreliable datagrams via inexpensive ASK (Amplitude Shift Key...
Definition: RH_ASK.h:244
volatile uint16_t _rxBits
Last 12 bits received, so we can look for the start symbol.
Definition: RH_ASK.h:390
void writePtt(bool value)
Write the txPin in a platform dependent way, taking into account whether it is inverted or not...
Definition: RH_ASK.cpp:557
virtual bool recv(uint8_t *buf, uint8_t *len)
Definition: RH_ASK.cpp:451
void transmitTimer()
The transmitter handler function, called a 8 times the bit rate.
Definition: RH_ASK.cpp:813
void setModeIdle()
Definition: RH_ASK.cpp:399
virtual uint8_t maxMessageLength()
Definition: RH_ASK.cpp:570
Abstract base class for a RadioHead driver.
Definition: RHGenericDriver.h:41
void handleTimerInterrupt()
dont call this it used by the interrupt handler
Definition: RH_ASK.cpp:841
volatile uint8_t _rxBufLen
The incoming message buffer length received so far.
Definition: RH_ASK.h:402
volatile uint8_t _rxActive
Definition: RH_ASK.h:387
uint8_t _txPin
The configure transmitter pin.
Definition: RH_ASK.h:354
volatile bool _rxBufFull
Buf is filled but not validated.
Definition: RH_ASK.h:367
void validateRxBuf()
Definition: RH_ASK.cpp:696
volatile bool _rxBufValid
Buf is full and valid.
Definition: RH_ASK.h:370
void timerSetup()
Set up the timer and its interrutps so the interrupt handler is called at the right frequency...
Definition: RH_ASK.cpp:156
volatile uint8_t _rxIntegrator
Definition: RH_ASK.h:377
uint16_t _speed
Configure bit rate in bits per second.
Definition: RH_ASK.h:348
uint8_t _rxBuf[RH_ASK_MAX_PAYLOAD_LEN]
The incoming message buffer.
Definition: RH_ASK.h:396
bool readRx()
Read the rxPin in a platform dependent way, taking into account whether it is inverted or not...
Definition: RH_ASK.cpp:535
virtual bool send(const uint8_t *data, uint8_t len)
Definition: RH_ASK.cpp:471
volatile uint8_t _rxBitCount
How many bits of message we have received. Ranges from 0 to 12.
Definition: RH_ASK.h:393
volatile uint8_t _rxPllRamp
Definition: RH_ASK.h:383
RH_ASK(uint16_t speed=2000, uint8_t rxPin=11, uint8_t txPin=12, uint8_t pttPin=10, bool pttInverted=false)
Definition: RH_ASK.cpp:44
volatile bool _rxLastSample
Last digital input from the rx data pin.
Definition: RH_ASK.h:373
uint8_t _pttPin
The configured transmitter enable pin.
Definition: RH_ASK.h:357
uint16_t speed()
Definition: RH_ASK.h:310
virtual bool available()
Definition: RH_ASK.cpp:438
uint8_t _rxPin
The configure receiver pin.
Definition: RH_ASK.h:351
volatile uint8_t _rxCount
The incoming message expected length.
Definition: RH_ASK.h:399
uint8_t _txBuf[(RH_ASK_MAX_PAYLOAD_LEN *2)+RH_ASK_PREAMBLE_LEN]
The transmitter buffer in symbols not data octets.
Definition: RH_ASK.h:414
bool _rxInverted
True of the sense of the rxPin is to be inverted.
Definition: RH_ASK.h:360
uint8_t _txIndex
Index of the next symbol to send. Ranges from 0 to vw_tx_len.
Definition: RH_ASK.h:405
void receiveTimer()
The receiver handler function, called a 8 times the bit rate.
Definition: RH_ASK.cpp:724
virtual bool init()
Definition: RH_ASK.cpp:60
void setModeTx()
Definition: RH_ASK.cpp:421
bool _pttInverted
True of the sense of the pttPin is to be inverted.
Definition: RH_ASK.h:363
uint8_t _txBufLen
Number of symbols in _txBuf to be sent;.
Definition: RH_ASK.h:417