Reworked directory structure

This commit is contained in:
jgromes 2019-11-20 17:19:15 +01:00
parent 2fc641449a
commit 915f3780cc
57 changed files with 99 additions and 104 deletions

View file

@ -1,8 +0,0 @@
#include "RadioLib.h"
Radio::Radio() {
ModuleA = new Module(RADIOSHIELD_CS_A, RADIOSHIELD_INT_0, RADIOSHIELD_INT_1, RADIOSHIELD_RX_A, RADIOSHIELD_TX_A, SPI, SPISettings(2000000, MSBFIRST, SPI_MODE0), nullptr);
ModuleB = new Module(RADIOSHIELD_CS_B, RADIOSHIELD_INT_0, RADIOSHIELD_INT_1, RADIOSHIELD_RX_B, RADIOSHIELD_TX_B, SPI, SPISettings(2000000, MSBFIRST, SPI_MODE0), nullptr);
}
Radio RadioShield;

View file

@ -42,39 +42,39 @@
#warning "God mode active, I hope it was intentional. Buckle up, lads."
#endif
#include "modules/CC1101.h"
#include "modules/CC1101/CC1101.h"
#ifndef ESP8266
#include "modules/ESP8266.h"
#include "modules/ESP8266/ESP8266.h"
#endif
#include "modules/HC05.h"
#include "modules/JDY08.h"
#include "modules/nRF24.h"
#include "modules/RF69.h"
#include "modules/RFM95.h"
#include "modules/RFM96.h"
#include "modules/RFM97.h"
#include "modules/SX1231.h"
#include "modules/SX1261.h"
#include "modules/SX1262.h"
#include "modules/SX1268.h"
#include "modules/SX1272.h"
#include "modules/SX1273.h"
#include "modules/SX1276.h"
#include "modules/SX1277.h"
#include "modules/SX1278.h"
#include "modules/SX1279.h"
#include "modules/XBee.h"
#include "modules/HC05/HC05.h"
#include "modules/JDY08/JDY08.h"
#include "modules/nRF24/nRF24.h"
#include "modules/RF69/RF69.h"
#include "modules/RFM9x/RFM95.h"
#include "modules/RFM9x/RFM96.h"
#include "modules/RFM9x/RFM97.h"
#include "modules/SX1231/SX1231.h"
#include "modules/SX126x/SX1261.h"
#include "modules/SX126x/SX1262.h"
#include "modules/SX126x/SX1268.h"
#include "modules/SX127x/SX1272.h"
#include "modules/SX127x/SX1273.h"
#include "modules/SX127x/SX1276.h"
#include "modules/SX127x/SX1277.h"
#include "modules/SX127x/SX1278.h"
#include "modules/SX127x/SX1279.h"
#include "modules/XBee/XBee.h"
// physical layer protocols
#include "protocols/PhysicalLayer.h"
#include "protocols/Morse.h"
#include "protocols/RTTY.h"
#include "protocols/PhysicalLayer/PhysicalLayer.h"
#include "protocols/Morse/Morse.h"
#include "protocols/RTTY/RTTY.h"
// transport layer protocols
#ifndef ESP8266
#include "protocols/TransportLayer.h"
#include "protocols/HTTP.h"
#include "protocols/MQTT.h"
#include "protocols/TransportLayer/TransportLayer.h"
#include "protocols/HTTP/HTTP.h"
#include "protocols/MQTT/MQTT.h"
#endif
// RadioShield pin definitions
@ -97,13 +97,16 @@
class Radio {
public:
Module* ModuleA;
Module* ModuleB;
/*!
\brief Default constructor. Only used to set ModuleA and ModuleB configuration.
*/
Radio();
Module* ModuleA;
Module* ModuleB;
Radio() {
ModuleA = new Module(RADIOSHIELD_CS_A, RADIOSHIELD_INT_0, RADIOSHIELD_INT_1, RADIOSHIELD_RX_A, RADIOSHIELD_TX_A, SPI, SPISettings(2000000, MSBFIRST, SPI_MODE0), nullptr);
ModuleB = new Module(RADIOSHIELD_CS_B, RADIOSHIELD_INT_0, RADIOSHIELD_INT_1, RADIOSHIELD_RX_B, RADIOSHIELD_TX_B, SPI, SPISettings(2000000, MSBFIRST, SPI_MODE0), nullptr);
}
#ifndef RADIOLIB_GODMODE
private:
@ -111,6 +114,6 @@ class Radio {
};
extern Radio RadioShield;
Radio RadioShield;
#endif

View file

@ -1,10 +1,10 @@
#ifndef _RADIOLIB_CC1101_H
#define _RADIOLIB_CC1101_H
#include "TypeDef.h"
#include "Module.h"
#include "../../TypeDef.h"
#include "../../Module.h"
#include "../protocols/PhysicalLayer.h"
#include "../../protocols/PhysicalLayer/PhysicalLayer.h"
// CC1101 physical layer properties
#define CC1101_CRYSTAL_FREQ 26.0

View file

@ -1,9 +1,9 @@
#if !defined(_RADIOLIB_ESP8266_H) && !defined(ESP8266)
#define _RADIOLIB_ESP8266_H
#include "Module.h"
#include "../../Module.h"
#include "../protocols/TransportLayer.h"
#include "../../protocols/TransportLayer/TransportLayer.h"
/*!
\class ESP8266

View file

@ -1,7 +1,7 @@
#ifndef _RADIOLIB_HC05_H
#define _RADIOLIB_HC05_H
#include "ISerial.h"
#include "../../ISerial.h"
/*!
\class HC05

View file

@ -1,7 +1,7 @@
#ifndef _RADIOLIB_JDY08_H
#define _RADIOLIB_JDY08_H
#include "ISerial.h"
#include "../../ISerial.h"
/*!
\class JDY08

View file

@ -1,10 +1,10 @@
#ifndef _RADIOLIB_RF69_H
#define _RADIOLIB_RF69_H
#include "TypeDef.h"
#include "Module.h"
#include "../../TypeDef.h"
#include "../../Module.h"
#include "../protocols/PhysicalLayer.h"
#include "../../protocols/PhysicalLayer/PhysicalLayer.h"
// RF69 physical layer properties
#define RF69_CRYSTAL_FREQ 32.0

View file

@ -1,10 +1,10 @@
#ifndef _RADIOLIB_RFM95_H
#define _RADIOLIB_RFM95_H
#include "TypeDef.h"
#include "Module.h"
#include "SX127x.h"
#include "SX1278.h"
#include "../../TypeDef.h"
#include "../../Module.h"
#include "../SX127x/SX127x.h"
#include "../SX127x/SX1278.h"
// SX127X_REG_VERSION
#define RFM95_CHIP_VERSION 0x11
@ -66,7 +66,7 @@ class RFM95: public SX1278 {
\returns \ref status_codes
*/
int16_t setFrequency(float freq);
#ifndef RADIOLIB_GODMODE
private:
#endif

View file

@ -1,10 +1,10 @@
#ifndef _RADIOLIB_RFM96_H
#define _RADIOLIB_RFM96_H
#include "TypeDef.h"
#include "Module.h"
#include "SX127x.h"
#include "SX1278.h"
#include "../../TypeDef.h"
#include "../../Module.h"
#include "../SX127x/SX127x.h"
#include "../SX127x/SX1278.h"
// SX127X_REG_VERSION
#define RFM9X_CHIP_VERSION 0x12 // according to datasheet, this should be 0x11, but all modules seem to have 0x12

View file

@ -1,10 +1,10 @@
#ifndef _RADIOLIB_RFM97_H
#define _RADIOLIB_RFM97_H
#include "TypeDef.h"
#include "Module.h"
#include "SX127x.h"
#include "SX1278.h"
#include "../../TypeDef.h"
#include "../../Module.h"
#include "../SX127x/SX127x.h"
#include "../SX127x/SX1278.h"
#include "RFM95.h"
/*!

View file

@ -1,9 +1,9 @@
#ifndef _RADIOLIB_SX1231_H
#define _RADIOLIB_SX1231_H
#include "TypeDef.h"
#include "Module.h"
#include "RF69.h"
#include "../../TypeDef.h"
#include "../../Module.h"
#include "../RF69/RF69.h"
#define SX1231_CHIP_REVISION_2_A 0x21
#define SX1231_CHIP_REVISION_2_B 0x22

View file

@ -1,8 +1,8 @@
#ifndef _RADIOLIB_SX1261_H
#define _RADIOLIB_SX1261_H
#include "TypeDef.h"
#include "Module.h"
#include "../../TypeDef.h"
#include "../../Module.h"
#include "SX126x.h"
#include "SX1262.h"

View file

@ -1,8 +1,8 @@
#ifndef _RADIOLIB_SX1262_H
#define _RADIOLIB_SX1262_H
#include "TypeDef.h"
#include "Module.h"
#include "../../TypeDef.h"
#include "../../Module.h"
#include "SX126x.h"
/*!

View file

@ -1,8 +1,8 @@
#ifndef _RADIOLIB_SX1268_H
#define _RADIOLIB_SX1268_H
#include "TypeDef.h"
#include "Module.h"
#include "../../TypeDef.h"
#include "../../Module.h"
#include "SX126x.h"
//SX126X_CMD_SET_PA_CONFIG
@ -95,7 +95,7 @@ class SX1268: public SX126x {
#ifndef RADIOLIB_GODMODE
private:
#endif
};
#endif

View file

@ -1,10 +1,10 @@
#ifndef _RADIOLIB_SX126X_H
#define _RADIOLIB_SX126X_H
#include "TypeDef.h"
#include "Module.h"
#include "../../TypeDef.h"
#include "../../Module.h"
#include "../protocols/PhysicalLayer.h"
#include "../../protocols/PhysicalLayer/PhysicalLayer.h"
// SX126X physical layer properties
#define SX126X_CRYSTAL_FREQ 32.0

View file

@ -1,8 +1,8 @@
#ifndef _RADIOLIB_SX1272_H
#define _RADIOLIB_SX1272_H
#include "TypeDef.h"
#include "Module.h"
#include "../../TypeDef.h"
#include "../../Module.h"
#include "SX127x.h"
// SX1272 specific register map
@ -262,7 +262,7 @@ class SX1272: public SX127x {
#ifndef RADIOLIB_GODMODE
private:
#endif
};
#endif

View file

@ -1,7 +1,7 @@
#ifndef _RADIOLIB_SX1273_H
#define _RADIOLIB_SX1273_H
#include "TypeDef.h"
#include "../../TypeDef.h"
#include "SX1272.h"
/*!

View file

@ -1,7 +1,7 @@
#ifndef _RADIOLIB_SX1276_H
#define _RADIOLIB_SX1276_H
#include "TypeDef.h"
#include "../../TypeDef.h"
#include "SX1278.h"
/*!

View file

@ -1,7 +1,7 @@
#ifndef _RADIOLIB_SX1277_H
#define _RADIOLIB_SX1277_H
#include "TypeDef.h"
#include "../../TypeDef.h"
#include "SX1278.h"
/*!

View file

@ -1,8 +1,8 @@
#ifndef _RADIOLIB_SX1278_H
#define _RADIOLIB_SX1278_H
#include "TypeDef.h"
#include "Module.h"
#include "../../TypeDef.h"
#include "../../Module.h"
#include "SX127x.h"
// SX1278 specific register map
@ -271,7 +271,7 @@ class SX1278: public SX127x {
#ifndef RADIOLIB_GODMODE
private:
#endif
};
#endif

View file

@ -1,7 +1,7 @@
#ifndef _RADIOLIB_SX1279_H
#define _RADIOLIB_SX1279_H
#include "TypeDef.h"
#include "../../TypeDef.h"
#include "SX1278.h"
/*!
@ -65,7 +65,7 @@ class SX1279: public SX1278 {
#ifndef RADIOLIB_GODMODE
private:
#endif
};
#endif

View file

@ -1,10 +1,10 @@
#ifndef _RADIOLIB_SX127X_H
#define _RADIOLIB_SX127X_H
#include "TypeDef.h"
#include "Module.h"
#include "../../TypeDef.h"
#include "../../Module.h"
#include "../protocols/PhysicalLayer.h"
#include "../../protocols/PhysicalLayer/PhysicalLayer.h"
// SX127x physical layer properties
#define SX127X_CRYSTAL_FREQ 32.0

View file

@ -1,8 +1,8 @@
#ifndef _RADIOLIB_XBEE_H
#define _RADIOLIB_XBEE_H
#include "ISerial.h"
#include "TypeDef.h"
#include "../../ISerial.h"
#include "../../TypeDef.h"
// API reserved characters
#define XBEE_API_START 0x7E

View file

@ -1,10 +1,10 @@
#ifndef _RADIOLIB_NRF24_H
#define _RADIOLIB_NRF24_H
#include "Module.h"
#include "TypeDef.h"
#include "../../Module.h"
#include "../../TypeDef.h"
#include "../protocols/PhysicalLayer.h"
#include "../../protocols/PhysicalLayer/PhysicalLayer.h"
// nRF24 physical layer properties (dummy only)
#define NRF24_CRYSTAL_FREQ 1.0

View file

@ -1,8 +1,8 @@
#ifndef _RADIOLIB_HTTP_H
#define _RADIOLIB_HTTP_H
#include "TypeDef.h"
#include "TransportLayer.h"
#include "../../TypeDef.h"
#include "../TransportLayer/TransportLayer.h"
/*!

View file

@ -1,8 +1,8 @@
#ifndef _RADIOLIB_MQTT_H
#define _RADIOLIB_MQTT_H
#include "TypeDef.h"
#include "TransportLayer.h"
#include "../../TypeDef.h"
#include "../TransportLayer/TransportLayer.h"
// MQTT packet types
#define MQTT_CONNECT 0x01

View file

@ -1,8 +1,8 @@
#ifndef _RADIOLIB_MORSE_H
#define _RADIOLIB_MORSE_H
#include "TypeDef.h"
#include "PhysicalLayer.h"
#include "../../TypeDef.h"
#include "../PhysicalLayer/PhysicalLayer.h"
#define MORSE_LENGTH 52

View file

@ -1,7 +1,7 @@
#ifndef _RADIOLIB_PHYSICAL_LAYER_H
#define _RADIOLIB_PHYSICAL_LAYER_H
#include "TypeDef.h"
#include "../../TypeDef.h"
/*!
\class PhysicalLayer

View file

@ -1,8 +1,8 @@
#ifndef _RADIOLIB_RTTY_H
#define _RADIOLIB_RTTY_H
#include "TypeDef.h"
#include "PhysicalLayer.h"
#include "../../TypeDef.h"
#include "../PhysicalLayer/PhysicalLayer.h"
#define ITA2_FIGS 0x1B
#define ITA2_LTRS 0x1F

View file

@ -1,7 +1,7 @@
#ifndef _RADIOLIB_TRANSPORT_LAYER_H
#define _RADIOLIB_TRANSPORT_LAYER_H
#include "TypeDef.h"
#include "../../TypeDef.h"
/*!
\class TransportLayer