pyupm_sx1276 module

class pyupm_sx1276.SX1276(*args)[source]

Bases: object

API for the SX1276 LoRa/FSK modem.

ID: sx1276

Name: SX1276 LoRa/FSK Modem

Other Names: SX1277 SX1278 SX1279

Category: wifi

Manufacturer: semtech

Connection: spi gpio

Link:http://www.digikey.com/product- search/en?vendor=0&keywords=SX1276MB1LAS The SX1276 is a FSK/OOK/LoRa modem capable of both Low Frequency and High Frequency communication.

It requires a 3.3v power supply, do not use 5v.

Frequency Hopping Spread Spectrum (FHSS) is not currently supported.

While not all of the functionality of this device is supported initially, methods and register definitions are provided that should allow an end user to implement whatever features are required.

FSK send/receive exampleLORA send/receive example

C++ includes: sx1276.hpp

ADDRESSFILTERING_NODE = 1
ADDRESSFILTERING_NODE_BROADCAST = 2
ADDRESSFILTERING_NONE = 0
AFCFEI_AfcAutoClearOn = 1
AFCFEI_AfcClear = 2
AFCFEI_AgcStart = 16
AGCREF_AgcReferenceLevel0 = 1
AGCREF_AgcReferenceLevel1 = 2
AGCREF_AgcReferenceLevel2 = 4
AGCREF_AgcReferenceLevel3 = 8
AGCREF_AgcReferenceLevel4 = 16
AGCREF_AgcReferenceLevel5 = 32
AGCTHRESH1_AcgStep10 = 1
AGCTHRESH1_AcgStep11 = 2
AGCTHRESH1_AcgStep12 = 4
AGCTHRESH1_AcgStep13 = 8
AGCTHRESH2_AcgStep20 = 16
AGCTHRESH2_AcgStep21 = 32
AGCTHRESH2_AcgStep22 = 64
AGCTHRESH2_AcgStep23 = 128
AGCTHRESH2_AcgStep30 = 1
AGCTHRESH2_AcgStep31 = 2
AGCTHRESH2_AcgStep32 = 4
AGCTHRESH2_AcgStep33 = 8
AGCTHRESH3_AcgStep40 = 16
AGCTHRESH3_AcgStep41 = 32
AGCTHRESH3_AcgStep42 = 64
AGCTHRESH3_AcgStep43 = 128
AGCTHRESH3_AcgStep50 = 1
AGCTHRESH3_AcgStep51 = 2
AGCTHRESH3_AcgStep52 = 4
AGCTHRESH3_AcgStep53 = 8
AUTORESTARTMODE_OFF = 0
AUTORESTARTMODE_ON_NOPLL = 1
AUTORESTARTMODE_ON_PLL = 2
BITRATEFRAC_BitRateFrac0 = 1
BITRATEFRAC_BitRateFrac1 = 2
BITRATEFRAC_BitRateFrac2 = 4
BITRATEFRAC_BitRateFrac3 = 8
BW_10_4 = 1
BW_125 = 7
BW_15_6 = 2
BW_20_8 = 3
BW_250 = 8
BW_31_25 = 4
BW_41_7 = 5
BW_500 = 9
BW_62_5 = 6
BW_7_8 = 0
CLKOUT_1 = 0
CLKOUT_16 = 4
CLKOUT_2 = 1
CLKOUT_32 = 5
CLKOUT_4 = 2
CLKOUT_8 = 3
CLKOUT_OFF = 7
CLKOUT_RC = 6
CODINGRATE_4_5 = 1
CODINGRATE_4_6 = 2
CODINGRATE_4_7 = 3
CODINGRATE_4_8 = 4
COM_RegAgcRef = 97
COM_RegAgcThresh1 = 98
COM_RegAgcThresh2 = 99
COM_RegAgcThresh3 = 100
COM_RegDioMapping1 = 64
COM_RegDioMapping2 = 65
COM_RegFifo = 0
COM_RegFormerTemp = 91
COM_RegFrfLsb = 8
COM_RegFrfMid = 7
COM_RegFrfMsb = 6
COM_RegLna = 12
COM_RegOcp = 11
COM_RegOpMode = 1
COM_RegPaConfig = 9
COM_RegPaDac = 77
COM_RegPaRamp = 10
COM_RegPll = 112
COM_RegTcxo = 75
COM_RegVersion = 66
DCFREE_MANCHESTER = 1
DCFREE_NONE = 0
DCFREE_WHITENING = 2
DETECTIONOPTIMIZE_SF6 = 5
DETECTIONOPTIMIZE_SF7_SF12 = 3
DETECTOPTIMIZE_DetectionOptimize0 = 1
DETECTOPTIMIZE_DetectionOptimize1 = 2
DETECTOPTIMIZE_DetectionOptimize2 = 4
DIOMAPPING_00 = 0
DIOMAPPING_01 = 1
DIOMAPPING_10 = 2
DIOMAPPING_11 = 3
DOIMAPPING1_Dio0Mapping0 = 64
DOIMAPPING1_Dio0Mapping1 = 128
DOIMAPPING1_Dio0Mapping_MASK = 3
DOIMAPPING1_Dio0Mapping_SHIFT = 6
DOIMAPPING1_Dio1Mapping0 = 16
DOIMAPPING1_Dio1Mapping1 = 32
DOIMAPPING1_Dio1Mapping_MASK = 3
DOIMAPPING1_Dio1Mapping_SHIFT = 4
DOIMAPPING1_Dio2Mapping0 = 4
DOIMAPPING1_Dio2Mapping1 = 8
DOIMAPPING1_Dio2Mapping_MASK = 3
DOIMAPPING1_Dio2Mapping_SHIFT = 2
DOIMAPPING1_Dio3Mapping0 = 1
DOIMAPPING1_Dio3Mapping1 = 2
DOIMAPPING1_Dio3Mapping_MASK = 3
DOIMAPPING1_Dio3Mapping_SHIFT = 0
DOIMAPPING2_Dio4Mapping0 = 64
DOIMAPPING2_Dio4Mapping1 = 128
DOIMAPPING2_Dio4Mapping_MASK = 3
DOIMAPPING2_Dio4Mapping_SHIFT = 6
DOIMAPPING2_Dio5Mapping0 = 16
DOIMAPPING2_Dio5Mapping1 = 32
DOIMAPPING2_Dio5Mapping_MASK = 3
DOIMAPPING2_Dio5Mapping_SHIFT = 4
DOIMAPPING2_MapPreambleDetect = 1
FEIMSB_FreqError0 = 1
FEIMSB_FreqError1 = 2
FEIMSB_FreqError2 = 4
FEIMSB_FreqError3 = 8
FIFOTHRESH_FifoThreshold0 = 1
FIFOTHRESH_FifoThreshold1 = 2
FIFOTHRESH_FifoThreshold2 = 4
FIFOTHRESH_FifoThreshold3 = 8
FIFOTHRESH_FifoThreshold4 = 16
FIFOTHRESH_FifoThreshold5 = 32
FIFOTHRESH_TxStartCondition = 128
FIFO_SIZE = 256
FROMPACKETRECEIVED_ToLowPowerSelection = 2
FROMPACKETRECEIVED_ToReceive = 4
FROMPACKETRECEIVED_ToReceiveViaFS = 3
FROMPACKETRECEIVED_ToSequencerOff = 0
FROMPACKETRECEIVED_ToTransmitStateOnFifoEmpty = 1
FROMRECEIVE_ToLowPowerSelection = 2
FROMRECEIVE_ToPacketReceived = 3
FROMRECEIVE_ToPcketReceived = 1
FROMRECEIVE_ToSequencerOffOnPreambleDetect = 6
FROMRECEIVE_ToSequencerOffOnRSSI = 4
FROMRECEIVE_ToSequencerOffOnSync = 5
FROMRXTIMEOUT_ToLowPowerSelection = 2
FROMRXTIMEOUT_ToReceiveViaReceiveStart = 0
FROMRXTIMEOUT_ToSequencerOffState = 3
FROMRXTIMEOUT_ToTransmitState = 1
FROMSTART_ToLowPowerSelection = 0
FROMSTART_ToReceiveState = 1
FROMSTART_ToTransmitState = 2
FROMSTART_ToTransmitStateOnFifoLevel = 3
FSK_RegAfcBw = 19
FSK_RegAfcFei = 26
FSK_RegAfcLsb = 28
FSK_RegAfcMsb = 27
FSK_RegBitRateFrac = 93
FSK_RegBitrateLsb = 3
FSK_RegBitrateMsb = 2
FSK_RegBroadcastAddr = 52
FSK_RegFdevLsb = 5
FSK_RegFdevMsb = 4
FSK_RegFeiLsb = 30
FSK_RegFeiMsb = 29
FSK_RegFifoThresh = 53
FSK_RegImageCal = 59
FSK_RegIrqFlags1 = 62
FSK_RegIrqFlags2 = 63
FSK_RegLowBat = 61
FSK_RegNodeAddr = 51
FSK_RegOokAvg = 22
FSK_RegOokFix = 21
FSK_RegOokPeak = 20
FSK_RegOsc = 36
FSK_RegPacketConfig1 = 48
FSK_RegPacketConfig2 = 49
FSK_RegPayloadLength = 50
FSK_RegPreambleDetect = 31
FSK_RegPreambleLsb = 38
FSK_RegPreambleMsb = 37
FSK_RegRssiCollision = 15
FSK_RegRssiConfg = 14
FSK_RegRssiThresh = 16
FSK_RegRssiValue = 17
FSK_RegRxBw = 18
FSK_RegRxConfig = 13
FSK_RegRxDelay = 35
FSK_RegRxTimeout1 = 32
FSK_RegRxTimeout2 = 33
FSK_RegRxTimeout3 = 34
FSK_RegSeqConfig1 = 54
FSK_RegSeqConfig2 = 55
FSK_RegSyncConfig = 39
FSK_RegSyncValue1 = 40
FSK_RegSyncValue2 = 41
FSK_RegSyncValue3 = 42
FSK_RegSyncValue4 = 43
FSK_RegSyncValue5 = 44
FSK_RegSyncValue6 = 45
FSK_RegSyncValue7 = 46
FSK_RegSyncValue8 = 47
FSK_RegTemp = 60
FSK_RegTimer1Coeff = 57
FSK_RegTimer2Coeff = 58
FSK_RegTimerResol = 56
FSK_Reserved17 = 23
FSK_Reserved18 = 24
FSK_Reserved19 = 25
FSK_Reserved44 = 68
HOPCHANNEL_CrcOnPayload = 64
HOPCHANNEL_FhssPresentChannel0 = 1
HOPCHANNEL_FhssPresentChannel1 = 2
HOPCHANNEL_FhssPresentChannel2 = 4
HOPCHANNEL_FhssPresentChannel3 = 8
HOPCHANNEL_FhssPresentChannel4 = 16
HOPCHANNEL_FhssPresentChannel5 = 32
HOPCHANNEL_PllTimeout = 128
IMAGECAL_AutoImageCalOn = 128
IMAGECAL_ImageCalRunning = 32
IMAGECAL_ImageCalStart = 64
IMAGECAL_TempMonitorOff = 1
IMAGECAL_TempThreshold0 = 2
IMAGECAL_TempThreshold1 = 4
IMAGECAL_TenpChange = 8
INVERTIQ_InvertIQRx = 64
INVERTIQ_InvertIQTxOff = 1
IRQFLAGS1_ModeReady = 128
IRQFLAGS1_PllLock = 16
IRQFLAGS1_PreambleDetect = 2
IRQFLAGS1_Rssi = 8
IRQFLAGS1_RxReady = 64
IRQFLAGS1_SyncAddressMatch = 1
IRQFLAGS1_Timeout = 4
IRQFLAGS1_TxReady = 32
IRQFLAGS2_CrcOk = 2
IRQFLAGS2_FifoEmpty = 64
IRQFLAGS2_FifoFull = 128
IRQFLAGS2_FifoLevel = 32
IRQFLAGS2_FifoOverrun = 16
IRQFLAGS2_LowBat = 1
IRQFLAGS2_PacketSent = 8
IRQFLAGS2_PayloadReady = 4
LNABOOSTHF_BoostOn = 3
LNABOOSTHF_Default = 0
LNABOOSTLF_Default = 0
LNAGAIN_G1 = 1
LNAGAIN_G2 = 2
LNAGAIN_G3 = 3
LNAGAIN_G4 = 4
LNAGAIN_G5 = 5
LNAGAIN_G6 = 6
LNA_LnaBoostHf0 = 1
LNA_LnaBoostHf1 = 2
LNA_LnaBoostLf0 = 8
LNA_LnaBoostLf1 = 16
LNA_LnaGain0 = 32
LNA_LnaGain1 = 64
LNA_LnaGain2 = 128
LOR_DetectionThreshold_SF6 = 12
LOR_DetectionThreshold_SF7_SF12 = 10
LOR_IRQFLAG_CadDetected = 1
LOR_IRQFLAG_CadDone = 4
LOR_IRQFLAG_FhssChangeChannel = 2
LOR_IRQFLAG_PayloadCrcError = 32
LOR_IRQFLAG_RxDone = 64
LOR_IRQFLAG_RxTimeout = 128
LOR_IRQFLAG_TxDone = 8
LOR_IRQFLAG_ValidHeader = 16
LOR_RSSI_OFFSET_HF = -157
LOR_RSSI_OFFSET_LF = -164
LOR_RegDetectOptimize = 49
LOR_RegDetectionThreshold = 55
LOR_RegFeiLsb = 42
LOR_RegFeiMid = 41
LOR_RegFeiMsb = 40
LOR_RegFifoAddrPtr = 13
LOR_RegFifoRxBaseAddr = 15
LOR_RegFifoRxByteAddr = 37
LOR_RegFifoRxCurrentAddr = 16
LOR_RegFifoTxBaseAddr = 14
LOR_RegHopChannel = 28
LOR_RegHopPeriod = 36
LOR_RegInvertIQ = 51
LOR_RegInvertIQ2 = 59
LOR_RegIrqFlags = 18
LOR_RegIrqFlagsMask = 17
LOR_RegMaxPayloadLength = 35
LOR_RegModemConfig1 = 29
LOR_RegModemConfig2 = 30
LOR_RegModemConfig3 = 38
LOR_RegModemStat = 24
LOR_RegPayloadLength = 34
LOR_RegPktRssiValue = 26
LOR_RegPktSnrValue = 25
LOR_RegPllHop = 68
LOR_RegPreambleLsb = 33
LOR_RegPreambleMsb = 32
LOR_RegRssiValue = 27
LOR_RegRssiWideband = 44
LOR_RegRxHeaderCntValueLsb = 21
LOR_RegRxHeaderCntValueMsb = 20
LOR_RegRxNbBytes = 19
LOR_RegRxPacketCntValueLsb = 23
LOR_RegRxPacketCntValueMsb = 22
LOR_RegSymbTimeoutLsb = 31
LOR_RegSyncWord = 57
LOR_Reserved02 = 2
LOR_Reserved03 = 3
LOR_Reserved04 = 4
LOR_Reserved05 = 5
LOR_Reserved27 = 39
LOR_Reserved2b = 43
LOR_Reserved2d = 45
LOR_Reserved2e = 46
LOR_Reserved2f = 47
LOR_Reserved30 = 48
LOR_Reserved32 = 50
LOR_Reserved34 = 52
LOR_Reserved35 = 53
LOR_Reserved36 = 54
LOR_Reserved38 = 56
LOR_Reserved3a = 58
LOR_Reserved3b = 59
LOR_Reserved3c = 60
LOR_Reserved3d = 61
LOR_Reserved3e = 62
LOR_Reserved3f = 63
LOR_Reserved5d = 93
LOWBATTRIM_1_695 = 0
LOWBATTRIM_1_764 = 1
LOWBATTRIM_1_835 = 2
LOWBATTRIM_1_905 = 3
LOWBATTRIM_1_976 = 4
LOWBATTRIM_2_045 = 5
LOWBATTRIM_2_116 = 6
LOWBATTRIM_2_185 = 7
LOWBAT_LowBatOn = 8
LOWBAT_LowBatTrim0 = 1
LOWBAT_LowBatTrim1 = 2
LOWBAT_LowBatTrim2 = 4
MODEMCONFIG1_Bw0 = 16
MODEMCONFIG1_Bw1 = 32
MODEMCONFIG1_Bw2 = 64
MODEMCONFIG1_Bw3 = 128
MODEMCONFIG1_CodingRate0 = 2
MODEMCONFIG1_CodingRate1 = 4
MODEMCONFIG1_CodingRate2 = 8
MODEMCONFIG1_ImplicitHeaderModeOn = 1
MODEMCONFIG2_RxPayloadCrcOn = 4
MODEMCONFIG2_SpreadingFactor0 = 16
MODEMCONFIG2_SpreadingFactor1 = 32
MODEMCONFIG2_SpreadingFactor2 = 64
MODEMCONFIG2_SpreadingFactor3 = 128
MODEMCONFIG2_SymbTimeoutMsb0 = 1
MODEMCONFIG2_SymbTimeoutMsb1 = 2
MODEMCONFIG2_TxContinuousMode = 8
MODEMCONFIG3_AgcAutoOn = 4
MODEMCONFIG3_LowDataRateOptimize = 8
MODEMSTAT_HeaderInfoValid = 8
MODEMSTAT_ModemClear = 16
MODEMSTAT_RxCodingRate0 = 32
MODEMSTAT_RxCodingRate1 = 64
MODEMSTAT_RxCodingRate2 = 128
MODEMSTAT_RxOngoing = 4
MODEMSTAT_SignalDetected = 1
MODEMSTAT_SignalSynchronized = 2
MODEM_FSK = 1
MODEM_LORA = 0
MODE_FSK_Reserved6 = 6
MODE_FSK_Reserved7 = 7
MODE_FSK_RxMode = 5
MODE_FSRX = 4
MODE_FSTX = 2
MODE_LOR_CAD = 7
MODE_LOR_RxContinuous = 5
MODE_LOR_RxSingle = 6
MODE_Sleep = 0
MODE_Standby = 1
MODE_TxMode = 3
MODSHAPING_FSK_GaussianFilterBT03 = 3
MODSHAPING_FSK_GaussianFilterBT05 = 2
MODSHAPING_FSK_GaussianFilterBT1 = 1
MODSHAPING_NOSHAPING = 0
MODSHAPING_OOK_FCutoffBitRate = 1
MODSHAPING_OOK_FCutoffBitRate2 = 2
MODULATION_FSK = 0
MODULATION_OOK = 1
OCP_OcpOn = 16
OCP_OcpTrim0 = 1
OCP_OcpTrim1 = 2
OCP_OcpTrim2 = 4
OCP_OcpTrim3 = 8
OOKAVGOFFSET_0 = 0
OOKAVGOFFSET_2 = 1
OOKAVGOFFSET_4 = 2
OOKAVGOFFSET_6 = 3
OOKAVGTHRESHFILT_2 = 3
OOKAVGTHRESHFILT_32 = 0
OOKAVGTHRESHFILT_4 = 2
OOKAVGTHRESHFILT_8 = 1
OOKAVG_OokAvgOffset0 = 4
OOKAVG_OokAvgOffset1 = 8
OOKAVG_OokAvgThreshFilt0 = 1
OOKAVG_OokAvgThreshFilt1 = 2
OOKAVG_OokPeakThreshDec0 = 32
OOKAVG_OokPeakThreshDec1 = 64
OOKAVG_OokPeakThreshDec2 = 128
OOKPEAKTHRESHDEC_16_1 = 7
OOKPEAKTHRESHDEC_1_1 = 0
OOKPEAKTHRESHDEC_1_2 = 1
OOKPEAKTHRESHDEC_1_4 = 2
OOKPEAKTHRESHDEC_1_8 = 3
OOKPEAKTHRESHDEC_2_1 = 4
OOKPEAKTHRESHDEC_4_1 = 5
OOKPEAKTHRESHDEC_8_1 = 6
OOKPEAKTHRESHSTEP_05dB = 0
OOKPEAKTHRESHSTEP_15dB = 2
OOKPEAKTHRESHSTEP_1dB = 1
OOKPEAKTHRESHSTEP_2dB = 3
OOKPEAKTHRESHSTEP_3dB = 4
OOKPEAKTHRESHSTEP_4dB = 5
OOKPEAKTHRESHSTEP_5dB = 6
OOKPEAKTHRESHSTEP_6dB = 7
OOKPEAK_BitSyncOn = 32
OOKPEAK_OokPeakThreshStep0 = 1
OOKPEAK_OokPeakThreshStep1 = 2
OOKPEAK_OokPeakThreshStep2 = 4
OOKPEAK_OokThreshType0 = 8
OOKPEAK_OokThreshType1 = 16
OOKTHRESHTYPE_AVERAGE = 2
OOKTHRESHTYPE_FIXED = 0
OOKTHRESHTYPE_PEAK = 1
OPMODE_FSK_ModulationType0 = 32
OPMODE_FSK_ModulationType1 = 64
OPMODE_LOR_AccessSharedReg = 64
OPMODE_LOR_Reserved0x20 = 32
OPMODE_LongRangeMode = 128
OPMODE_LowFrequencyModeOn = 8
OPMODE_Mode0 = 1
OPMODE_Mode1 = 2
OPMODE_Mode2 = 4
OSC_ClkOut0 = 1
OSC_ClkOut1 = 2
OSC_ClkOut2 = 4
OSC_RcCalStart = 8
PACKETCONFIG1_AddressFiltering0 = 2
PACKETCONFIG1_AddressFiltering1 = 4
PACKETCONFIG1_CrcAutoClearOff = 8
PACKETCONFIG1_CrcOn = 16
PACKETCONFIG1_CrcWhiteningType = 1
PACKETCONFIG1_DcFree0 = 32
PACKETCONFIG1_DcFree1 = 64
PACKETCONFIG1_PacketFormat = 128
PACKETCONFIG2_BeaconOn = 8
PACKETCONFIG2_DataMode = 64
PACKETCONFIG2_IoHomeOn = 32
PACKETCONFIG2_PayloadLengthMsb0 = 1
PACKETCONFIG2_PayloadLengthMsb1 = 2
PACKETCONFIG2_PayloadLengthMsb2 = 4
PACONFIG_MaxPower0 = 16
PACONFIG_MaxPower1 = 32
PACONFIG_MaxPower2 = 64
PACONFIG_OutputPower0 = 1
PACONFIG_OutputPower1 = 2
PACONFIG_OutputPower2 = 4
PACONFIG_OutputPower3 = 8
PACONFIG_PaSelect = 128
PADAC_BOOST = 7
PADAC_DEFAULT = 4
PADAC_PaDac0 = 1
PADAC_PaDac1 = 2
PADAC_PaDac2 = 4
PARAMP_100US = 6
PARAMP_10US = 15
PARAMP_125US = 5
PARAMP_12US = 14
PARAMP_15US = 13
PARAMP_1MS = 2
PARAMP_20US = 12
PARAMP_250US = 4
PARAMP_25US = 11
PARAMP_2MS = 1
PARAMP_31US = 10
PARAMP_3_4MS = 0
PARAMP_40US = 9
PARAMP_500US = 3
PARAMP_50US = 8
PARAMP_62US = 7
PARAMP_FSK_ModulationShaping0 = 32
PARAMP_FSK_ModulationShaping1 = 64
PARAMP_PaRamp0 = 1
PARAMP_PaRamp1 = 2
PARAMP_PaRamp2 = 4
PARAMP_PaRamp3 = 8
PLLHOP_FastHopOn = 128
PREABLEDETECT_PreambleDetectorOn = 128
PREABLEDETECT_PreambleDetectorSize0 = 32
PREABLEDETECT_PreambleDetectorSize1 = 64
PREABLEDETECT_PreambleDetectorTol0 = 1
PREABLEDETECT_PreambleDetectorTol1 = 2
PREABLEDETECT_PreambleDetectorTol2 = 4
PREABLEDETECT_PreambleDetectorTol3 = 8
PREABLEDETECT_PreambleDetectorTol4 = 16
PREAMBLEDETECTORSIZE_1 = 0
PREAMBLEDETECTORSIZE_2 = 1
PREAMBLEDETECTORSIZE_3 = 2
REVENT_DONE = 0
REVENT_ERROR = 2
REVENT_EXEC = 1
REVENT_TIMEOUT = 3
RF_MID_BAND_THRESH = 525000000
RSSICONFIG_RssiOffset0 = 8
RSSICONFIG_RssiOffset1 = 16
RSSICONFIG_RssiOffset2 = 32
RSSICONFIG_RssiOffset3 = 64
RSSICONFIG_RssiOffset4 = 128
RSSICONFIG_RssiSmoothing0 = 1
RSSICONFIG_RssiSmoothing1 = 2
RSSICONFIG_RssiSmoothing2 = 4
RSSISMOOTHING_128 = 6
RSSISMOOTHING_16 = 3
RSSISMOOTHING_2 = 0
RSSISMOOTHING_256 = 7
RSSISMOOTHING_32 = 4
RSSISMOOTHING_4 = 1
RSSISMOOTHING_64 = 5
RSSISMOOTHING_8 = 2
RXBWEXP_1 = 1
RXBWEXP_2 = 2
RXBWEXP_3 = 3
RXBWEXP_4 = 4
RXBWEXP_5 = 5
RXBWEXP_6 = 6
RXBWEXP_7 = 7
RXBWMANT_0 = 0
RXBWMANT_1 = 1
RXBWMANT_2 = 2
RXBW_RxBwExp0 = 1
RXBW_RxBwExp1 = 2
RXBW_RxBwExp2 = 4
RXBW_RxBwMant0 = 8
RXBW_RxBwMant1 = 16
RXCONFIG_AfcAutoOn = 16
RXCONFIG_AgcAutoOn = 8
RXCONFIG_RestartRxOnCollision = 128
RXCONFIG_RestartRxWithPllLock = 32
RXCONFIG_RestartRxWithoutPllLock = 64
RXCONFIG_RxTrigger0 = 1
RXCONFIG_RxTrigger1 = 2
RXCONFIG_RxTrigger2 = 4
SEQCONFIG1_FromIdle = 2
SEQCONFIG1_FromStart0 = 8
SEQCONFIG1_FromStart1 = 16
SEQCONFIG1_FromTransit = 1
SEQCONFIG1_IdleMode = 32
SEQCONFIG1_LowPowerSelection = 4
SEQCONFIG1_SequencerStart = 128
SEQCONFIG1_SequencerStop = 64
SEQCONFIG2_FromPacketReceived0 = 1
SEQCONFIG2_FromPacketReceived1 = 2
SEQCONFIG2_FromPacketReceived2 = 4
SEQCONFIG2_FromReceive0 = 32
SEQCONFIG2_FromReceive1 = 64
SEQCONFIG2_FromReceive2 = 128
SEQCONFIG2_FromRxTimeout0 = 8
SEQCONFIG2_FromRxTimeout1 = 16
SPREADINGFACTOR_1024 = 10
SPREADINGFACTOR_128 = 7
SPREADINGFACTOR_2048 = 11
SPREADINGFACTOR_256 = 8
SPREADINGFACTOR_4096 = 12
SPREADINGFACTOR_512 = 9
SPREADINGFACTOR_64 = 6
SYNCCONFIG_AutoRestartMode0 = 64
SYNCCONFIG_AutoRestartMode1 = 128
SYNCCONFIG_PreamblePolarity = 32
SYNCCONFIG_SyncOn = 16
SYNCCONFIG_SyncSize0 = 1
SYNCCONFIG_SyncSize1 = 2
SYNCCONFIG_SyncSize2 = 4
TCXO_TcxoOn = 16
TEMPTHRESHOLD_10C = 1
TEMPTHRESHOLD_15C = 2
TEMPTHRESHOLD_20C = 3
TEMPTHRESHOLD_5C = 0
TIMERRESOLUTION_262ms = 3
TIMERRESOLUTION_4_1ms = 2
TIMERRESOLUTION_64us = 1
TIMERRESOLUTION_DISABLED = 0
TIMERRESOL_Timer1Resolution0 = 4
TIMERRESOL_Timer1Resolution1 = 8
TIMERRESOL_Timer2Resolution0 = 1
TIMERRESOL_Timer2Resolution1 = 2
chipRevision = 18L
getChipVersion()[source]

