RF22
|
Send and receive unaddressed, unreliable datagrams. More...
#include <RF22.h>
Classes | |
struct | ModemConfig |
Defines register values for a set of modem configuration registers. More... | |
Public Types | |
enum | ModemConfigChoice { UnmodulatedCarrier = 0, FSK_PN9_Rb2Fd5, FSK_Rb2Fd5, FSK_Rb2_4Fd36, FSK_Rb4_8Fd45, FSK_Rb9_6Fd45, FSK_Rb19_2Fd9_6, FSK_Rb38_4Fd19_6, FSK_Rb57_6Fd28_8, FSK_Rb125Fd125, FSK_Rb_512Fd2_5, FSK_Rb_512Fd4_5, GFSK_Rb2Fd5, GFSK_Rb2_4Fd36, GFSK_Rb4_8Fd45, GFSK_Rb9_6Fd45, GFSK_Rb19_2Fd9_6, GFSK_Rb38_4Fd19_6, GFSK_Rb57_6Fd28_8, GFSK_Rb125Fd125, OOK_Rb1_2Bw75, OOK_Rb2_4Bw335, OOK_Rb4_8Bw335, OOK_Rb9_6Bw335, OOK_Rb19_2Bw335, OOK_Rb38_4Bw335, OOK_Rb40Bw335 } |
enum | CRCPolynomial { CRC_CCITT = 0, CRC_16_IBM = 1, CRC_IEC_16 = 2, CRC_Biacheva = 3 } |
Defines the available choices for CRC Types of permitted CRC polynomials, to be passed to setCRCPolynomial() They deliberately have the same numeric values as the crc[1:0] field of Register RF22_REG_30_DATA_ACCESS_CONTROL. More... | |
Public Member Functions | |
RF22 (uint8_t slaveSelectPin=SS, uint8_t interrupt=0, GenericSPIClass *spi=&Hardware_spi) | |
boolean | init () |
void | reset () |
uint8_t | spiRead (uint8_t reg) |
void | spiWrite (uint8_t reg, uint8_t val) |
void | spiBurstRead (uint8_t reg, uint8_t *dest, uint8_t len) |
void | spiBurstWrite (uint8_t reg, const uint8_t *src, uint8_t len) |
uint8_t | statusRead () |
uint8_t | adcRead (uint8_t adcsel=RF22_ADCSEL_INTERNAL_TEMPERATURE_SENSOR, uint8_t adcref=RF22_ADCREF_BANDGAP_VOLTAGE, uint8_t adcgain=0, uint8_t adcoffs=0) |
uint8_t | temperatureRead (uint8_t tsrange=RF22_TSRANGE_M64_64C, uint8_t tvoffs=0) |
uint16_t | wutRead () |
void | setWutPeriod (uint16_t wtm, uint8_t wtr=0, uint8_t wtd=0) |
boolean | setFrequency (float centre, float afcPullInRange=0.05) |
boolean | setFHStepSize (uint8_t fhs) |
boolean | setFHChannel (uint8_t fhch) |
uint8_t | rssiRead () |
uint8_t | ezmacStatusRead () |
void | setMode (uint8_t mode) |
void | setModeIdle () |
void | setModeRx () |
void | setModeTx () |
uint8_t | mode () |
void | setTxPower (uint8_t power) |
void | setModemRegisters (const ModemConfig *config) |
boolean | setModemConfig (ModemConfigChoice index) |
boolean | available () |
void | waitAvailable () |
bool | waitAvailableTimeout (uint16_t timeout) |
boolean | recv (uint8_t *buf, uint8_t *len) |
boolean | send (const uint8_t *data, uint8_t len) |
void | waitPacketSent () |
bool | waitPacketSent (uint16_t timeout) |
void | setPromiscuous (boolean promiscuous) |
uint8_t | headerTo () |
uint8_t | headerFrom () |
uint8_t | headerId () |
uint8_t | headerFlags () |
uint8_t | lastRssi () |
void | setPreambleLength (uint8_t nibbles) |
void | setSyncWords (const uint8_t *syncWords, uint8_t len) |
boolean | setCRCPolynomial (CRCPolynomial polynomial) |
Static Public Member Functions | |
static void | printBuffer (const char *prompt, const uint8_t *buf, uint8_t len) |
Protected Member Functions | |
void | handleInterrupt () |
void | clearRxBuf () |
void | clearTxBuf () |
boolean | fillTxBuf (const uint8_t *data, uint8_t len) |
boolean | appendTxBuf (const uint8_t *data, uint8_t len) |
void | sendNextFragment () |
void | readNextFragment () |
void | resetFifos () |
void | resetRxFifo () |
void | resetTxFifo () |
virtual void | handleExternalInterrupt () |
virtual void | handleWakeupTimerInterrupt () |
void | setHeaderTo (uint8_t to) |
void | setHeaderFrom (uint8_t from) |
void | setHeaderId (uint8_t id) |
void | setHeaderFlags (uint8_t flags) |
void | startTransmit () |
void | restartTransmit () |
Static Protected Member Functions | |
static void | isr0 () |
Low level interrupt service routine for RF22 connected to interrupt 0. | |
static void | isr1 () |
Low level interrupt service routine for RF22 connected to interrupt 1. | |
static void | isr2 () |
Low level interrupt service routine for RF22 connected to interrupt 1. | |
Protected Attributes | |
GenericSPIClass * | _spi |
volatile uint8_t | _mode |
uint8_t | _idleMode |
uint8_t | _slaveSelectPin |
uint8_t | _interrupt |
uint8_t | _deviceType |
CRCPolynomial | _polynomial |
volatile uint8_t | _bufLen |
uint8_t | _buf [RF22_MAX_MESSAGE_LEN] |
volatile boolean | _rxBufValid |
volatile uint8_t | _txBufSentIndex |
volatile uint16_t | _rxBad |
volatile uint16_t | _rxGood |
volatile uint16_t | _txGood |
volatile uint8_t | _lastRssi |
Static Protected Attributes | |
static RF22 * | _RF22ForInterrupt [] = {0, 0, 0} |
Array of instances connected to interrupts 0 and 1. | |
Send and receive unaddressed, unreliable datagrams.
This base class provides basic functions for sending and receiving unaddressed, unreliable datagrams of arbitrary length to 255 octets per packet.
Subclasses may use this class to implement reliable, addressed datagrams and streams, mesh routers, repeaters, translators etc.
On transmission, the TO and FROM addresses default to 0x00, unless changed by a subclass. On reception the TO addressed is checked against the node address (defaults to 0x00) or the broadcast address (which is 0xff). The ID and FLAGS are set to 0, and not checked by this class. This permits use of the this base RF22 class as an unaddresed, unreliable datagram service. Subclasses are expected to change this behaviour to add node address, ids, retransmission etc
Naturally, for any 2 radios to communicate that must be configured to use the same frequence and modulation scheme.
enum RF22::CRCPolynomial |
Defines the available choices for CRC Types of permitted CRC polynomials, to be passed to setCRCPolynomial() They deliberately have the same numeric values as the crc[1:0] field of Register RF22_REG_30_DATA_ACCESS_CONTROL.
Enumerator | |
---|---|
CRC_CCITT |
CCITT. |
CRC_16_IBM |
CRC-16 (IBM) The default used by RF22 library. |
CRC_IEC_16 |
IEC-16. |
CRC_Biacheva |
Biacheva. |
Choices for setModemConfig() for a selected subset of common modulation types, and data rates. If you need another configuration, use the register calculator. and call setModemRegisters() with your desired settings These are indexes into MODEM_CONFIG_TABLE
RF22::RF22 | ( | uint8_t | slaveSelectPin = SS , |
uint8_t | interrupt = 0 , |
||
GenericSPIClass * | spi = &Hardware_spi |
||
) |
Constructor. You can have multiple instances, but each instance must have its own interrupt and slave select pin. After constructing, you must call init() to initialise the intnerface and the radio module
[in] | slaveSelectPin | the Arduino pin number of the output to use to select the RF22 before accessing it. Defaults to the normal SS pin for your Arduino (D10 for Diecimila, Uno etc, D53 for Mega) |
[in] | interrupt | The interrupt number to use. 0 - 2. Default is interrupt 0 (Arduino input pin 2) |
[in] | spi | Pointer to the SPI interface object to use. Defaults to the standard Arduino hardware SPI interface |
References CRC_16_IBM.
uint8_t RF22::adcRead | ( | uint8_t | adcsel = RF22_ADCSEL_INTERNAL_TEMPERATURE_SENSOR , |
uint8_t | adcref = RF22_ADCREF_BANDGAP_VOLTAGE , |
||
uint8_t | adcgain = 0 , |
||
uint8_t | adcoffs = 0 |
||
) |
Reads a value from the on-chip analog-digital converter
[in] | adcsel | Selects the ADC input to measure. One of RF22_ADCSEL_*. Defaults to the internal temperature sensor |
[in] | adcref | Specifies the refernce voltage to use. One of RF22_ADCREF_*. Defaults to the internal bandgap voltage. |
[in] | adcgain | Amplifier gain selection. |
[in] | adcoffs | Amplifier offseet (0 to 15). |
References spiRead(), and spiWrite().
Referenced by temperatureRead().
|
protected |
Appends the transmitter buffer with the data of a mesage to be sent
[in] | data | Array of data bytes to be sent (0 to 255) |
[in] | len | Number of data bytes in data |
Referenced by fillTxBuf().
boolean RF22::available | ( | ) |
Starts the receiver and checks whether a received message is available. This can be called multiple times in a timeout loop
References setModeRx().
Referenced by recv(), RF22ReliableDatagram::recvfromAck(), RF22ReliableDatagram::sendtoWait(), waitAvailable(), and waitAvailableTimeout().
|
protected |
Clears the receiver buffer. Internal use only
Referenced by handleInterrupt(), init(), recv(), and RF22ReliableDatagram::sendtoWait().
|
protected |
Clears the transmitter buffer Internal use only
Referenced by fillTxBuf(), and init().
uint8_t RF22::ezmacStatusRead | ( | ) |
Reads and returns the current EZMAC value from register RF22_REG_31_EZMAC_STATUS
References spiRead().
|
protected |
Fills the transmitter buffer with the data of a mesage to be sent
[in] | data | Array of data bytes to be sent (1 to 255) |
[in] | len | Number of data bytes in data (> 0) |
References appendTxBuf(), and clearTxBuf().
Referenced by send().
|
protectedvirtual |
This function will be called by handleInterrupt() if an RF22 external interrupt occurs. This can only happen if external interrupts are enabled in the RF22 (which they are not by default). Subclasses may override this function to get control when an RF22 external interrupt occurs.
Referenced by handleInterrupt().
|
protected |
This is a low level function to handle the interrupts for one instance of RF22. Called automatically by isr0() and isr1() Should not need to be called.
References clearRxBuf(), handleExternalInterrupt(), handleWakeupTimerInterrupt(), readNextFragment(), resetFifos(), resetRxFifo(), restartTransmit(), sendNextFragment(), setModeRx(), spiBurstRead(), and spiRead().
|
protectedvirtual |
This function will be called by handleInterrupt() if an RF22 wakeup timer interrupt occurs. This can only happen if wakeup timer interrupts are enabled in the RF22 (which they are not by default). Subclasses may override this function to get control when an RF22 wakeup timer interrupt occurs.
Referenced by handleInterrupt().
uint8_t RF22::headerFlags | ( | ) |
Returns the FLAGS header of the last received message
References spiRead().
Referenced by RF22Datagram::recvfrom(), and RF22ReliableDatagram::sendtoWait().
uint8_t RF22::headerFrom | ( | ) |
Returns the FROM header of the last received message
References spiRead().
Referenced by RF22Mesh::doArp(), RF22Mesh::peekAtMessage(), RF22Datagram::recvfrom(), RF22Mesh::recvfromAck(), RF22Mesh::route(), and RF22ReliableDatagram::sendtoWait().
uint8_t RF22::headerId | ( | ) |
Returns the ID header of the last received message
References spiRead().
Referenced by RF22Datagram::recvfrom(), and RF22ReliableDatagram::sendtoWait().
uint8_t RF22::headerTo | ( | ) |
Returns the TO header of the last received message
References spiRead().
Referenced by RF22Datagram::recvfrom(), and RF22ReliableDatagram::sendtoWait().
boolean RF22::init | ( | ) |
Initialises this instance and the radio module connected to it. The following steps are taken:
References _RF22ForInterrupt, GenericSPIClass::begin(), clearRxBuf(), clearTxBuf(), FSK_Rb2_4Fd36, isr0(), isr1(), isr2(), reset(), GenericSPIClass::setBitOrder(), GenericSPIClass::setClockDivider(), GenericSPIClass::setDataMode(), setFrequency(), setHeaderFlags(), setHeaderFrom(), setHeaderId(), setHeaderTo(), setModemConfig(), setPreambleLength(), setPromiscuous(), setSyncWords(), setTxPower(), spiRead(), and spiWrite().
Referenced by RF22Datagram::init().
uint8_t RF22::lastRssi | ( | ) |
Returns the RSSI (Receiver Signal Strength Indicator) of the last received message. This measurement is taken when the preamble has been received. It is a (non-linear) measure of the received signal strength.
uint8_t RF22::mode | ( | ) |
Returns the operating mode of the library.
|
static |
Prints a data buffer in HEX. For diagnostic use
[in] | prompt | string to preface the print |
[in] | buf | Location of the buffer to print |
[in] | len | Length of the buffer in octets. |
|
protected |
function to copy the next fragment from the receiver FIF) into the receiver buffer
References spiBurstRead().
Referenced by handleInterrupt().
boolean RF22::recv | ( | uint8_t * | buf, |
uint8_t * | len | ||
) |
Turns the receiver on if it not already on. If there is a valid message available, copy it to buf and return true else return false. If a message is copied, *len is set to the length (Caution, 0 length messages are permitted). You should be sure to call this function frequently enough to not miss any messages It is recommended that you call it in your main loop.
[in] | buf | Location to copy the received message |
[in,out] | len | Pointer to available space in buf. Set to the actual number of octets copied. |
References available(), and clearRxBuf().
Referenced by RF22Datagram::recvfrom().
void RF22::reset | ( | ) |
Issues a software reset to the RF22 module. Blocks for 1ms to ensure the reset is complete.
References spiWrite().
Referenced by init().
|
protected |
Clears the RF22 Rx and Tx FIFOs Internal use only
References spiWrite().
Referenced by handleInterrupt().
|
protected |
Clears the RF22 Rx FIFO Internal use only
References spiWrite().
Referenced by handleInterrupt(), and setModeTx().
|
protected |
Clears the RF22 Tx FIFO Internal use only
References spiWrite().
|
protected |
ReStart the transmission of the contents of the Tx buffer after a atransmission failure
References startTransmit().
Referenced by handleInterrupt().
uint8_t RF22::rssiRead | ( | ) |
Reads and returns the current RSSI value from register RF22_REG_26_RSSI. If you want to find the RSSI of the last received message, use lastRssi() instead.
References spiRead().
boolean RF22::send | ( | const uint8_t * | data, |
uint8_t | len | ||
) |
Waits until any previous transmit packet is finished being transmitted with waitPacketSent(). Then loads a message into the transmitter and starts the transmitter. Note that a message length of 0 is NOT permitted.
[in] | data | Array of data to be sent |
[in] | len | Number of bytes of data to send (> 0) |
References fillTxBuf(), startTransmit(), and waitPacketSent().
Referenced by RF22Datagram::sendto().
|
protected |
Internal function to load the next fragment of the current message into the transmitter FIFO Internal use only
References spiBurstWrite().
Referenced by handleInterrupt(), and startTransmit().
boolean RF22::setCRCPolynomial | ( | CRCPolynomial | polynomial | ) |
Sets the CRC polynomial top be used to generare the CRC for both receive and transmit Must be called before init(), otherwise the default of CRC_16_IBM will be used.
[in] | polynomial | One of RF22::CRCPolynomial choices CRC_* |
References CRC_Biacheva, and CRC_CCITT.
boolean RF22::setFHChannel | ( | uint8_t | fhch | ) |
Sets the frequncy hopping channel. Adds fhch * fhs to centre frequency
[in] | fhch | The channel number |
References spiWrite(), and statusRead().
boolean RF22::setFHStepSize | ( | uint8_t | fhs | ) |
Sets the frequency hopping step size.
[in] | fhs | Frequency Hopping step size in 10kHz increments |
References spiWrite(), and statusRead().
boolean RF22::setFrequency | ( | float | centre, |
float | afcPullInRange = 0.05 |
||
) |
Sets the transmitter and receiver centre frequency
[in] | centre | Frequency in MHz. 240.0 to 960.0. Caution, some versions of RF22 and derivatives implemented more restricted frequency ranges. |
[in] | afcPullInRange | Sets the AF Pull In Range in MHz. Defaults to 0.05MHz (50kHz). Range is 0.0 to 0.159375 for frequencies 240.0 to 480MHz, and 0.0 to 0.318750MHz for frequencies 480.0 to 960MHz, |
References spiWrite(), and statusRead().
Referenced by init().
|
protected |
Sets the FLAGS header to be sent in all subsequent messages
[in] | flags | The new FLAGS header value |
References spiWrite().
Referenced by RF22ReliableDatagram::acknowledge(), init(), and RF22ReliableDatagram::sendtoWait().
|
protected |
Sets the FROM header to be sent in all subsequent messages
[in] | from | The new FROM header value |
References spiWrite().
Referenced by init(), and RF22Datagram::setThisAddress().
|
protected |
Sets the ID header to be sent in all subsequent messages
[in] | id | The new ID header value |
References spiWrite().
Referenced by RF22ReliableDatagram::acknowledge(), init(), and RF22ReliableDatagram::sendtoWait().
|
protected |
Sets the TO header to be sent in all subsequent messages
[in] | to | The new TO header value |
References spiWrite().
Referenced by init(), and RF22Datagram::sendto().
void RF22::setMode | ( | uint8_t | mode | ) |
Sets the parameters for the RF22 Idle mode in register RF22_REG_07_OPERATING_MODE. Idle mode is the mode the RF22 will be in when not transmitting or receiving. The default idle mode is RF22_XTON ie READY mode.
[in] | mode | Mask of mode bits, using RF22_SWRES, RF22_ENLBD, RF22_ENWT, RF22_X32KSEL, RF22_PLLON, RF22_XTON. |
References spiWrite().
Referenced by setModeIdle(), setModeRx(), and setModeTx().
void RF22::setModeIdle | ( | ) |
If current mode is Rx or Tx changes it to Idle. If the transmitter or receiver is running, disables them.
References setMode().
boolean RF22::setModemConfig | ( | ModemConfigChoice | index | ) |
Select one of the predefined modem configurations. If you need a modem configuration not provided here, use setModemRegisters() with your own ModemConfig.
[in] | index | The configuration choice. |
References setModemRegisters().
Referenced by init().
void RF22::setModemRegisters | ( | const ModemConfig * | config | ) |
Sets all the registered required to configure the data modem in the RF22, including the data rate, bandwidths etc. You cas use this to configure the modem with custom configuraitons if none of the canned configurations in ModemConfigChoice suit you.
[in] | config | A ModemConfig structure containing values for the modem configuration registers. |
References RF22::ModemConfig::reg_1c, RF22::ModemConfig::reg_1f, RF22::ModemConfig::reg_20, RF22::ModemConfig::reg_2c, RF22::ModemConfig::reg_58, RF22::ModemConfig::reg_69, RF22::ModemConfig::reg_6e, spiBurstWrite(), and spiWrite().
Referenced by setModemConfig().
void RF22::setModeRx | ( | ) |
If current mode is Tx or Idle, changes it to Rx. Starts the receiver in the RF22.
References setMode().
Referenced by available(), and handleInterrupt().
void RF22::setModeTx | ( | ) |
If current mode is Rx or Idle, changes it to Rx. Starts the transmitter in the RF22.
References resetRxFifo(), and setMode().
Referenced by startTransmit().
void RF22::setPreambleLength | ( | uint8_t | nibbles | ) |
Sets the length of the preamble in 4-bit nibbles. Caution: this should be set to the same value on all nodes in your network. Default is 8. Sets the message preamble length in RF22_REG_34_PREAMBLE_LENGTH
[in] | nibbles | Preamble length in nibbles of 4 bits each. |
References spiWrite().
Referenced by init().
void RF22::setPromiscuous | ( | boolean | promiscuous | ) |
Tells the receiver to accept messages with any TO address, not just messages addressed to this node or the broadcast address
[in] | promiscuous | true if you wish to receive messages with any TO address |
References spiWrite().
Referenced by init().
void RF22::setSyncWords | ( | const uint8_t * | syncWords, |
uint8_t | len | ||
) |
Sets the sync words for transmit and receive in registers RF22_REG_36_SYNC_WORD3 to RF22_REG_39_SYNC_WORD0 Caution: SyncWords should be set to the same value on all nodes in your network. Nodes with different SyncWords set will never receive each others messages, so different SyncWords can be used to isolate different networks from each other. Default is { 0x2d, 0xd4 }.
[in] | syncWords | Array of sync words, 1 to 4 octets long |
[in] | len | Number of sync words to set, 1 to 4. |
References spiBurstWrite().
Referenced by init().
void RF22::setTxPower | ( | uint8_t | power | ) |
Sets the transmitter power output level in register RF22_REG_6D_TX_POWER. Be a good neighbour and set the lowest power level you need. After init(), the power will be set to RF22_TXPOW_8DBM. Caution: In some countries you may only select RF22_TXPOW_17DBM if you are also using frequency hopping.
[in] | power | Transmitter power level, one of RF22_TXPOW_* |
References spiWrite().
Referenced by init().
void RF22::setWutPeriod | ( | uint16_t | wtm, |
uint8_t | wtr = 0 , |
||
uint8_t | wtd = 0 |
||
) |
Sets the wakeup timer period registers RF22_REG_14_WAKEUP_TIMER_PERIOD1, RF22_REG_15_WAKEUP_TIMER_PERIOD2 and RF22_R<EG_16_WAKEUP_TIMER_PERIOD3
[in] | wtm | Wakeup timer mantissa value |
[in] | wtr | Wakeup timer exponent R value |
[in] | wtd | Wakeup timer exponent D value |
References spiBurstWrite().
void RF22::spiBurstRead | ( | uint8_t | reg, |
uint8_t * | dest, | ||
uint8_t | len | ||
) |
Reads a number of consecutive registers from the RF22 using burst read mode
[in] | reg | Register number of the first register, one of RF22_REG_* |
[in] | dest | Array to write the register values to. Must be at least len bytes |
[in] | len | Number of bytes to read |
References GenericSPIClass::transfer().
Referenced by handleInterrupt(), readNextFragment(), and wutRead().
void RF22::spiBurstWrite | ( | uint8_t | reg, |
const uint8_t * | src, | ||
uint8_t | len | ||
) |
Write a number of consecutive registers using burst write mode
[in] | reg | Register number of the first register, one of RF22_REG_* |
[in] | src | Array of new register values to write. Must be at least len bytes |
[in] | len | Number of bytes to write |
References GenericSPIClass::transfer().
Referenced by sendNextFragment(), setModemRegisters(), setSyncWords(), and setWutPeriod().
uint8_t RF22::spiRead | ( | uint8_t | reg | ) |
Reads a single register from the RF22
[in] | reg | Register number, one of RF22_REG_* |
References GenericSPIClass::transfer().
Referenced by adcRead(), ezmacStatusRead(), handleInterrupt(), headerFlags(), headerFrom(), headerId(), headerTo(), init(), rssiRead(), and statusRead().
void RF22::spiWrite | ( | uint8_t | reg, |
uint8_t | val | ||
) |
Writes a single byte to the RF22
[in] | reg | Register number, one of RF22_REG_* |
[in] | val | The value to write |
References GenericSPIClass::transfer().
Referenced by adcRead(), init(), reset(), resetFifos(), resetRxFifo(), resetTxFifo(), setFHChannel(), setFHStepSize(), setFrequency(), setHeaderFlags(), setHeaderFrom(), setHeaderId(), setHeaderTo(), setMode(), setModemRegisters(), setPreambleLength(), setPromiscuous(), RF22Datagram::setThisAddress(), setTxPower(), startTransmit(), and temperatureRead().
|
protected |
Start the transmission of the contents of the Tx buffer
References sendNextFragment(), setModeTx(), and spiWrite().
Referenced by restartTransmit(), and send().
uint8_t RF22::statusRead | ( | ) |
Reads and returns the device status register RF22_REG_02_DEVICE_STATUS
References spiRead().
Referenced by setFHChannel(), setFHStepSize(), and setFrequency().
uint8_t RF22::temperatureRead | ( | uint8_t | tsrange = RF22_TSRANGE_M64_64C , |
uint8_t | tvoffs = 0 |
||
) |
Reads the on-chip temperature sensoer
[in] | tsrange | Specifies the temperature range to use. One of RF22_TSRANGE_* |
[in] | tvoffs | Specifies the temperature value offset. This is actually signed value added to the measured temperature value |
References adcRead(), and spiWrite().
void RF22::waitAvailable | ( | ) |
Starts the receiver and blocks until a valid received message is available.
References available().
bool RF22::waitAvailableTimeout | ( | uint16_t | timeout | ) |
Starts the receiver and blocks until a received message is available or a timeout
[in] | timeout | Maximum time to wait in milliseconds. |
References available().
void RF22::waitPacketSent | ( | ) |
Blocks until the RF22 is not in mode RF22_MODE_TX (ie until the RF22 is not transmitting). This effectively waits until any previous transmit packet is finished being transmitted.
Referenced by RF22ReliableDatagram::acknowledge(), send(), and RF22ReliableDatagram::sendtoWait().
bool RF22::waitPacketSent | ( | uint16_t | timeout | ) |
uint16_t RF22::wutRead | ( | ) |
Reads the wakeup timer value in registers RF22_REG_17_WAKEUP_TIMER_VALUE1 and RF22_REG_18_WAKEUP_TIMER_VALUE2
References spiBurstRead().