|
lr4 2.0.0.0
|
Functions | |
| void | lr4_cfg_setup (lr4_cfg_t *cfg) |
| Config Object Initialization function. More... | |
| LR4_RETVAL | lr4_init (lr4_t *ctx, lr4_cfg_t *cfg) |
| Initialization function. More... | |
| int32_t | lr4_generic_read (lr4_t *ctx, char *data_buf, uint16_t max_len) |
| Generic read function. More... | |
| void | lr4_generic_write (lr4_t *ctx, char *data_buf, uint16_t len) |
| Generic write function. More... | |
| void | lr4_hard_reset (lr4_t *ctx) |
| Hardware reset function. More... | |
| void | lr4_wake_up (lr4_t *ctx, uint8_t state) |
| Wake Up function. More... | |
| void | lr4_set_ind_handler (lr4_t *ctx, lr4_ind_hdl_t hdl) |
| Set indication handler function. More... | |
| uint8_t | lr4_command (lr4_t *ctx, lr4_message_t *msg, lr4_message_t *rsp) |
| Command function. More... | |
| uint8_t | lr4_read_message_process (lr4_t *ctx) |
| Process function. More... | |
| LR4_RETVAL | lr4_soft_reset (lr4_t *ctx) |
| Software reset function. More... | |
| LR4_RETVAL | lr4_factory_reset (lr4_t *ctx) |
| Factory reset function. More... | |
| LR4_RETVAL | lr4_write_eeprom (lr4_t *ctx, uint8_t address, uint8_t n_bytes, uint8_t *data_in) |
| EEPROM write function. More... | |
| LR4_RETVAL | lr4_read_eeprom (lr4_t *ctx, uint8_t address, uint8_t n_bytes, uint8_t *data_out) |
| EEPROM read function. More... | |
| LR4_RETVAL | lr4_get_fw_version (lr4_t *ctx, uint32_t *fw_version) |
| Get FW Version function. More... | |
| LR4_RETVAL | lr4_get_serial_no (lr4_t *ctx, uint32_t *serial_no) |
| Get Serial Number function. More... | |
| LR4_RETVAL | lr4_get_dev_eui (lr4_t *ctx, uint8_t *dev_eui) |
| Get DevEUI function. More... | |
| LR4_RETVAL | lr4_join_network (lr4_t *ctx, uint8_t mode) |
| Join Network function. More... | |
| LR4_RETVAL | lr4_get_status (lr4_t *ctx, uint8_t status_mode) |
| Get Status function. More... | |
| LR4_RETVAL | lr4_set_key (lr4_t *ctx, uint8_t *key_data, uint8_t key_mode) |
| Set Key function. More... | |
| LR4_RETVAL | lr4_tx_message (lr4_t *ctx, lr4_tx_msg_t *tx_msg) |
| Radio frame Transmission function. More... | |
| LR4_RETVAL | lr4_set_next_tx_data_rate (lr4_t *ctx, uint8_t data_rate) |
| Set Next Data Rate function. More... | |
| LR4_RETVAL | lr4_set_battery_level (lr4_t *ctx, uint8_t battery_level) |
| Set Battery Level function. More... | |
| LR4_RETVAL | lr4_get_battery_level (lr4_t *ctx) |
| Get Battery Level function. More... | |
| LR4_RETVAL | lr4_set_counter (lr4_t *ctx, uint32_t cnt, uint8_t cnt_mode) |
| Set Counter function. More... | |
| LR4_RETVAL | lr4_get_counter (lr4_t *ctx, uint32_t *cnt, uint8_t cnt_mode) |
| Get Counter function. More... | |
| LR4_RETVAL | lr4_set_channel (lr4_t *ctx, uint8_t index, uint32_t freq, uint8_t data_rate_range, uint8_t status) |
| Set Channel function. More... | |
| uint8_t | lr4_chk_sum (lr4_message_t *cmd) |
| Check sum function. More... | |
| void lr4_cfg_setup | ( | lr4_cfg_t * | cfg | ) |
Config Object Initialization function.
| cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
| uint8_t lr4_chk_sum | ( | lr4_message_t * | cmd | ) |
Check sum function.
| ctx | Click object. |
| cmd | Command structure. |
@description This function returns sum of all elements in Command structure.
| uint8_t lr4_command | ( | lr4_t * | ctx, |
| lr4_message_t * | msg, | ||
| lr4_message_t * | rsp | ||
| ) |
Command function.
| ctx | Click object. |
| msg | Pointer to command buffer |
| rsp | Pointer to output where response will be stored. |
@description Function executes commands and reads response on executed commands. Also checks CRC error report.
| LR4_RETVAL lr4_factory_reset | ( | lr4_t * | ctx | ) |
Factory reset function.
| ctx | Click object. |
@description Function performs the recovery of EEPROM default values.
| int32_t lr4_generic_read | ( | lr4_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 This function read maximum length of data.
| void lr4_generic_write | ( | lr4_t * | ctx, |
| char * | data_buf, | ||
| uint16_t | len | ||
| ) |
Generic write function.
| lr4 | Click object. |
| data_buf | Data buffer for sends. |
| len | Number of bytes for sends. |
| LR4_RETVAL lr4_get_battery_level | ( | lr4_t * | ctx | ) |
Get Battery Level function.
| ctx | Click object. |
@description Function gets Battery Level.
| LR4_RETVAL lr4_get_counter | ( | lr4_t * | ctx, |
| uint32_t * | cnt, | ||
| uint8_t | cnt_mode | ||
| ) |
Get Counter function.
| ctx | Click object. |
| cnt | Pointer to buffer where counter value could be stored |
| cnt_mode | 0 - Get Uplink counter, 1 - Get Downlink counter |
@description Function gets Uplink or Downlink counter.
| LR4_RETVAL lr4_get_dev_eui | ( | lr4_t * | ctx, |
| uint8_t * | dev_eui | ||
| ) |
Get DevEUI function.
| ctx | Click object. |
| dev_eui | Pointer to buffer where devEUI data could be stored |
@description Function gets DevEUI provided by Mipot.
| LR4_RETVAL lr4_get_fw_version | ( | lr4_t * | ctx, |
| uint32_t * | fw_version | ||
| ) |
Get FW Version function.
| ctx | Click object. |
| fw_version | Pointer to buffer where FW Version could be stored |
@description Function gets 32-bit FW version.
| LR4_RETVAL lr4_get_serial_no | ( | lr4_t * | ctx, |
| uint32_t * | serial_no | ||
| ) |
Get Serial Number function.
| ctx | Click object. |
| serial_no | Pointer to buffer where Serial Number could be stored |
@description Function gets 32-bit Serial Number.
| LR4_RETVAL lr4_get_status | ( | lr4_t * | ctx, |
| uint8_t | status_mode | ||
| ) |
Get Status function.
| ctx | Click object. |
| status_mode | 0 - Get Activation Status, 1 - Get Session Status |
@description Function gets the module activation and session status.
| void lr4_hard_reset | ( | lr4_t * | ctx | ) |
Hardware reset function.
| ctx | Click object. |
@description Resets device by setting pin and after that puts device back in normal operation mode.
| LR4_RETVAL lr4_init | ( | lr4_t * | ctx, |
| lr4_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.
| LR4_RETVAL lr4_join_network | ( | lr4_t * | ctx, |
| uint8_t | mode | ||
| ) |
Join Network function.
| ctx | Click object. |
| mode | 0 - Activation by personalization, 1 - Over the air activation |
@description Function performs the join network command.
| LR4_RETVAL lr4_read_eeprom | ( | lr4_t * | ctx, |
| uint8_t | address, | ||
| uint8_t | n_bytes, | ||
| uint8_t * | data_out | ||
| ) |
EEPROM read function.
| ctx | Click object. |
| address | EEPROM Address from which data will be read |
| n_bytes | Number of bytes which will be read (max 254) |
| data_out | Pointer to buffer where data be stored |
@description Function reads data from EEPROM.
| uint8_t lr4_read_message_process | ( | lr4_t * | ctx | ) |
Process function.
| ctx | Click object. |
@description Function executes reading indications and forwards indications to handler.
| LR4_RETVAL lr4_set_battery_level | ( | lr4_t * | ctx, |
| uint8_t | battery_level | ||
| ) |
Set Battery Level function.
| ctx | Click object. |
| battery_level | 0 - The end-device is connected to an external power source The battery level - 1 being at minimum and 254 being at maximum 255 - The end-device was not able to measure battery level |
@description Function sets Battery Level.
| LR4_RETVAL lr4_set_channel | ( | lr4_t * | ctx, |
| uint8_t | index, | ||
| uint32_t | freq, | ||
| uint8_t | data_rate_range, | ||
| uint8_t | status | ||
| ) |
Set Channel function.
| ctx | Click object. |
| index | From 3 to 15 |
| freq | 32-bit frequency value |
| data_rate_range | Data Rate Max is most significant nibble (from 0 to 7) Data Rate Min is less significant nibble (from 0 to 7) |
| status | 0 - Disabled, 1 - Enabled |
@description Function sets channel parameters and enable/disable optional channels.
| LR4_RETVAL lr4_set_counter | ( | lr4_t * | ctx, |
| uint32_t | cnt, | ||
| uint8_t | cnt_mode | ||
| ) |
Set Counter function.
| ctx | Click object. |
| cnt | 32-bit counter value |
| cnt_mode | 0 - Set Uplink counter, 1 - Set Downlink counter |
@description Function sets Uplink or Downlink counter.
| void lr4_set_ind_handler | ( | lr4_t * | ctx, |
| lr4_ind_hdl_t | hdl | ||
| ) |
Set indication handler function.
| ctx | Click object. |
| hdl | Pointer to void handler function |
@description Function reads indications (response) to determined command.
| LR4_RETVAL lr4_set_key | ( | lr4_t * | ctx, |
| uint8_t * | key_data, | ||
| uint8_t | key_mode | ||
| ) |
Set Key function.
| ctx | Click object. |
| key_data | Pointer to buffer which contains key data |
| key_mode | 0 - Set App Key, 1 - Set App Session Key, 2 - Set NWK Session Key |
@description Function sets 16 byte key in Little Endian Order. App key is needed for OTAA procedure, and App Session key and NWK Session key is needed for APB procedure.
| LR4_RETVAL lr4_set_next_tx_data_rate | ( | lr4_t * | ctx, |
| uint8_t | data_rate | ||
| ) |
Set Next Data Rate function.
| ctx | Click object. |
| data_rate | 0 - SF12/125kHz, 1 - SF11/125kHz, 2 - SF10/125kHz, 3 - SF9/125kHz 4 - SF8/125kHz, 5 - SF7/125kHz, 6 - SF7/250kHz, 7 - FSK |
@description Function sets next transmission Data Rate.
| LR4_RETVAL lr4_soft_reset | ( | lr4_t * | ctx | ) |
Software reset function.
| ctx | Click object. |
@description Function resets module by sending command.
| LR4_RETVAL lr4_tx_message | ( | lr4_t * | ctx, |
| lr4_tx_msg_t * | tx_msg | ||
| ) |
Radio frame Transmission function.
| ctx | Click object. |
| tx_msg | Structure arguments:
|
0 - OK, 252 - Payload Length Error, 253 - Check Sum Error, 254 - Response Error,
255 - Header Error, 1 - Device busy, 2 - Device not activated, 3 - Channel blocked by duty-cycle,
5 - Length not supported, 6 - End Node in silent state, 7 - Error@description Function performs the transmission of radio frames.
| void lr4_wake_up | ( | lr4_t * | ctx, |
| uint8_t | state | ||
| ) |
Wake Up function.
| ctx | Click object. |
| state | 0 - wake up, 1 - shutdown |
@description Puts device in shutdown mode or wake up device depending on state.
| LR4_RETVAL lr4_write_eeprom | ( | lr4_t * | ctx, |
| uint8_t | address, | ||
| uint8_t | n_bytes, | ||
| uint8_t * | data_in | ||
| ) |
EEPROM write function.
| ctx | Click object. |
| address | EEPROM Address where data be written |
| n_bytes | Number of bytes which will be written (max 254) |
| data_in | Pointer to buffer which will be written. |
@description Function writes data to EEPROM.