uint8_t getChipVersion()

return the chip revision

the chip revision (usually 0x12)

getRSSI(modem)[source]

int16_t getRSSI(RADIO_MODEM_T modem)

Return the current Received Signal Strength Indicator for the given modem

modem: One of the MODEM_T values

getRxBuffer()[source]

uint8_t* getRxBuffer()

Upon a successful receive, this method can be used to retrieve the received packet.

a pointer to the received buffer. You can use getRxLen() to determine the number of valid bytes present.

getRxBufferStr()[source]

std::string getRxBufferStr()

Upon a successful receive, this method can be used to retrieve the received packet.

The received buffer in a std::string

getRxLen()[source]

int getRxLen()

Upon a successful receive, this method can be used to retrieve the number of bytes received.

the number of bytes received

getRxRSSI()[source]

int getRxRSSI()

Upon a successful receive, this method can be used to retrieve the received packet’s Received Signal Strength Indicator (RSSI) value.

RSSI value

getRxSNR()[source]

int getRxSNR()

Upon a successful receive, this method can be used to retrieve the received packet’s Signal to Noise (SNR) value.

SNR value

isChannelFree(modem, freq, rssiThresh)[source]

bool isChannelFree(RADIO_MODEM_T modem, uint32_t freq, int16_t rssiThresh)

