|
| | CC1101 (Module *module) |
| | Default constructor.
|
| int16_t | begin (const ConfigFSK_t &config) |
| | Initialization method for FSK modem.
|
| int16_t | beginFSK4 (const ConfigFSK_t &config) |
| | Initialization method for 4-FSK modem.
|
|
void | reset () |
| | Reset method - resets the chip using manual reset sequence (without RESET pin).
|
| int16_t | transmit (const uint8_t *data, size_t len, uint8_t addr=0) override |
| | Blocking binary transmit method. Overloads for string-based transmissions are implemented in PhysicalLayer.
|
| int16_t | receive (uint8_t *data, size_t len, RadioLibTime_t timeout=0) override |
| | Blocking binary receive method. Overloads for string-based transmissions are implemented in PhysicalLayer.
|
| int16_t | standby () override |
| | Sets the module to standby mode.
|
| int16_t | standby (uint8_t mode) override |
| | Sets the module to standby.
|
| int16_t | sleep () override |
| | Sets the module to sleep mode.
|
| int16_t | transmitDirect (uint32_t frf=0) override |
| | Starts synchronous direct mode transmission.
|
| int16_t | receiveDirect () override |
| | Starts synchronous direct mode reception.
|
| int16_t | transmitDirectAsync (uint32_t frf=0) |
| | Starts asynchronous direct mode transmission.
|
| int16_t | receiveDirectAsync () |
| | Starts asynchronous direct mode reception.
|
|
int16_t | packetMode () |
| | Stops direct mode. It is required to call this method to switch from direct transmissions to packet-based transmissions.
|
| void | setGdo0Action (void(*func)(void), uint32_t dir) |
| | Sets interrupt service routine to call when GDO0 activates.
|
|
void | clearGdo0Action () |
| | Clears interrupt service routine to call when GDO0 activates.
|
| void | setGdo2Action (void(*func)(void), uint32_t dir) |
| | Sets interrupt service routine to call when GDO2 activates.
|
|
void | clearGdo2Action () |
| | Clears interrupt service routine to call when GDO0 activates.
|
| int16_t | startTransmit (const uint8_t *data, size_t len, uint8_t addr=0) override |
| | Interrupt-driven binary transmit method for packets less than 64 bytes. Method blocks for packets longer than 64 bytes up to a 255 byte limit, until the last bytes are placed in the FIFO. Some limitations and issues apply; see discussion: https://github.com/jgromes/RadioLib/discussions/1138 Overloads for string-based transmissions are implemented in PhysicalLayer.
|
| int16_t | finishTransmit () override |
| | Clean up after transmission is done.
|
| int16_t | startReceive () override |
| | Interrupt-driven receive method. GDO0 will be activated when full packet is received.
|
| int16_t | startReceive (uint32_t timeout, uint32_t irqFlags, uint32_t irqMask, size_t len) override |
| | Interrupt-driven receive method, implemented for compatibility with PhysicalLayer.
|
| int16_t | readData (uint8_t *data, size_t len) override |
| | Reads data received after calling startReceive method. When the packet length is not known in advance, getPacketLength method must be called BEFORE calling readData!
|
| int16_t | finishReceive () override |
| | Clean up after reception is done.
|
| int16_t | setFrequency (uint32_t freq) override |
| | Sets carrier frequency. Allowed values are in bands 300 to 348 MHz, 387 to 464 MHz and 779 to 928 MHz.
|
| int16_t | setBitRate (uint32_t br) override |
| | Sets bit rate. Allowed values range from 25 bps to 600 kbps.
|
| int16_t | setBitRateTolerance (uint8_t brt) |
| | Sets bit rate tolerance in BSCFG register. Allowed values are 0:(0%), 1(3,125%), 2:(6,25%) and 3:(12,5%).
|
| int16_t | setRxBandwidth (uint32_t rxBw) |
| | Sets receiver bandwidth. Allowed values are 58, 68, 81, 102, 116, 135, 162, 203, 232, 270, 325, 406, 464, 541, 650 and 812 kHz.
|
| int16_t | autoSetRxBandwidth () |
| | calculates and sets Rx bandwidth based on the freq, baud and freq uncertainty. Reimplement of atlas0fd00m's (RfCat) CalculatePktChanBw function. Modified for worse ppm with the CC1101, and adjusted for the supportted CC1101 bw.
|
| int16_t | setFrequencyDeviation (uint32_t freqDev) override |
| | Sets frequency deviation. Allowed values range from 1.587 to 380.8 kHz.
|
| int16_t | getFrequencyDeviation (uint32_t *freqDev) |
| | Gets frequency deviation.
|
| int16_t | setOutputPower (int8_t pwr) override |
| | Sets output power. Allowed values are -30, -20, -15, -10, 0, 5, 7 or 10 dBm.
|
| int16_t | setSyncWord (uint8_t *sync, size_t len) override |
| | Set 1 or 2 bytes of sync word.
|
| int16_t | setSyncWord (uint8_t syncH, uint8_t syncL, uint8_t maxErrBits=0, bool requireCarrierSense=false, bool repeatSync=false) |
| | Sets 16-bit sync word as a two byte value.
|
| int16_t | setSyncWord (const uint8_t *syncWord, uint8_t len, uint8_t maxErrBits=0, bool requireCarrierSense=false, bool repeatSync=false) |
| | Sets 1 or 2 bytes of sync word.
|
| int16_t | setPreambleLength (size_t preambleLength, size_t qualityThreshold=0xFFFFFFFF) override |
| | Sets preamble length.
|
| int16_t | enableRxAfterTx (bool enable=true) |
| | Enables/disables automatic switch to reception after transmission. Uses the TXOFF_RX mode of CC1101.
|
| int16_t | setNodeAddress (uint8_t nodeAddr, uint8_t numBroadcastAddrs=0) |
| | Sets node and broadcast addresses. Calling this method will also enable address filtering.
|
| int16_t | disableAddressFiltering () |
| | Disables address filtering. Calling this method will also erase previously set addresses.
|
| int16_t | setOOK (bool enableOOK) |
| | Enables/disables OOK modulation instead of FSK.
|
| float | getRSSI () override |
| | Gets RSSI (Received Signal Strength Indicator) of the last received packet. In direct or asynchronous direct mode, returns the current RSSI level.
|
| uint8_t | getLQI () const |
| | Gets LQI (Link Quality Indicator) of the last received packet.
|
| size_t | getPacketLength (bool update=true) override |
| | Query modem for the packet length of received payload.
|
| int16_t | fixedPacketLengthMode (uint8_t len=RADIOLIB_CC1101_MAX_PACKET_LENGTH) |
| | Set modem in fixed packet length mode.
|
| int16_t | variablePacketLengthMode (uint8_t maxLen=RADIOLIB_CC1101_MAX_PACKET_LENGTH) |
| | Set modem in variable packet length mode.
|
| int16_t | enableSyncWordFiltering (uint8_t maxErrBits=0, bool requireCarrierSense=false, bool repeatSync=false) |
| | Enable sync word filtering and generation.
|
| int16_t | disableSyncWordFiltering (bool requireCarrierSense=false) |
| | Disable preamble and sync word filtering and generation.
|
| int16_t | setCrcFiltering (bool enable=true) |
| | Enable CRC filtering and generation. The CRC used by CC1101 is 16 bits long, uses polynomial 0x8005, initial value 0xFFFF and disabled inversion.
|
| int16_t | setPromiscuousMode (bool enable=true, bool requireCarrierSense=false) |
| | Set modem in "sniff" mode: no packet filtering (e.g., no preamble, sync word, address, CRC).
|
| bool | getPromiscuousMode () |
| | Get whether the modem is in promiscuous mode: no packet filtering (e.g., no preamble, sync word, address, CRC).
|
| int16_t | setDataShaping (uint8_t sh) override |
| | Sets Gaussian filter bandwidth-time product that will be used for data shaping. Allowed value is RADIOLIB_SHAPING_0_5. Set to RADIOLIB_SHAPING_NONE to disable data shaping.
|
| int16_t | setEncoding (uint8_t encoding) override |
| | Sets transmission encoding. Allowed values are RADIOLIB_ENCODING_NRZ, RADIOLIB_ENCODING_MANCHESTER, and RADIOLIB_ENCODING_WHITENING. Note that encoding on CC1101 is applied to the entire stream including preamble, sync word, and CRC.
|
| void | setRfSwitchPins (uint32_t rxEn, uint32_t txEn) |
| | Some modules contain external RF switch controlled by pins. This function gives RadioLib control over those pins to automatically switch between various modes: When idle both pins will be LOW, during TX the txEn pin will be HIGH, during RX the rxPin will be HIGH.
|
| void | setRfSwitchTable (const uint32_t(&pins)[Module::RFSWITCH_MAX_PINS], const Module::RfSwitchMode_t table[]) |
| | Some modules contain external RF switch controlled by pins. This function gives RadioLib control over those pins to automatically switch between various modes.
|
| uint8_t | randomByte () override |
| | Get one truly random byte from RSSI noise.
|
| int16_t | getChipVersion () |
| | Read version SPI register. Should return CC1101_VERSION_LEGACY (0x04) or CC1101_VERSION_CURRENT (0x14) if CC1101 is connected and working.
|
| void | setDirectAction (void(*func)(void)) override |
| | Set interrupt service routine function to call when data bit is receveid in direct mode.
|
| void | readBit (uint32_t pin) override |
| | Function to read and process data bit in direct reception mode.
|
| int16_t | setDIOMapping (uint32_t pin, uint32_t value) |
| | Configure DIO pin mapping to get a given signal on a DIO pin (if available).
|
| int16_t | transmit (const char *str, uint8_t addr=0) |
| | C-string transmit method.
|
| int16_t | startTransmit (const char *str, uint8_t addr=0) |
| | Interrupt-driven Arduino String transmit method. Unlike the standard transmit method, this one is non-blocking. Interrupt pin will be activated when transmission finishes.
|
|
| PhysicalLayer () |
| | Default constructor.
|
|
virtual | ~PhysicalLayer ()=default |
| | Default destructor.
|
| int16_t | transmit (const char *str, uint8_t addr=0) |
| | C-string transmit method.
|
| int16_t | startTransmit (const char *str, uint8_t addr=0) |
| | Interrupt-driven Arduino String transmit method. Unlike the standard transmit method, this one is non-blocking. Interrupt pin will be activated when transmission finishes.
|
| virtual int16_t | setSpreadingFactor (uint8_t sf) |
| | Sets LoRa spreading factor. Must be implemented in module class.
|
| virtual int16_t | setBandwidth (uint32_t bw) |
| | Sets LoRa bandwidth. Must be implemented in module class.
|
| virtual int16_t | setCodingRate (uint8_t cr, bool longInterleave=false) |
| | Sets LoRa coding rate denominator. Must be implemented in module class.
|
| virtual int16_t | setLrFhssConfig (uint8_t bw, uint8_t cr, bool narrowGrid, uint8_t hdrCount=3, uint16_t hopSeed=0x13A) |
| | Sets LR-FHSS configuration. Must be implemented in module class.
|
| virtual int16_t | invertIQ (bool enable) |
| | Set IQ inversion. Must be implemented in module class if the module supports it.
|
| int16_t | setOutputPowerOffset (int8_t offset) |
| | Sets offset of the output power. Useful for devices where the radio has an external power amplifier, or of the RF system has a known loss between the radio and the antenna. NOTE: This method must be called BEFORE any calls to radio.begin() or radio.setOutputPower() for the offset to be applied!
|
| int16_t | setOutputPowerOffset (const int8_t *lut, size_t steps) |
| | Sets offset of the output power. Useful for devices where the radio has an external power amplifier, or of the RF system has a known loss between the radio and the antenna. This overload allows to compensate a non-linear PA gain, dependant on the radio power output via a lookup table. NOTE: This method must be called BEFORE any calls to radio.begin() or radio.setOutputPower() for the offset to be applied!
|
| virtual int16_t | setDataRate (DataRate_t dr, ModemType_t modem=RADIOLIB_MODEM_NONE) |
| | Set data rate. Must be implemented in module class if the module supports it.
|
| virtual int16_t | checkDataRate (DataRate_t dr, ModemType_t modem=RADIOLIB_MODEM_NONE) |
| | Check the data rate can be configured by this module. Must be implemented in module class if the module supports it.
|
| virtual float | getSNR () |
| | Gets SNR (Signal to Noise Ratio) of the last received packet. Only available for LoRa modem.
|
| virtual RadioLibTime_t | calculateTimeOnAir (ModemType_t modem, DataRate_t dr, PacketConfig_t pc, size_t len) |
| | Calculate the expected time-on-air for a given modem, data rate, packet configuration and payload size.
|
| virtual RadioLibTime_t | getTimeOnAir (size_t len) |
| | Get expected time-on-air for a given size of payload.
|
| virtual RadioLibTime_t | calculateRxTimeout (RadioLibTime_t timeoutUs) |
| | Calculate the timeout value for this specific module / series (in number of symbols or units of time).
|
| uint32_t | getIrqMapped (RadioLibIrqFlags_t irq) |
| | Convert from radio-agnostic IRQ flags to radio-specific flags.
|
| int16_t | checkIrq (RadioLibIrqType_t irq) |
| | Check whether a specific IRQ bit is set (e.g. RxTimeout, CadDone).
|
| int16_t | setIrq (RadioLibIrqFlags_t irq) |
| | Set interrupt on specific IRQ bit(s) (e.g. RxTimeout, CadDone). Keep in mind that not all radio modules support all RADIOLIB_IRQ_ flags!
|
| int16_t | clearIrq (RadioLibIrqFlags_t irq) |
| | Clear interrupt on a specific IRQ bit (e.g. RxTimeout, CadDone). Keep in mind that not all radio modules support all RADIOLIB_IRQ_ flags!
|
| virtual uint32_t | getIrqFlags () |
| | Read currently active IRQ flags. Must be implemented in module class.
|
| virtual int16_t | setIrqFlags (uint32_t irq) |
| | Set interrupt on DIO1 to be sent on a specific IRQ bit (e.g. RxTimeout, CadDone). Must be implemented in module class.
|
| virtual int16_t | clearIrqFlags (uint32_t irq) |
| | Clear interrupt on a specific IRQ bit (e.g. RxTimeout, CadDone). Must be implemented in module class.
|
| virtual int16_t | startChannelScan () |
| | Interrupt-driven channel activity detection method. Interrupt will be activated when packet is detected. Must be implemented in module class.
|
| virtual int16_t | startChannelScan (const ChannelScanConfig_t &config) |
| | Interrupt-driven channel activity detection method. interrupt will be activated when packet is detected. Must be implemented in module class.
|
| virtual int16_t | getChannelScanResult () |
| | Read the channel scan result.
|
| virtual int16_t | scanChannel () |
| | Check whether the current communication channel is free or occupied. Performs CAD for LoRa modules, or RSSI measurement for FSK modules.
|
| virtual int16_t | scanChannel (const ChannelScanConfig_t &config) |
| | Check whether the current communication channel is free or occupied. Performs CAD for LoRa modules, or RSSI measurement for FSK modules.
|
| int32_t | random (int32_t max) |
| | Get truly random number in range 0 - max.
|
| int32_t | random (int32_t min, int32_t max) |
| | Get truly random number in range min - max.
|
| int16_t | startDirect () |
| | Configure module parameters for direct modes. Must be called prior to "ham" modes like RTTY or AX.25. Only available in FSK mode.
|
| int16_t | setDirectSyncWord (uint32_t syncWord, uint8_t len) |
| | Set sync word to be used to determine start of packet in direct reception mode.
|
| int16_t | available () |
| | Get the number of direct mode bytes currently available in buffer.
|
|
void | dropSync () |
| | Forcefully drop synchronization.
|
| uint8_t | read (bool drop=true) |
| | Get data from direct mode buffer.
|
| virtual void | setIrqAction (void(*func)(void), bool rising=true) |
| | Sets interrupt service routine to call when IRQ is activated.
|
|
virtual void | clearIrqAction () |
| | Clears interrupt service routine to call when IRQ is activated.
|
| virtual int16_t | setModem (ModemType_t modem) |
| | Set modem for the radio to use. Will perform full reset and reconfigure the radio using its default parameters.
|
| virtual int16_t | getModem (ModemType_t *modem) |
| | Get modem currently in use by the radio.
|
| virtual int16_t | getMode (RadioModeType_t *mode) |
| | Read the operating mode the radio is in, as the chip reports it. Unlike PhysicalLayer::stagedMode, which is what was last asked of the radio, this reads the hardware, so a caller can tell a radio that has left a mode on its own - a receive that did not survive a frame, or a chip that lost its state - from one that is still in it.
|
| virtual int16_t | stageMode (RadioModeType_t mode, RadioModeConfig_t *cfg) |
| | Stage mode of the radio to be launched later using launchMode.
|
| virtual int16_t | launchMode () |
| | Launch previously staged mode.
|
| virtual int16_t | writeTxBuffer (const uint8_t *data, size_t len) |
| | Write a payload into the transmit buffer without staging or starting a transmission. This allows the payload write, which is the slowest part of starting a transmission, to be done while the radio is busy with something else - during a channel scan, for example. The transmission is staged afterwards by calling stageMode with RADIOLIB_RADIO_MODE_TX and RadioModeConfig_t::transmit.data set to NULL, which sets the packet parameters and the IRQ mapping for the payload already in the buffer; transmit.len must still be set to its length. The buffer holds exactly this payload after the call, whether or not one was written before.
|
| virtual int16_t | clearTxBuffer () |
| | Discard a payload previously written by writeTxBuffer. On radios whose transmit buffer is simply overwritten by the next write there is nothing to discard, and this reports success without touching the radio.
|
| int16_t | calculateRxDutyCycle (size_t txPreLen, size_t rxPreLen, uint16_t minSymbols, DataRate_t *dr, uint32_t *wakePeriod, uint32_t *sleepPeriod) |
| | Calculates sleep and wake cycles for startReceiveDutyCycle methods so that the receiver should not miss any messages. Useful only for LoRa modems.
|
| int8_t | getOutputPowerMin () const |
| | Get the minimum output power supported by the radio. This includes any previously configured PA offset.
|
| int8_t | getOutputPowerMax () const |
| | Get the maximum output power supported by the radio. This includes any previously configured PA offset.
|