Logo
Link Labs Interface Library
External host library for using Link Lab's modules.
top
Functions
NoMAC

Detailed Description

Perform low-level communication operations.

NoMAC mode disables the media access control (MAC) firmware and allows the external host to directly issue low-level commands. NoMAC mode gives the external host direct control of the module's radio parameters, without any automatic network control. NoMAC is useful for network research and development while designing or experimenting with new MAC protocols. However, most products should use one of the provided MACs such as Symphony Link.

Functions

int32_t ll_bandwidth_set (uint8_t bandwidth)
 Set the RF bandwidth to a number between 0 and 3 corresponding to the bandwidths listed below. More...
 
int32_t ll_coding_rate_set (uint8_t coding_rate)
 Set the coding rate. Both the receiver and the transmitter must have the same setting. More...
 
int32_t ll_crc_enabled_set (uint8_t enabled)
 Enable or disable the LoRa CRC. More...
 
int32_t ll_echo_mode (void)
 Put the module into echo mode. More...
 
int32_t ll_frequency_set (uint32_t freq)
 Set the tuned frequency. Both the receiver and the transmitter must have the same setting. More...
 
int32_t ll_header_enabled_set (uint8_t enabled)
 Enable or disable the LoRa header. More...
 
int32_t ll_iq_inversion_set (uint8_t inverted)
 Enable or disable the I/Q inversion. More...
 
int32_t ll_packet_recv (uint16_t num_timeout_symbols, uint8_t buf[], uint16_t len, uint8_t *bytes_received)
 Receive over-the-air data from the module. More...
 
int32_t ll_packet_recv_cont (uint8_t buf[], uint16_t len, uint8_t *bytes_received, bool freq_error_requested)
 Receive over-the-air data from the module continuously, with RSSI and SNR prepended to the payload. More...
 
int32_t ll_packet_recv_with_rssi (uint16_t num_timeout_symbols, uint8_t buf[], uint16_t len, uint8_t *bytes_received, bool freq_error_requested)
 Receive over-the-air data from the module with RSSI and SNR prepended to the payload. More...
 
int32_t ll_packet_send (uint8_t buf[], uint16_t len)
 
int32_t ll_packet_send_queue (uint8_t buf[], uint16_t len)
 Cancel any active receive window and queue a packet for Tx. More...
 
int32_t ll_packet_send_timestamp (uint32_t timestamp_us, uint8_t buf[], uint16_t len)
 Cancel any active receive window and queue a packet for transmission at a specified time. More...
 
int32_t ll_preamble_syms_set (uint16_t num_syms)
 Set the preamble length. More...
 
int32_t ll_radio_params_get (uint8_t *sf, uint8_t *cr, uint8_t *bw, uint32_t *freq, uint16_t *preamble_syms, uint8_t *header_enabled, uint8_t *crc_enabled, uint8_t *iq_inverted)
 Gets the radio parameters of the module. More...
 
int32_t ll_radio_params_set (uint8_t flags, uint8_t sf, uint8_t cr, uint8_t bw, uint32_t freq, uint16_t preamble_syms, uint8_t enable_header, uint8_t enable_crc, uint8_t enable_iq_inversion)
 Sets multiple radio parameters at once. More...
 
int32_t ll_rssi_scan_get (uint8_t buf[], uint16_t len, uint8_t *bytes_received)
 RSSI Scan get. More...
 
int32_t ll_rssi_scan_set (uint32_t u1, uint32_t u2, uint32_t u3, uint32_t u4)
 RSSI Scan set. More...
 
int32_t ll_spreading_factor_set (uint8_t sf)
 Set the spreading factor for the modulation. Both the receiver and the transmitter must have the same setting. More...
 
int32_t ll_sync_word_get (uint8_t *sync_word)
 Get the LoRa sync word. More...
 
int32_t ll_sync_word_set (uint8_t sync_word)
 Set the No MAC sync word. More...
 
int32_t ll_transmit_cw (void)
 
int32_t ll_tx_power_get (int8_t *pwr)
 Get the transmitter output power. More...
 
int32_t ll_tx_power_set (int8_t pwr)
 Set the transmitter output power. More...
 

Function Documentation

int32_t ll_bandwidth_set ( uint8_t  bandwidth)

Set the RF bandwidth to a number between 0 and 3 corresponding to the bandwidths listed below.

This function sets the RF bandwidth.

  • 0 - 62.5 kHz
  • 1 - 125 kHz
  • 2 - 250 kHz
  • 3 - 500 kHz
Parameters
[in]bandwidthbandwidth index (0 to 3).
Returns
0 - success, negative otherwise.
int32_t ll_coding_rate_set ( uint8_t  coding_rate)

Set the coding rate. Both the receiver and the transmitter must have the same setting.

This function sets the coding rate from 4/5 to 4/8:

  • 1 - 4/5
  • 2 - 4/6
  • 3 - 4/7
  • 4 - 4/8
