RadioHead
RH_ASK.h
1 // RH_ASK.h
2 //
3 // Copyright (C) 2014 Mike McCauley
4 // $Id: RH_ASK.h,v 1.16 2016/07/07 00:02:53 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 /// // #include <SPI.h> // comment this out, not needed
195 /// RH_ASK driver(2000, 4, 3); // 200bps, TX on D3 (pin 2), RX on D4 (pin 3)
196 /// then:
197 /// Connect D3 (pin 2) as the output to the transmitter
198 /// Connect D4 (pin 3) as the input from the receiver.
199 ///
200 ///
201 /// For testing purposes you can connect 2 Arduino RH_ASK instances directly, by
202 /// connecting pin 12 of one to 11 of the other and vice versa, like this for a duplex connection:
203 ///
204 /// \code
205 /// Arduino 1 wires Arduino 1
206 /// D11-----------------------------D12
207 /// D12-----------------------------D11
208 /// GND-----------------------------GND
209 /// \endcode
210 ///
211 /// You can also connect 2 RH_ASK instances over a suitable analog
212 /// transmitter/receiver, such as the audio channel of an A/V transmitter/receiver. You may need
213 /// buffers at each end of the connection to convert the 0-5V digital output to a suitable analog voltage.
214 ///
215 /// Measured power output from RFM85 at 5V was 18dBm.
216 ///
217 /// \par ESP8266
218 /// This module has been tested with the ESP8266 using an ESP-12 on a breakout board
219 /// ESP-12E SMD Adaptor Board with Power Regulator from tronixlabs
220 /// http://tronixlabs.com.au/wireless/esp8266/esp8266-esp-12e-smd-adaptor-board-with-power-regulator-australia/
221 /// compiled on Arduino 1.6.5 and the ESP8266 support 2.0 installed with Board Manager.
222 /// CAUTION: do not use pin 11 for IO with this chip: it will cause the sketch to hang. Instead
223 /// use constructor arguments to configure different pins, eg:
224 /// \code
225 /// RH_ASK driver(2000, 2, 4, 5);
226 /// \endcode
227 /// Which will initialise the driver at 2000 bps, recieve on GPIO2, transmit on GPIO4, PTT on GPIO5.
228 /// Caution: on the tronixlabs breakout board, pins 4 and 5 may be labelled vice-versa.
229 ///
230 /// \par Timers
231 /// The RH_ASK driver uses a timer-driven interrupt to generate 8 interrupts per bit period. RH_ASK
232 /// takes over a timer on Arduino-like platforms. By default it takes over Timer 1. You can force it
233 /// to use Timer 2 instead by enabling the define RH_ASK_ARDUINO_USE_TIMER2 near the top of RH_ASK.cpp
234 /// On Arduino Zero it takes over timer TC3. On Arduino Due it takes over timer
235 /// TC0. On ESP8266, takes over timer0 (which conflicts with ServoTimer0).
236 ///
237 /// Caution: ATTiny85 has only 2 timers, one (timer 0) usually used for
238 /// millis() and one (timer 1) for PWM analog outputs. The RH_ASK Driver
239 /// library, when built for ATTiny85, takes over timer 0, which prevents use
240 /// of millis() etc but does permit analog outputs. This will affect the accuracy of millis() and time
241 /// measurement.
242 class RH_ASK : public RHGenericDriver
243 {
244 public:
245  /// Constructor.
246  /// At present only one instance of RH_ASK per sketch is supported.
247  /// \param[in] speed The desired bit rate in bits per second
248  /// \param[in] rxPin The pin that is used to get data from the receiver
249  /// \param[in] txPin The pin that is used to send data to the transmitter
250  /// \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).
251  /// \param[in] pttInverted true if you desire the pttin to be inverted so that LOW wil enable the transmitter.
252  RH_ASK(uint16_t speed = 2000, uint8_t rxPin = 11, uint8_t txPin = 12, uint8_t pttPin = 10, bool pttInverted = false);
253 
254  /// Initialise the Driver transport hardware and software.
255  /// Make sure the Driver is properly configured before calling init().
256  /// \return true if initialisation succeeded.
257  virtual bool init();
258 
259  /// Tests whether a new message is available
260  /// from the Driver.
261  /// On most drivers, this will also put the Driver into RHModeRx mode until
262  /// a message is actually received bythe transport, when it wil be returned to RHModeIdle.
263  /// This can be called multiple times in a timeout loop
264  /// \return true if a new, complete, error-free uncollected message is available to be retreived by recv()
265  virtual bool available();
266 
267  /// Turns the receiver on if it not already on.
268  /// If there is a valid message available, copy it to buf and return true
269  /// else return false.
270  /// If a message is copied, *len is set to the length (Caution, 0 length messages are permitted).
271  /// You should be sure to call this function frequently enough to not miss any messages
272  /// It is recommended that you call it in your main loop.
273  /// \param[in] buf Location to copy the received message
274  /// \param[in,out] len Pointer to available space in buf. Set to the actual number of octets copied.
275  /// \return true if a valid message was copied to buf
276  virtual bool recv(uint8_t* buf, uint8_t* len);
277 
278  /// Waits until any previous transmit packet is finished being transmitted with waitPacketSent().
279  /// Then loads a message into the transmitter and starts the transmitter. Note that a message length
280  /// of 0 is NOT permitted.
281  /// \param[in] data Array of data to be sent
282  /// \param[in] len Number of bytes of data to send (> 0)
283  /// \return true if the message length was valid and it was correctly queued for transmit
284  virtual bool send(const uint8_t* data, uint8_t len);
285 
286  /// Returns the maximum message length
287  /// available in this Driver.
288  /// \return The maximum legal message length
289  virtual uint8_t maxMessageLength();
290 
291  /// If current mode is Rx or Tx changes it to Idle. If the transmitter or receiver is running,
292  /// disables them.
293  void setModeIdle();
294 
295  /// If current mode is Tx or Idle, changes it to Rx.
296  /// Starts the receiver in the RF69.
297  void setModeRx();
298 
299  /// If current mode is Rx or Idle, changes it to Rx. F
300  /// Starts the transmitter in the RF69.
301  void setModeTx();
302 
303  /// dont call this it used by the interrupt handler
304  void handleTimerInterrupt();
305 
306  /// Returns the current speed in bits per second
307  /// \return The current speed in bits per second
308  uint16_t speed() { return _speed;}
309 
310 #if (RH_PLATFORM == RH_PLATFORM_ESP8266)
311  /// ESP8266 timer0 increment value
312  uint32_t _timerIncrement;
313 #endif
314 
315 protected:
316  /// Helper function for calculating timer ticks
317  uint8_t timerCalc(uint16_t speed, uint16_t max_ticks, uint16_t *nticks);
318 
319  /// Set up the timer and its interrutps so the interrupt handler is called at the right frequency
320  void timerSetup();
321 
322  /// Read the rxPin in a platform dependent way, taking into account whether it is inverted or not
323  bool readRx();
324 
325  /// Write the txPin in a platform dependent way
326  void writeTx(bool value);
327 
328  /// Write the txPin in a platform dependent way, taking into account whether it is inverted or not
329  void writePtt(bool value);
330 
331  /// Translates a 6 bit symbol to its 4 bit plaintext equivalent
332  uint8_t symbol_6to4(uint8_t symbol);
333 
334  /// The receiver handler function, called a 8 times the bit rate
335  void receiveTimer();
336 
337  /// The transmitter handler function, called a 8 times the bit rate
338  void transmitTimer();
339 
340  /// Check whether the latest received message is complete and uncorrupted
341  /// We should always check the FCS at user level, not interrupt level
342  /// since it is slow
343  void validateRxBuf();
344 
345  /// Configure bit rate in bits per second
346  uint16_t _speed;
347 
348  /// The configure receiver pin
349  uint8_t _rxPin;
350 
351  /// The configure transmitter pin
352  uint8_t _txPin;
353 
354  /// The configured transmitter enable pin
355  uint8_t _pttPin;
356 
357  /// True of the sense of the rxPin is to be inverted
359 
360  /// True of the sense of the pttPin is to be inverted
362 
363  // Used in the interrupt handlers
364  /// Buf is filled but not validated
365  volatile bool _rxBufFull;
366 
367  /// Buf is full and valid
368  volatile bool _rxBufValid;
369 
370  /// Last digital input from the rx data pin
371  volatile bool _rxLastSample;
372 
373  /// This is the integrate and dump integral. If there are <5 0 samples in the PLL cycle
374  /// the bit is declared a 0, else a 1
375  volatile uint8_t _rxIntegrator;
376 
377  /// PLL ramp, varies between 0 and RH_ASK_RX_RAMP_LEN-1 (159) over
378  /// RH_ASK_RX_SAMPLES_PER_BIT (8) samples per nominal bit time.
379  /// When the PLL is synchronised, bit transitions happen at about the
380  /// 0 mark.
381  volatile uint8_t _rxPllRamp;
382 
383  /// Flag indicates if we have seen the start symbol of a new message and are
384  /// in the processes of reading and decoding it
385  volatile uint8_t _rxActive;
386 
387  /// Last 12 bits received, so we can look for the start symbol
388  volatile uint16_t _rxBits;
389 
390  /// How many bits of message we have received. Ranges from 0 to 12
391  volatile uint8_t _rxBitCount;
392 
393  /// The incoming message buffer
394  uint8_t _rxBuf[RH_ASK_MAX_PAYLOAD_LEN];
395 
396  /// The incoming message expected length
397  volatile uint8_t _rxCount;
398 
399  /// The incoming message buffer length received so far
400  volatile uint8_t _rxBufLen;
401 
402  /// Index of the next symbol to send. Ranges from 0 to vw_tx_len
403  uint8_t _txIndex;
404 
405  /// Bit number of next bit to send
406  uint8_t _txBit;
407 
408  /// Sample number for the transmitter. Runs 0 to 7 during one bit interval
409  uint8_t _txSample;
410 
411  /// The transmitter buffer in _symbols_ not data octets
412  uint8_t _txBuf[(RH_ASK_MAX_PAYLOAD_LEN * 2) + RH_ASK_PREAMBLE_LEN];
413 
414  /// Number of symbols in _txBuf to be sent;
415  uint8_t _txBufLen;
416 
417 };
418 
419 /// @example ask_reliable_datagram_client.pde
420 /// @example ask_reliable_datagram_server.pde
421 /// @example ask_transmitter.pde
422 /// @example ask_receiver.pde
423 #endif
uint8_t _txBit
Bit number of next bit to send.
Definition: RH_ASK.h:406
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:409
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:242
volatile uint16_t _rxBits
Last 12 bits received, so we can look for the start symbol.
Definition: RH_ASK.h:388
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:400
volatile uint8_t _rxActive
Definition: RH_ASK.h:385
uint8_t _txPin
The configure transmitter pin.
Definition: RH_ASK.h:352
volatile bool _rxBufFull
Buf is filled but not validated.
Definition: RH_ASK.h:365
void validateRxBuf()
Definition: RH_ASK.cpp:696
volatile bool _rxBufValid
Buf is full and valid.
Definition: RH_ASK.h:368
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:375
uint16_t _speed
Configure bit rate in bits per second.
Definition: RH_ASK.h:346
uint8_t _rxBuf[RH_ASK_MAX_PAYLOAD_LEN]
The incoming message buffer.
Definition: RH_ASK.h:394
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:391
volatile uint8_t _rxPllRamp
Definition: RH_ASK.h:381
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:371
uint8_t _pttPin
The configured transmitter enable pin.
Definition: RH_ASK.h:355
uint16_t speed()
Definition: RH_ASK.h:308
virtual bool available()
Definition: RH_ASK.cpp:438
uint8_t _rxPin
The configure receiver pin.
Definition: RH_ASK.h:349
volatile uint8_t _rxCount
The incoming message expected length.
Definition: RH_ASK.h:397
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:412
bool _rxInverted
True of the sense of the rxPin is to be inverted.
Definition: RH_ASK.h:358
uint8_t _txIndex
Index of the next symbol to send. Ranges from 0 to vw_tx_len.
Definition: RH_ASK.h:403
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:361
uint8_t _txBufLen
Number of symbols in _txBuf to be sent;.
Definition: RH_ASK.h:415