Check to see if a given channel is free by comparing the RSSI to the supplied threshold.

modem: One of the MODEM_T values

freq: The channel to check

rssiThresh: The RSSI threshold, over which the channel os considerd in use.

readFifo(buffer, len)[source]

void readFifo(uint8_t *buffer, int len)

read the FIFO into a buffer

buffer: The buffer to read data into

len: The length of the buffer

readReg(reg)[source]

uint8_t readReg(uint8_t reg)

read a register

reg: the register to read

the value of the register

reset()[source]

void reset()

reset the modem

send(buffer, size, timeout)[source]

SX1276::RADIO_EVENT_T send(uint8_t *buffer, uint8_t size, int timeout)

Send the supplied buffer. The writes the buffer into the FIFO and places the modem in transmit mode (via setTx()).

buffer: The buffer to send

size: The size of the buffer

timeout: The timeout in milliseconds

one of the RADIO_EVENT_T values

sendStr(buffer, timeout)[source]

SX1276::RADIO_EVENT_T sendStr(std::string buffer, int timeout)

Send the supplied string. This writes the string into the FIFO and places the modem in transmit mode (via setTx()). This is a wrapper around send().

buffer: The buffer to send

timeout: The timeout in milliseconds

one of the RADIO_EVENT_T values

setChannel(freq)[source]

