diff --git a/Custom-Build-Configuration.md b/Custom-Build-Configuration.md new file mode 100644 index 0000000..39c4789 --- /dev/null +++ b/Custom-Build-Configuration.md @@ -0,0 +1,25 @@ +# Custom Build Configuration + +RadioLib supports many different Arduino cores, but sometimes it may be beneficial to define your own "platform". This can be achieved by frist defining the macro `RADIOLIB_CUSTOM_PLATFORM` and then defining all the required platform specification parameters. All the definitions **MUST** be placed in the Arduino sketch prior to including the main library file RadioLib.h, as is shown in the following example. + +```c++ +#define RADIOLIB_CUSTOM_PLATFORM + +// the following parameters must always be defined +#define RADIOLIB_PIN_TYPE uint8_t +#define RADIOLIB_PIN_MODE uint8_t +#define RADIOLIB_PIN_STATUS uint8_t +#define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS +#define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p) +#define RADIOLIB_NC (0xFF) +#define RADIOLIB_DEFAULT_SPI SPI + +// the following parameters must be defined if the Arduino core does not support SoftwareSerial library +#define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED +#define RADIOLIB_HARDWARE_SERIAL_PORT Serial1 + +// the following parameters must be defined if the Arduino core does not support tone function +#define RADIOLIB_TONE_UNSUPPORTED + +#include +``` \ No newline at end of file