Hardware Abstraction Layer, permitting any LoRa application to use any LoRa radio chip
Dependents: alarm_slave alarm_master lora_p2p lorawan1v1 ... more
radio chip selection
Radio chip driver is not included, allowing choice of radio device.
If you're using SX1272 or SX1276, then import sx127x driver into your program.
if you're using SX1261 or SX1262, then import sx126x driver into your program.
if you're using SX1280, then import sx1280 driver into your program.
if you're using LR1110, then import LR1110 driver into your program.
If you're using NAmote72 or Murata discovery, then you must import only sx127x driver.
If you're using Type1SJ select target DISCO_L072CZ_LRWAN1
and import sx126x driver into your program.
Pin assigned to arduino LoRa radio shield form-factor
- SX1272 shield.
- SX1276 shield.
- SX126x kit with color touch screen, or sx126x radio-only shield.
- Exceptions with their own pin assignments: NAMote-72 and Murata discovery board.
- TODO: pin assign XDOT.
Diff: radio.h
- Revision:
- 1:e79b0a55135f
- Parent:
- 0:9c052ff8dd6a
- Child:
- 2:c321b5919516
--- a/radio.h Thu Jul 05 17:31:54 2018 -0700 +++ b/radio.h Mon Jul 16 11:15:59 2018 -0700 @@ -64,6 +64,7 @@ * \param [IN] channelDetected Channel Activity detected during the CAD */ void ( *CadDone ) ( bool channelActivityDetected ); + } RadioEvents_t; class Radio { @@ -74,7 +75,7 @@ static void Sleep(void); static void SetChannel(unsigned hz); static float getFrfMHz(void); - static void SetRxMaxPayloadLength(RadioModems_t, uint8_t); + static void SetRxMaxPayloadLength(uint8_t); static void Rx(unsigned timeout); // timeout 0 for continuous rx static void Standby(void); static bool CheckRfFrequency(unsigned hz); @@ -100,6 +101,8 @@ static LowPowerTimer lpt; #ifdef SX127x_H static SX127x radio; + static SX127x_lora lora; + static SX127x_fsk fsk; #elif defined(SX126x_H) static SX126x radio; #elif defined(SX128x_H) @@ -109,11 +112,8 @@ #endif private: + static void print_buf(const uint8_t* buf, uint8_t size, const char* txt); static void boardInit(void); -#ifdef SX127x_H - static SX127x_lora lora; - static SX127x_fsk fsk; -#endif /* SX127x_H */ #ifdef SX126x_H static RadioModems_t _m_; static void rx_done(uint8_t, float, float); @@ -123,7 +123,6 @@ static PacketParams_t pp; #endif /* SX126x_H */ #ifdef SX128x_H - static RadioModems_t _m_; static void readChip(void); static PacketParams_t ppGFSK, ppLORA, ppFLRC; static ModulationParams_t mpFLRC, mpBLE_GFSK, mpLORA;