void setChannel(uint32_t freq)

Set the frequency to transmit and receive on

freq: The frequency to set

setModem(modem)[source]

void setModem(RADIO_MODEM_T modem)

Set the modem to access. This can be either the LORA or KSK/OOK modem.

modem: One of the MODEM_T values

setOpMode(opMode)[source]

void setOpMode(MODE_T opMode)

Set the operating mode

opMode: One of the MODE_T values

setRx(timeout)[source]

SX1276::RADIO_EVENT_T setRx(uint32_t timeout)

Start a receive operation. The method will return when completed, either successfully, or in error (crc, or other issue). If completed successfully, the returned buffer can be read via getRxBuffer() or getRxBufferStr(). In addition, values for RSSI and SNR (Lora only) can be retrieved.

timeout: The timeout in milliseconds

one of the RADIO_EVENT_T values

setRxConfig(modem, bandwidth, datarate, coderate, bandwidthAfc, preambleLen, symbTimeout, fixLen, payloadLen, crcOn, freqHopOn, hopPeriod, iqInverted, rxContinuous)[source]

void setRxConfig(RADIO_MODEM_T modem, uint32_t bandwidth, uint32_t datarate, uint8_t coderate, uint32_t bandwidthAfc, uint16_t preambleLen, uint16_t symbTimeout, bool fixLen, uint8_t payloadLen, bool crcOn, bool freqHopOn, uint8_t hopPeriod, bool iqInverted, bool rxContinuous)