Parameters
[in]coding_ratecoding_rate number from 1 to 4.
Returns
0 - success, negative otherwise.
int32_t ll_crc_enabled_set ( uint8_t  enabled)

Enable or disable the LoRa CRC.

This function enables or disable the CRC attached to every LoRa packet.

Parameters
[in]enabledBoolean indicating whether to enable or disable the CRC.
Returns
0 - success, negative otherwise.
int32_t ll_echo_mode ( void  )

Put the module into echo mode.

In echo mode, the module is in a continous Receive mode. When a packet is received, it transmits the payload and received RSSI, SNR.

Returns
0 - success, negative otherwise.
int32_t ll_frequency_set ( uint32_t  freq)

Set the tuned frequency. Both the receiver and the transmitter must have the same setting.

This function sets the RF frequency.

Parameters
[in]freqfrequency in Hz - 820 MHz to 1020 MHz.
Note
The modules is only designed for the 902 to 928 MHz band.
Returns
0 - success, negative otherwise.
int32_t ll_header_enabled_set ( uint8_t  enabled)

Enable or disable the LoRa header.

This function enables or disable the LoRa header. This is also known as the 'fixed-length' LoRa option.

Parameters
[in]enabledBoolean indicating whether to enable or disable the header.
Returns
0 - success, negative otherwise.
int32_t ll_iq_inversion_set ( uint8_t  inverted)

Enable or disable the I/Q inversion.

Parameters
[in]invertedBoolean. A non-zero value indicates that I/Q inversion will be turned on.
Returns
0 - success, negative otherwise.
int32_t ll_packet_recv ( uint16_t  num_timeout_symbols,
uint8_t  buf[],
uint16_t  len,
uint8_t *  bytes_received 
)

Receive over-the-air data from the module.

This function puts the module into receive mode and checks for any new packets. Once in receive mode, this function must be called to poll for new packets.

Parameters
[in]num_timeout_symbolsWhen search for a preamble, the modem will timeout after this number of symbols.
[out]bufbyte array containing the data payload.
[in]lensize of the output buffer in bytes.
[out]bytes_receivednumber of bytes received.
Returns
0 - success, negative otherwise.
int32_t ll_packet_recv_cont ( uint8_t  buf[],
uint16_t  len,
uint8_t *  bytes_received,
bool  freq_error_requested 
)

Receive over-the-air data from the module continuously, with RSSI and SNR prepended to the payload.

This function puts the module into continuous receive mode and checks for any new packets. Once in continuous receive mode, this function must be called to poll for new packets.

Parameters
[out]bufbyte array containing the data payload.
[in]lensize of the output buffer in bytes.
[out]bytes_receivednumber of bytes received
[in]boolfreq_error_requested If True, a Rx freq error will be returned on any received packet.
Note
The first 2 bytes of the payload will be the int16_t rssi in units of dBm. The third byte of the payload will be the estimated SNR. If freq_error_requested is true, the following 4 bytes are the int32_t Rx freq error the remaining bytes are the user payload
Returns
0 - success, negative otherwise.
int32_t ll_packet_recv_with_rssi ( uint16_t  num_timeout_symbols,
uint8_t  buf[],
uint16_t  len,
uint8_t *  bytes_received,
bool  freq_error_requested 
)

Receive over-the-air data from the module with RSSI and SNR prepended to the payload.

This function puts the module into receive mode and checks for any new packets. Once in receive mode, this function must be called to poll for new packets.

Parameters
[in]num_timeout_symbolsWhen search for a preamble, the modem will timeout after this number of symbols.
[out]bufbyte array containing the data payload.
[in]lensize of the output buffer in bytes.
[out]bytes_receivednumber of bytes received
[in]boolfreq_error_requested If True, a Rx freq error will be returned on any received packet.
Note
The first 2 bytes of the payload will be the int16_t rssi in units of dBm The third byte of the payload will be the estimated SnR. If freq_error_requested is true, the following 4 bytes are the int32_t Rx freq error The remaining bytes are the user payload.
Returns
0 - success, negative otherwise.
int32_t ll_packet_send ( uint8_t  buf[],
uint16_t  len 
)
Deprecated:
Cancel any active receive window and send a single Tx packet immediately. This just calls ll_packet_send_queue.
int32_t ll_packet_send_queue ( uint8_t  buf[],
uint16_t  len 
)

Cancel any active receive window and queue a packet for Tx.

When the packet finishes transmission the module will return to the idle state.

Parameters
[in]bufbyte array containing the data payload.
[in]lenlength of the input buffer in bytes.
Returns
int32_t 1 if packet queued int32_t 0 if queue is full negative if an error occured
int32_t ll_packet_send_timestamp ( uint32_t  timestamp_us,
uint8_t  buf[],
uint16_t  len 
)

Cancel any active receive window and queue a packet for transmission at a specified time.

When the packet finishes transmission the module will return to the idle state. Also see ll_packet_send_queue().

