Created Custom Build Configuration (markdown)

master
Jan Gromeš 2020-05-12 19:10:35 +02:00
rodzic 280d996d46
commit be64961f33
1 zmienionych plików z 25 dodań i 0 usunięć

@ -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 <RadioLib.h>
```