LDL  0.5.0
Macros
Build Options

Description

These can be defined in two ways:

Macros

#define LDL_ERROR(...)
 
#define LDL_INFO(...)
 
#define LDL_DEBUG(...)
 
#define LDL_ASSERT(X)
 
#define LDL_PEDANTIC(X)
 
#define LDL_TARGET_INCLUDE
 
#define LDL_ENABLE_SX1272
 
#define LDL_ENABLE_SX1276
 
#define LDL_ENABLE_SX1261
 
#define LDL_ENABLE_SX1262
 
#define LDL_DISABLE_LINK_CHECK
 
#define LDL_DISABLE_DEVICE_TIME
 
#define LDL_DISABLE_TX_PARAM_SETUP
 
#define LDL_ENABLE_AU_915_928
 
#define LDL_ENABLE_EU_863_870
 
#define LDL_ENABLE_EU_433
 
#define LDL_ENABLE_US_902_928
 
#define LDL_ENABLE_STATIC_RX_BUFFER
 
#define LDL_ENABLE_AVR
 
#define LDL_ENABLE_ERRATA_A1
 
#define LDL_LITTLE_ENDIAN
 
#define LDL_ENABLE_RADIO_DEBUG
 
#define LDL_PARAM_TPS
 
#define LDL_PARAM_A
 
#define LDL_PARAM_B
 
#define LDL_PARAM_ADVANCE
 
#define LDL_PARAM_BEACON_INTERVAL
 
#define LDL_ENABLE_CLASS_B
 
#define LDL_ENABLE_OTAA_DITHER
 
#define LDL_ENABLE_TEST_MODE
 
#define LDL_DISABLE_SF12
 
#define LDL_MAX_PACKET   UINT8_MAX
 
#define LDL_REDUNDANCY_MAX   3
 
#define LDL_STARTUP_DELAY   0
 
#define LDL_PARAM_XTAL_DELAY   25
 
#define LDL_L2_VERSION   LDL_L2_VERSION_1_0_4
 

Macro Definition Documentation

◆ LDL_ERROR

#define LDL_ERROR (   ...)

A printf-like function that captures run-time error level messages

Example:

#define LDL_ERROR(...) do{printf(__VA_ARGS__);printf("\n");}while(0);

If not defined, all LDL_ERROR() messages will be left out of the build.

◆ LDL_INFO

#define LDL_INFO (   ...)

A printf-like function that captures run-time info level messages

Example:

#define LDL_INFO(...) do{printf(__VA_ARGS__);printf("\n");}while(0);

If not defined, all LDL_INFO() messages will be left out of the build.

◆ LDL_DEBUG

#define LDL_DEBUG (   ...)

A printf-like function that captures run-time debug level messages with varaidic arguments

Example:

#define LDL_DEBUG(...) do{printf(__VA_ARGS__);printf("\n");}while(0);

If not defined, all LDL_DEBUG() messages will be left out of the build.

◆ LDL_ASSERT

#define LDL_ASSERT (   X)

An assert-like function that performs run-time assertions on 'X'.

Example:

#define LDL_ASSERT(X) assert(X);

If not defined, all LDL_ASSERT() checks will be left out of the build.

LDL_ASSERT() should be defined for development and production.

◆ LDL_PEDANTIC

#define LDL_PEDANTIC (   X)

An assert-like function that performs run-time assertions on 'X'.

Example:

#define LDL_PEDANTIC(X) assert(X);

If not defined, all LDL_PEDANTIC() checks will be left out of the build.

LDL_PEDANTIC() should be defined for development.

◆ LDL_TARGET_INCLUDE

#define LDL_TARGET_INCLUDE

Include a target specific file in all headers.

This file can be used to define:

Example (defined from a makefile):

-DLDL_TARGET_INCLUDE='"target_specific.h"'

Where target_specific.h would be kept somewhere on the include search path.

◆ LDL_ENABLE_SX1272

#define LDL_ENABLE_SX1272

Define to add support for SX1272

◆ LDL_ENABLE_SX1276

#define LDL_ENABLE_SX1276

Define to add support for SX1276

◆ LDL_ENABLE_SX1261

#define LDL_ENABLE_SX1261

Define to add support for SX1261

◆ LDL_ENABLE_SX1262

#define LDL_ENABLE_SX1262

Define to add support for SX1262

◆ LDL_DISABLE_LINK_CHECK

#define LDL_DISABLE_LINK_CHECK

Define to remove the link-check feature.

This will save a small amount of Flash.

◆ LDL_DISABLE_DEVICE_TIME

#define LDL_DISABLE_DEVICE_TIME

Define to remove deviceTime MAC command handling

This will save a small amount of Flash.

◆ LDL_DISABLE_TX_PARAM_SETUP

#define LDL_DISABLE_TX_PARAM_SETUP

Define to remove code associated with this MAC command.