Parameters
[in]timestamp_usThe timestamp in microseconds when the next packet will be transmitted. Use ll_timestamp_get() and ll_timestamp_set() to determine the desired timestamp.
[in]bufbyte array containing the data payload.
[in]lenlength of the input buffer in bytes.
Returns
int32_t 1 if packet queued int32_t 0 if queue is full negative if an error occurred
int32_t ll_preamble_syms_set ( uint16_t  num_syms)

Set the preamble length.

This function sets the length of the LoRa preamble, in number of symbols.

Parameters
[in]num_symslength of the preamble in symbols.
Returns
0 - success, negative otherwise.
int32_t ll_radio_params_get ( uint8_t *  sf,
uint8_t *  cr,
uint8_t *  bw,
uint32_t *  freq,
uint16_t *  preamble_syms,
uint8_t *  header_enabled,
uint8_t *  crc_enabled,
uint8_t *  iq_inverted 
)

Gets the radio parameters of the module.

Parameters
[out]sf6..12
[out]cr1=CR4/5 ... 4=CR4/8
[out]bw0=62.5kHz ... 3=500kHz
[out]freqcenter frequency in Hz
[out]preamble_symslength of preamble in number of symbols
[out]header_enabledboolean indicating whether LoRa header is enabled
[out]crc_enabledboolean indicating whether LoRa CRC is enabled
[out]iq_invertedboolean indicating whether IQ inversion is enabled
Returns
0 - success, negative otherwise.
int32_t ll_radio_params_set ( uint8_t  flags,
uint8_t  sf,
uint8_t  cr,
uint8_t  bw,
uint32_t  freq,
uint16_t  preamble_syms,
uint8_t  enable_header,
uint8_t  enable_crc,
uint8_t  enable_iq_inversion 
)

Sets multiple radio parameters at once.

Parameters
[in]flagsA bit mask which indicates which parameters to set. The available flag bits are:
  • RADIO_PARAM_FLAGS_SF
  • RADIO_PARAM_FLAGS_CR
  • RADIO_PARAM_FLAGS_BW
  • RADIO_PARAM_FLAGS_FREQ
  • RADIO_PARAM_FLAGS_PREAMBLE
  • RADIO_PARAM_FLAGS_HEADER
  • RADIO_PARAM_FLAGS_CRC
  • RADIO_PARAM_FLAGS_IQ
[in]sf6..12
[in]cr1=CR4/5 ... 4=CR4/8
[in]bw0=62.5kHz ... 3=500kHz
[in]freqcenter frequency in Hz.
[in]preamble_symsThe number of symbols to send in the preamble.
[in]enable_headerWhen nonzero, send the packet header. When zero, do not send a packet header.
[in]enable_crcWhen non-zero, send a packet CRC. When zero, do not send a CRC.
[in]enable_iq_inversionWhen non-zero, enable IQ inversion on the quadrature RF signal. When zero, use normal IQ.
Returns
0 - success, negative otherwise.
int32_t ll_rssi_scan_get ( uint8_t  buf[],
uint16_t  len,
uint8_t *  bytes_received 
)

RSSI Scan get.

Parameters
[out]bufbyte array containing the data payload.
[in]lensize of the output buffer in bytes,
[out]bytes_receivednumber of bytes received
Returns
0 - success, negative otherwise.
int32_t ll_rssi_scan_set ( uint32_t  u1,
uint32_t  u2,
uint32_t  u3,
uint32_t  u4 
)

RSSI Scan set.

Parameters
[in]u1Status u1 (sent little-endian)
[in]u2Status u2 (sent little-endian)
[in]u3Status u3 (sent little-endian)
[in]u4Status u4 (sent little-endian)
Returns
0 - success, negative otherwise
int32_t ll_spreading_factor_set ( uint8_t  sf)

Set the spreading factor for the modulation. Both the receiver and the transmitter must have the same setting.

This function sets the modulation spreading factor and must be a number in the range 6 to 12.

Parameters
[in]sfspreading factor number 6 to 12
Returns
0 - success, negative otherwise
int32_t ll_sync_word_get ( uint8_t *  sync_word)

Get the LoRa sync word.

Get the LoRa sync word.

Parameters
[out]sync_word
Returns
0 - success, negative otherwise.
int32_t ll_sync_word_set ( uint8_t  sync_word)

Set the No MAC sync word.

This function sets the LoRa sync word.

Parameters
[in]sync_word
Returns
0 - success, negative otherwise.
int32_t ll_transmit_cw ( void  )

Commands the module to transmit a CW at the current frequency and power.

int32_t ll_tx_power_get ( int8_t *  pwr)

Get the transmitter output power.

Get the tx output power.

Parameters
[out]pwrtx power in dBm
  • For the low power module, +2 to 20 dBm
  • For the high power module, +10 to 26 dBm
Returns
0 - success, negative otherwise.
int32_t ll_tx_power_set ( int8_t  pwr)

Set the transmitter output power.

This function sets the tx output power.

Parameters
[in]pwrtx power in dBm
  • For the low power module, +2 to 20 dBm
  • For the high power module, +10 to 26 dBm
Returns
0 - success, negative otherwise.