Set the receive configuration for a modem. It is important that both the receive and transmit configurations match in order for communication to work between two radios.

modem: One of the MODEM_T values

bandwidth: The bandwidth to use. Valid values are FSK : >= 2600 and <= 250000 Hz LoRa: [125 kHz, 250 kHz, 500 kHz]

datarate: Sets the Datarate FSK : 600..300000 bits/s LoRa: [6: 64, 7: 128, 8: 256, 9: 512, 10: 1024, 11: 2048, 12: 4096 chips]

coderate: Sets the coding rate (LoRa only) FSK : N/A ( set to 0 ) LoRa: [1: 4/5, 2: 4/6, 3: 4/7, 4: 4/8]

bandwidthAfc: Sets the AFC Bandwidth (FSK only) FSK : >= 2600 and <= 250000 Hz LoRa: N/A ( set to 0 )

preambleLen: Sets the Preamble length FSK : Number of bytes LoRa: Length in symbols (the hardware adds 4 more symbols)

symbTimeout: Sets the RxSingle timeout value (LoRa only) FSK : N/A ( set to 0 ) LoRa: timeout in symbols

fixLen: Fixed length packets [false: variable, true: fixed]

payloadLen: Sets payload length when fixed length is used

crcOn: Enables/Disables the CRC [false: OFF, true: ON]