This will save a small amount of Flash.

This code cannot be removed if you have enabled a region that requires it.

◆ LDL_ENABLE_AU_915_928

#define LDL_ENABLE_AU_915_928

Define to enable support for AU_915_928

◆ LDL_ENABLE_EU_863_870

#define LDL_ENABLE_EU_863_870

Define to enable support for EU_863_870

◆ LDL_ENABLE_EU_433

#define LDL_ENABLE_EU_433

Define to enable support for EU_433

◆ LDL_ENABLE_US_902_928

#define LDL_ENABLE_US_902_928

Define to enable support for US_902_928

◆ LDL_ENABLE_STATIC_RX_BUFFER

#define LDL_ENABLE_STATIC_RX_BUFFER

Define to keep RX buffer in mac state rather than on the stack.

This will save the stack from growing by LDL_MAX_PACKET bytes when LDL_MAC_process() is called.

◆ LDL_ENABLE_AVR

#define LDL_ENABLE_AVR

Define to make use of PROGMEM if using avr-libc

◆ LDL_ENABLE_ERRATA_A1

#define LDL_ENABLE_ERRATA_A1

Define to apply the proposed change to LoRaWAN 1.1 spec regarding the construction of the A1 block when encrypting Fopts.

◆ LDL_LITTLE_ENDIAN

#define LDL_LITTLE_ENDIAN

Define to optimise for little-endian targets

◆ LDL_ENABLE_RADIO_DEBUG

#define LDL_ENABLE_RADIO_DEBUG

Define to enable verbose radio interface debugging that will buffer and print register access via LDL_TRACE_*

This feature uses a buffer to defer printing until the driver is past a timing sensitive part.

Note: you need to define LDL_TRACE_* macros to get output.

◆ LDL_PARAM_TPS

#define LDL_PARAM_TPS

Define to set ldl_mac_init_arg.tps at compile time

◆ LDL_PARAM_A

#define LDL_PARAM_A

Define to set ldl_mac_init_arg.a at compile time

◆ LDL_PARAM_B

#define LDL_PARAM_B

Define to set ldl_mac_init_arg.b at compile time

◆ LDL_PARAM_ADVANCE

#define LDL_PARAM_ADVANCE

Define to set ldl_mac_init_arg.advance at compile time

◆ LDL_PARAM_BEACON_INTERVAL

#define LDL_PARAM_BEACON_INTERVAL

Define to set at compile time

◆ LDL_ENABLE_CLASS_B

#define LDL_ENABLE_CLASS_B

Define to enable class B features

Currently a work in progress.

◆ LDL_ENABLE_OTAA_DITHER

#define LDL_ENABLE_OTAA_DITHER

Define to add run-time control of OTAA dither interval

This is useful for test platforms to speed up the joining process.

◆ LDL_ENABLE_TEST_MODE

#define LDL_ENABLE_TEST_MODE

Define to enable test mode features

DO NOT ENABLE FOR PRODUCTION

◆ LDL_DISABLE_SF12

#define LDL_DISABLE_SF12

Define to prevent SF12 data rates being used.

This is useful if you are using an SX127X radio with a standard XTAL.

Note that disabling SF12 may mean it is not possible to use mode B.

◆ LDL_MAX_PACKET

#define LDL_MAX_PACKET   UINT8_MAX

Redefine this to reduce the stack and data memory footprint.

The maximum allowable size is UINT8_MAX bytes

◆ LDL_REDUNDANCY_MAX

#define LDL_REDUNDANCY_MAX   3

Redefine to limit the maximum redundancy setting used to send unconfirmed data frames.

(i.e. LinkADRReq.redundancy.NbTrans)

The standard limits this value to 15 which is very high. This implementation by default will not send more than three redundant frames. You can raise this limit by redefining LDL_REDUNDANCY_MAX.

e.g.

#define LDL_REDUNDANCY_MAX 5

◆ LDL_STARTUP_DELAY

#define LDL_STARTUP_DELAY   0

Define to add a delay (in milliseconds) to when a device can send its first message after LDL_MAC_init().

This is an optional safety feature to ensure a device stuck in a reset loop doesn't transmit too often.

◆ LDL_PARAM_XTAL_DELAY

#define LDL_PARAM_XTAL_DELAY   25

Define to change the fixed millisecond delay that is inserted before RX and TX operations.

This delay is to give time for the xtal to start and stabilise.

It can't be too large, it can't be too small.

◆ LDL_L2_VERSION

#define LDL_L2_VERSION   LDL_L2_VERSION_1_0_4

Define to change the LoRaWAN L2 version from the default setting.

Must be one of:

  • LDL_L2_VERSION_1_0_3
  • LDL_L2_VERSION_1_0_4
  • LDL_L2_VERSION_1_1

e.g.

#define LDL_L2_VERSION LDL_L2_VERSION_1_0_4