nanolr 2.0.0.0
|
Functions | |
void | nanolr_cfg_setup (nanolr_cfg_t *cfg) |
Config Object Initialization function. | |
NANOLR_RETVAL | nanolr_init (nanolr_t *ctx, nanolr_cfg_t *cfg) |
Initialization function. | |
void | nanolr_default_cfg (nanolr_t *ctx) |
Click Default Configuration function. | |
void | nanolr_reset (nanolr_t *ctx) |
Reset module. | |
void | nanolr_generic_write (nanolr_t *ctx, char *data_buf, uint16_t len) |
Generic write function. | |
int32_t | nanolr_generic_read (nanolr_t *ctx, char *data_buf, uint16_t max_len) |
Generic read function. | |
uint8_t | nanolr_request_2_send (nanolr_t *ctx) |
Request to Send function. | |
void | nanolr_clear_2_send (nanolr_t *ctx, uint8_t state) |
Clear to Send function. | |
uint8_t | nanolr_get_gp1_pin (nanolr_t *ctx) |
Get GP1 pin state function. | |
void | nanolr_set_st_pin (nanolr_t *ctx, uint8_t state) |
Set ST pin state function. | |
void | nanolr_get_device_info (nanolr_t *ctx) |
Get device information function. | |
void | nanolr_get_device_state (nanolr_t *ctx) |
Get device state function. | |
void | nanolr_sw_reset (nanolr_t *ctx) |
Software reset function. | |
void | nanolr_get_fw_ver (nanolr_t *ctx) |
Get firmware version function. | |
void | nanolr_restore_2_factory (nanolr_t *ctx) |
Restore to factory function. | |
void | nanolr_save_settings (nanolr_t *ctx) |
Restore to factory function. | |
void | nanolr_get_output_power (nanolr_t *ctx) |
Get output power function. | |
void | nanolr_get_operating_channel (nanolr_t *ctx) |
Get operating channel function. | |
void | nanolr_set_output_power (nanolr_t *ctx, uint8_t out_pwr) |
Set output power function. | |
void | nanolr_set_operating_channel (nanolr_t *ctx, nanolr_network_t *net) |
Set operating channel function. | |
void | nanolr_save_energy_always_on (nanolr_t *ctx) |
Save energy on function. | |
void | nanolr_save_energy_rx_window (nanolr_t *ctx) |
Save energy rx window function. | |
void | nanolr_save_energy_tx_only (nanolr_t *ctx) |
Save energy tx only function. | |
void | nanolr_get_physical_address (nanolr_t *ctx) |
Get physical address function. | |
void | nanolr_set_physical_address (nanolr_t *ctx, uint8_t *app_eui, uint8_t *dev_eui) |
Set physical address function. | |
void | nanolr_get_network_address (nanolr_t *ctx) |
Get network address function. | |
void | nanolr_set_network_address (nanolr_t *ctx, uint16_t ntw_addr) |
Set network address function. | |
void | nanolr_get_network_id (nanolr_t *ctx) |
Get network identifiers function. | |
void | nanolr_set_network_id (nanolr_t *ctx, uint16_t ntw_id) |
Set network identifiers function. | |
void | nanolr_get_network_role (nanolr_t *ctx) |
Get network role function. | |
void | nanolr_set_network_role (nanolr_t *ctx, uint8_t ntw_role) |
Set network role function. | |
void | nanolr_get_network_auto_settings (nanolr_t *ctx) |
Get network automated settings function. | |
void | nanolr_get_network_preference (nanolr_t *ctx) |
Get network preference function. | |
void | nanolr_set_network_preference (nanolr_t *ctx, uint8_t prot, uint8_t auto_join, uint8_t adr) |
Set network preference function. | |
void | nanolr_get_network_join_mode (nanolr_t *ctx) |
Get network join mode function. | |
void | nanolr_set_network_join_mode (nanolr_t *ctx, uint8_t ntw_join_mode) |
Set network join mode function. | |
void | nanolr_get_battery_level (nanolr_t *ctx) |
Get battery level function. | |
void | nanolr_get_wan_network_type (nanolr_t *ctx) |
Get LRWAN network type function. | |
void | nanolr_wan_network_public (nanolr_t *ctx) |
Set LRWAN network type public function. | |
void | nanolr_wan_network_private (nanolr_t *ctx) |
Set LRWAN network type private function. | |
void | nanolr_network_stop (nanolr_t *ctx) |
Network stop function. | |
void | nanolr_network_start (nanolr_t *ctx) |
Network start function. | |
void | nanolr_send_data (nanolr_t *ctx, uint8_t *tx_data, uint8_t length) |
Send data function. | |
uint8_t | nanolr_rsp_rdy (nanolr_t *ctx) |
Check response ready function. | |
void | nanolr_uart_isr (nanolr_t *ctx) |
UART ISR function. | |
nanolr_err_t | nanolr_parser_rsp (nanolr_t *ctx, nanolr_rsp_t *response) |
Response parser function. | |
void nanolr_cfg_setup | ( | nanolr_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void nanolr_clear_2_send | ( | nanolr_t * | ctx, |
uint8_t | state ) |
Clear to Send function.
ctx | Click object. |
state | 0 : inactive, 1 : active |
@description The function in response the DCE asserts CTS to grant permission.
void nanolr_default_cfg | ( | nanolr_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
@description This function executes default configuration for NanoLR click.
int32_t nanolr_generic_read | ( | nanolr_t * | ctx, |
char * | data_buf, | ||
uint16_t | max_len ) |
Generic read function.
ctx | Click object. |
data_buf | Data buffer for read data. |
max_len | The maximum length of data that can be read. |
@description The function read maximum length of data that is specified
void nanolr_generic_write | ( | nanolr_t * | ctx, |
char * | data_buf, | ||
uint16_t | len ) |
Generic write function.
ctx | Click object. |
data_buf | Data buffer for sends. |
len | Number of bytes for sends. |
@description The function write specific number of data.
void nanolr_get_battery_level | ( | nanolr_t * | ctx | ) |
Get battery level function.
ctx | Click object. |
@description The function the battery level of the module.
void nanolr_get_device_info | ( | nanolr_t * | ctx | ) |
Get device information function.
ctx | Click object. |
@description The function requires device information.
void nanolr_get_device_state | ( | nanolr_t * | ctx | ) |
Get device state function.
ctx | Click object. |
@description The function requires state information.
void nanolr_get_fw_ver | ( | nanolr_t * | ctx | ) |
Get firmware version function.
ctx | Click object. |
@description The function requires device firmware version.
uint8_t nanolr_get_gp1_pin | ( | nanolr_t * | ctx | ) |
Get GP1 pin state function.
ctx | Click object. |
@description The function get states of the GP1 ( PWM ) pin that can handle interrupts.
void nanolr_get_network_address | ( | nanolr_t * | ctx | ) |
Get network address function.
ctx | Click object. |
@description The function retrieve the addresses in use on the module.
- LRWAN Network: To set the network addresses, the payload is a 4 bytes field (sent most significant byte first) indicating the network identifier to be used. When using Over-the-air activation, this param is set during network start. - LREMB Network: When using the LREMB protocol, the network address is 2 Byte long.
void nanolr_get_network_auto_settings | ( | nanolr_t * | ctx | ) |
Get network automated settings function.
ctx | Click object. |
@description The function retrieve the automated settings of the module.
void nanolr_get_network_id | ( | nanolr_t * | ctx | ) |
Get network identifiers function.
ctx | Click object. |
@description The function retrieve the network ID in use on the module.
- LRWAN Network: the EBI �network identifier� is 4 bytes long and corresponds to the �Network ID� identifier. - LREMB Network: In Embit custom radio networks, the Network ID correspond to the �PAN ID� and identifies the specific network in use.
void nanolr_get_network_join_mode | ( | nanolr_t * | ctx | ) |
Get network join mode function.
ctx | Click object. |
@description The function retrieve the network join mode of the module.
void nanolr_get_network_preference | ( | nanolr_t * | ctx | ) |
Get network preference function.
ctx | Click object. |
@description The function retrieve the active network preferences.
void nanolr_get_network_role | ( | nanolr_t * | ctx | ) |
Get network role function.
ctx | Click object. |
@description The function retrieve the selected network role of the module.
void nanolr_get_operating_channel | ( | nanolr_t * | ctx | ) |
Get operating channel function.
ctx | Click object. |
@description The function retrieve the current channel.
void nanolr_get_output_power | ( | nanolr_t * | ctx | ) |
Get output power function.
ctx | Click object. |
@description The function retrieve the current output power.
void nanolr_get_physical_address | ( | nanolr_t * | ctx | ) |
Get physical address function.
ctx | Click object. |
@description The function retrieve the physical address of a module.
void nanolr_get_wan_network_type | ( | nanolr_t * | ctx | ) |
Get LRWAN network type function.
ctx | Click object. |
@description The function retrieve the LRWAN network type of the module: public or private.
NANOLR_RETVAL nanolr_init | ( | nanolr_t * | ctx, |
nanolr_cfg_t * | cfg ) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
void nanolr_network_start | ( | nanolr_t * | ctx | ) |
Network start function.
ctx | Click object. |
@description The function send the commands to start the network.
void nanolr_network_stop | ( | nanolr_t * | ctx | ) |
Network stop function.
ctx | Click object. |
@description The function send the commands to stops the network.
nanolr_err_t nanolr_parser_rsp | ( | nanolr_t * | ctx, |
nanolr_rsp_t * | response ) |
Response parser function.
ctx | Click object. |
@description The function parser device response.
uint8_t nanolr_request_2_send | ( | nanolr_t * | ctx | ) |
Request to Send function.
ctx | Click object. |
@description The function Request to Send indicate a desire to transmit.
void nanolr_reset | ( | nanolr_t * | ctx | ) |
Reset module.
ctx | Click object. |
@description The function resets the module.
void nanolr_restore_2_factory | ( | nanolr_t * | ctx | ) |
Restore to factory function.
ctx | Click object. |
@description The function sends a command to reset the device to factory settings.
uint8_t nanolr_rsp_rdy | ( | nanolr_t * | ctx | ) |
Check response ready function.
ctx | Click object. |
@description The function check if the response is ready.
void nanolr_save_energy_always_on | ( | nanolr_t * | ctx | ) |
Save energy on function.
ctx | Click object. |
@description The function sends a command to set save energy mode: LRWANTM Class C / LREMB reception anytime of the device.
void nanolr_save_energy_rx_window | ( | nanolr_t * | ctx | ) |
Save energy rx window function.
ctx | Click object. |
@description The function sends a command to set save energy mode: LRWANTM Class A / LREMB receive after transmit of the device.
void nanolr_save_energy_tx_only | ( | nanolr_t * | ctx | ) |
Save energy tx only function.
ctx | Click object. |
@description The function sends a command to set save energy mode: LREMB transmit only of the device.
void nanolr_save_settings | ( | nanolr_t * | ctx | ) |
Restore to factory function.
ctx | Click object. |
@description The function sends a command to save the current settings.
void nanolr_send_data | ( | nanolr_t * | ctx, |
uint8_t * | tx_data, | ||
uint8_t | length ) |
Send data function.
ctx | Click object. |
tx_data | pointer to the memory location where tx_data be stored |
length | number of bytes to send |
@description The function the send data command depends on the network protocol chosen.
Send data LREMB broadcast: send options: 0x0000; destination address (broadcast): 0xFFFF; any EMB-EVB boards is configured with reception always enabled, so it is able to receive both direct messages and broadcast messages. The end device usually employs energy save mode (will be implemented in the future).
void nanolr_set_network_address | ( | nanolr_t * | ctx, |
uint16_t | ntw_addr ) |
Set network address function.
ctx | Click object. |
ntw_addr | 16-bit network address |
@description The function set the network addresses.
void nanolr_set_network_id | ( | nanolr_t * | ctx, |
uint16_t | ntw_id ) |
Set network identifiers function.
ctx | Click object. |
ntw_id | 16-bit network ID |
@description The function set the network ID in use on the module.
void nanolr_set_network_join_mode | ( | nanolr_t * | ctx, |
uint8_t | ntw_join_mode ) |
Set network join mode function.
ctx | Click object. |
ntw_join_mode | - 0x00 ( NANOLR_NTW_JOIN_MODE_ABP ) : ABP (activation by personalisation). - 0x01 ( NANOLR_NTW_JOIN_MODE_OTAA ) : OTAA (over-the-air-activation). |
@description The function set network join mode of the module.
void nanolr_set_network_preference | ( | nanolr_t * | ctx, |
uint8_t | prot, | ||
uint8_t | auto_join, | ||
uint8_t | adr ) |
Set network preference function.
ctx | Click object. |
prot | - 0x00 ( NANOLR_NTW_PREFERENCE_PROTOCOL_LR_EMB ) : LREMB network protocol. - 0x80 ( NANOLR_NTW_PREFERENCE_PROTOCOL_LR_WAN ) : LRWAN network protocol. |
auto_join | - 0x00 ( NANOLR_NTW_PREFERENCE_AUTO_JOIN_DISABLE ) : Auto Joining Disabled (Activation By Personalization - ABP). - 0x40 ( NANOLR_NTW_PREFERENCE_AUTO_JOIN_ENABLE ) : Auto Joining Enabled (Over-The-Air Activation - OTAA). |
adr | - 0x00 ( NANOLR_NTW_PREFERENCE_ADAPTIVE_DATA_RATE_DISABLE ) : disable ADR (Adaptive Data Rate) - 0x20 ( NANOLR_NTW_PREFERENCE_ADAPTIVE_DATA_RATE_ENABLE ) : enable ADR (Adaptive Data Rate). |
@description The function set network preferences of the module.
void nanolr_set_network_role | ( | nanolr_t * | ctx, |
uint8_t | ntw_role ) |
Set network role function.
ctx | Click object. |
ntw_role | - 0x00 ( NANOLR_NTW_ROLE_COORDINATOR ) : Coordinator. - 0x02 ( NANOLR_NTW_ROLE_END_DEVICE ) : End Device. |
@description The function set the selected network role of the module.
void nanolr_set_operating_channel | ( | nanolr_t * | ctx, |
nanolr_network_t * | net ) |
Set operating channel function.
ctx | Click object. |
channel | - 0x01 ( NANOLR_OP_CHANNEL_CH_1_868_1MHz ) : 868.100 MHz; - 0x02 ( NANOLR_OP_CHANNEL_CH_2_868_3MHz ) : 868.300 MHz; - 0x03 ( NANOLR_OP_CHANNEL_CH_3_868_5MHz ) : 868.500 MHz; - 0x04 ( NANOLR_OP_CHANNEL_CH_4_869_525MHz ) : 869.525 MHz; |
spreading_factor | - 0x07 ( NANOLR_OP_CHANNEL_SPR_FCT_128 ) : Chips/symbol 128; - 0x08 ( NANOLR_OP_CHANNEL_SPR_FCT_256 ) : Chips/symbol 256; - 0x09 ( NANOLR_OP_CHANNEL_SPR_FCT_512 ) : Chips/symbol 512; - 0x0A ( NANOLR_OP_CHANNEL_SPR_FCT_1024 ) : Chips/symbol 1024; - 0x0B ( NANOLR_OP_CHANNEL_SPR_FCT_2048 ) : Chips/symbol 2048; - 0x0C ( NANOLR_OP_CHANNEL_SPR_FCT_4096 ) : Chips/symbol 4096; |
bandwidth | - 0x00 ( NANOLR_OP_CHANNEL_BANDWIDTH_125KHZ ) : 125 kHz; - 0x01 ( NANOLR_OP_CHANNEL_BANDWIDTH_250KHZ ) : 250 kHz; |
coding_rate | - 0x00 ( NANOLR_OP_CHANNEL_CODING_RATE_4_5 ) : Coding Rate 4/5; - 0x01 ( NANOLR_OP_CHANNEL_CODING_RATE_4_6 ) : Coding Rate 4/6; - 0x02 ( NANOLR_OP_CHANNEL_CODING_RATE_4_7 ) : Coding Rate 4/7; - 0x03 ( NANOLR_OP_CHANNEL_CODING_RATE_4_8 ) : Coding Rate 4/8; |
@description The function set the current channel.
void nanolr_set_output_power | ( | nanolr_t * | ctx, |
uint8_t | out_pwr ) |
Set output power function.
ctx | Click object. |
out_pwr | Output power [+2, +19] dBm |
@description The function retrieve the current output power.
void nanolr_set_physical_address | ( | nanolr_t * | ctx, |
uint8_t * | app_eui, | ||
uint8_t * | dev_eui ) |
Set physical address function.
ctx | Click object. |
app_eui | Pointer to the memory location where app_eui data ( 8 bytes ) be stored |
dev_eui | Pointer to the memory location where dev_eui data ( 8 bytes ) be stored |
@description The function set the physical address of a module.
void nanolr_set_st_pin | ( | nanolr_t * | ctx, |
uint8_t | state ) |
Set ST pin state function.
ctx | Click object. |
state | 0 : inactive, 1 : active |
@description The function set states of the ST ( AN ) pin.
void nanolr_sw_reset | ( | nanolr_t * | ctx | ) |
Software reset function.
ctx | Click object. |
@description The function sends a command for the software reset on the device.
void nanolr_uart_isr | ( | nanolr_t * | ctx | ) |
UART ISR function.
ctx | Click object. |
@description The function read response bytes from the device and sets flag after each received byte.
void nanolr_wan_network_private | ( | nanolr_t * | ctx | ) |
Set LRWAN network type private function.
ctx | Click object. |
@description The function set the LRWAN network type of the module: private.
void nanolr_wan_network_public | ( | nanolr_t * | ctx | ) |
Set LRWAN network type public function.
ctx | Click object. |
@description The function set the LRWAN network type of the module: public.