freqHopOn: Enables disables the intra-packet frequency hopping FSK : N/A ( set to 0 ) LoRa: [false: OFF, true: ON]

hopPeriod: Number of symbols bewteen each hop FSK : N/A ( set to 0 ) LoRa: Number of symbols

iqInverted: Inverts IQ signals (LoRa only) FSK : N/A ( set to 0 ) LoRa: [false: not inverted, true: inverted]

rxContinuous: Sets the reception in continuous mode [false: single mode, true: continuous mode]

setSleep()[source]

void setSleep()

Place the SX1276 into sleep mode

setStandby()[source]

void setStandby()

Place the SX1276 into standby mode

setTxConfig(modem, power, fdev, bandwidth, datarate, coderate, preambleLen, fixLen, crcOn, freqHopOn, hopPeriod, iqInverted)[source]

void setTxConfig(RADIO_MODEM_T modem, int8_t power, uint32_t fdev, uint32_t bandwidth, uint32_t datarate, uint8_t coderate, uint16_t preambleLen, bool fixLen, bool crcOn, bool freqHopOn, uint8_t hopPeriod, bool iqInverted)

Set the transmit configuration for a modem. It is important that both the receive and transmit configurations match in order for communication to work between two radios.

modem: One of the MODEM_T values

power: Sets the output power [dBm]

