Driver library for SX1272/SX1276 transceivers
Dependents: LORA_RX LORA_TX WindConcentrator hid_test ... more
Driver library for SX1272 and SX1276 radio transceivers.
This device uses CSS modulation to provide much improved link budget. The RF hardware is same as in FSK devices, just with added LoRa spread-spectrum modem.
This library provides functions to configure radio chip and transmit & receive packets.
Using This Library
Library function service_radio()
must be called continuously from main loop, to service interrupts from radio.
Board Specific implementation
FunctionPointer for rf_switch
callback allows the program to implement control of RF switch unique to their board.
Example options are:
- SKY13373 for external power amplifier implementation. Requires two DigitalOut pins.
- SKY13350 using PA_BOOST. requires two DigitalOut pins.
- PE4259-63: controlled directly by radio chip, no software function needed. However, in the case of SX1276MB1xAS, the RXTX pin on IO2 should be driven by this callback function when R16 is installed (without R15) on this shield board.
Some configurations may need to force the use of RFO or PA_BOOST, or a board could offer both options. The rf_switch
function pointer callback should support the implementation choice on the board.
further reading
- LoRa modulation basics (dropbox PDF)
- OpenLoRa forum
Diff: sx127x_fsk.cpp
- Revision:
- 12:bda42457c34a
- Parent:
- 8:c9592cbc9f86
- Child:
- 21:b4ba73b59bb4
--- a/sx127x_fsk.cpp Tue Mar 17 20:06:45 2015 +0000 +++ b/sx127x_fsk.cpp Mon Apr 13 23:00:14 2015 +0000 @@ -41,17 +41,18 @@ m_xcvr.m_cs = 1; } -void SX127x_fsk::enable() +void SX127x_fsk::enable(bool fast) { m_xcvr.set_opmode(RF_OPMODE_SLEEP); m_xcvr.RegOpMode.bits.LongRangeMode = 0; m_xcvr.write_reg(REG_OPMODE, m_xcvr.RegOpMode.octet); - wait(0.01); + if (fast) + return; RegPktConfig1.octet = m_xcvr.read_reg(REG_FSK_PACKETCONFIG1); RegPktConfig2.word = m_xcvr.read_u16(REG_FSK_PACKETCONFIG2); - RegRxConfig.octet = m_xcvr.read_u16(REG_FSK_RXCONFIG); + RegRxConfig.octet = m_xcvr.read_reg(REG_FSK_RXCONFIG); RegPreambleDetect.octet = m_xcvr.read_reg(REG_FSK_PREAMBLEDETECT); RegSyncConfig.octet = m_xcvr.read_reg(REG_FSK_SYNCCONFIG); RegFifoThreshold.octet = m_xcvr.read_reg(REG_FSK_FIFOTHRESH);