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


RevisionDateWhoCommit message
36:af9b41b1e285 11 months ago Wayne Roberts run on mbed-6 default tip
35:cd54c52c6003 2018-11-25 Wayne Roberts add PA test register address
34:c48ef2fc3ec9 2018-08-10 Wayne Roberts add missing register
33:4b9fd8969428 2018-05-22 Wayne Roberts rename sx127x.h to sx12xx.h to permit drop in replacement with sx126x driver
32:c138a5861ac6 2018-03-19 Wayne Roberts add newline to end of file
31:b66d7a057b22 2017-08-10 dudmuck correct lora rssi offset for sx1272
30:da4ea47f552a 2017-04-21 dudmuck check rf_switch callback is non-null before calling
29:b72ac28d59e9 2017-04-20 dudmuck change FunctionPointer to Callback and fix constructor order
28:207594d5cf0e 2016-08-31 dudmuck FSK modem service: remove check for RX mode, because it runs if not TX
27:da6341d9d5b1 2016-07-28 dudmuck hw_reset working under pullup condition. PLL registers defined. PaRamp register defined. FSK modulation shaping supported. FSK continuous TX mode supporting DIO0 high level.
26:4876e515ff4c 2016-07-18 dudmuck FSK/OOK TX shutdown time corrected on PacketSent event.
25:fa867fb9d2f6 2015-10-22 dudmuck fixed typo
24:cad6e7ce6928 2015-10-22 dudmuck LnaBoostHF defaults to hi-gain, FSK optimzation for preamble detector
23:1df3dddcb43e 2015-10-20 dudmuck added lora function to read background signal strength
22:7e165c16c13c 2015-10-15 dudmuck FSK TX: add small delay to end of transmission
21:b4ba73b59bb4 2015-08-18 dudmuck fsk tx start: read packetConfig1
20:598a2ed046d1 2015-08-14 dudmuck PDSTRIM1 register at different address between sx1272 and sx1276
19:1ee6ef1ab73f 2015-06-02 dudmuck improve frequency error tolerance of sx1276 at 500KHz BW.
18:0ecb6adb7c0b 2015-06-02 dudmuck sx1276 optimization for frequency error with 500KHz bw
17:59279bc8cdab 2015-05-27 dudmuck added support for LoRa inverted spectrum
16:3de8e1c465eb 2015-05-21 dudmuck added lora function to set bandwidth in KHz
15:3f3fc6792f97 2015-05-14 dudmuck added lora function to get frequency error. Added definition for RX invert_IQ.
14:f39b9bf5290f 2015-04-17 dudmuck set_nb_trigs_peaks() made public
13:1953e70522aa 2015-04-17 dudmuck lora start_rx: start receiver sooner.
12:bda42457c34a 2015-04-13 dudmuck fsk.enable: add option for fast mode switch
11:4210303ac88d 2015-03-17 dudmuck added CAD adjustment registers
10:7382c260c4b1 2015-02-27 dudmuck added get_symbol_duration() to determine if LowDataRateOptimize should be used
9:ae1a71ccd730 2015-02-26 dudmuck m_xcvr in modem classes made public
8:c9592cbc9f86 2015-02-18 dudmuck fixed error in setSf() for SX1276
7:927a05f84ede 2015-02-09 dudmuck added rf_switch callback for board-specific RF front-end implementation.
6:5d94ee847016 2014-06-30 dudmuck moved RF switch (femcps/femctx) control to set_opmode()
5:dde68100518b 2014-06-03 dudmuck replaced interrupt input pins with DigitalIn
4:d987ac2836bf 2014-05-02 dudmuck fixed FSK AFC
3:3bf2515b1eed 2014-05-02 dudmuck brought fsk to functioning
2:fdae76e1215e 2014-04-30 dudmuck separated LoRa code from FSK code from common code
1:7dc60eb4c7ec 2014-04-14 dudmuck added read/write functions for USB HID application
0:27aa8733f85d 2014-03-26 dudmuck initial commit of library driver for SX1272/SX1276