fdev: Sets the frequency deviation (FSK only) FSK : [Hz] LoRa: 0

bandwidth: Sets the bandwidth (LoRa only) FSK : 0 LoRa: [125 kHz, 250 kHz, or 500 kHz]

datarate: Sets the Datarate FSK : 600..300000 bits/s LoRa: [6: 64, 7: 128, 8: 256, 9: 512, 10: 1024, 11: 2048, 12: 4096 chips]

coderate: Sets the coding rate (LoRa only) FSK : N/A ( set to 0 ) LoRa: [1: 4/5, 2: 4/6, 3: 4/7, 4: 4/8]

preambleLen: Sets the preamble length FSK : Number of bytes LoRa: Length in symbols (the hardware adds 4 more symbols)

fixLen: Fixed length packets [false: variable, true: fixed]

crcOn: Enables disables the CRC [false: OFF, true: ON]

freqHopOn: Enables disables the intra-packet frequency hopping FSK : N/A ( set to 0 ) LoRa: [false: OFF, true: ON]

hopPeriod: Number of symbols bewteen each hop FSK : N/A ( set to 0 ) LoRa: Number of symbols

iqInverted: Inverts IQ signals (LoRa only) FSK : N/A ( set to 0 ) LoRa: [false: not inverted, true: inverted]

writeFifo(buffer, len)[source]

void writeFifo(uint8_t *buffer, int len)

write a buffer into the FIFO

buffer: The buffer containing the data to write

len: The length of the buffer

writeReg(reg, val)[source]

bool writeReg(uint8_t reg, uint8_t val)

write to a register

reg: the register to write to

val: the value to write

true if successful, false otherwise