nanolr  2.0.0.0
nanolr.h
Go to the documentation of this file.
1 /*
2  * MikroSDK - MikroE Software Development Kit
3  * Copyright© 2020 MikroElektronika d.o.o.
4  *
5  * Permission is hereby granted, free of charge, to any person
6  * obtaining a copy of this software and associated documentation
7  * files (the "Software"), to deal in the Software without restriction,
8  * including without limitation the rights to use, copy, modify, merge,
9  * publish, distribute, sublicense, and/or sell copies of the Software,
10  * and to permit persons to whom the Software is furnished to do so,
11  * subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be
14  * included in all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
20  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
22  * OR OTHER DEALINGS IN THE SOFTWARE.
23  */
24 
33 // ----------------------------------------------------------------------------
34 
35 #ifndef NANOLR_H
36 #define NANOLR_H
37 
38 #include "mikrosdk_version.h"
39 
40 #ifdef __GNUC__
41 #if mikroSDK_GET_VERSION < 20800ul
42 #include "rcu_delays.h"
43 #else
44 #include "delays.h"
45 #endif
46 #endif
47 
48 #include "drv_digital_out.h"
49 #include "drv_digital_in.h"
50 #include "drv_uart.h"
51 
52 // -------------------------------------------------------------- PUBLIC MACROS
62 #define NANOLR_MAP_MIKROBUS( cfg, mikrobus ) \
63  cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
64  cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
65  cfg.st = MIKROBUS( mikrobus, MIKROBUS_AN ); \
66  cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
67  cfg.cts = MIKROBUS( mikrobus, MIKROBUS_CS ); \
68  cfg.gp1 = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
69  cfg.rts = MIKROBUS( mikrobus, MIKROBUS_INT )
70 
76 #define NANOLR_RETVAL uint8_t
77 
78 #define NANOLR_OK 0x00
79 #define NANOLR_INIT_ERROR 0xFF
80 
86 #define NANOLR_CMD_DEV_INFO 0x01
87 #define NANOLR_CMD_DEV_STATE 0x04
88 #define NANOLR_CMD_RESET 0x05
89 #define NANOLR_CMD_FW_VER 0x06
90 #define NANOLR_CMD_RESTORE_DEF_SETTINGS 0x07
91 #define NANOLR_CMD_SAVE_SETTINGS 0x08
92 #define NANOLR_CMD_SERIAL_PORT_CFG 0x09
93 #define NANOLR_CMD_OUTPUT_POWER 0x10
94 #define NANOLR_CMD_OP_CHAN 0x11
95 #define NANOLR_CMD_ENERGY_SAVE 0x13
96 #define NANOLR_CMD_PHYSICAL_ADR 0x20
97 #define NANOLR_CMD_NETWORK_ADR 0x21
98 #define NANOLR_CMD_NETWORK_ID 0x22
99 #define NANOLR_CMD_NETWORK_ROLE 0x23
100 #define NANOLR_CMD_NETWORK_AUTO_SETTINGS 0x24
101 #define NANOLR_CMD_NETWORK_PREF 0x25
102 #define NANOLR_CMD_NETWORK_SECURITY 0x26
103 #define NANOLR_CMD_NETWORK_JOIN_MODE 0x27
104 #define NANOLR_CMD_NETWORK_STOP 0x30
105 #define NANOLR_CMD_NETWORK_START 0x31
106 #define NANOLR_CMD_SEND_DATA 0x50
107 #define NANOLR_CMD_RECEIVED_DATA 0x60
108 #define NANOLR_CMD_ENTER_BOOTLOADER 0x70
109 
115 #define NANOLR_SET_BOOTLOADER_OPTIONS 0x71
116 #define NANOLR_ERASE_MEM 0x78
117 #define NANOLR_WRITE_MEM_CHUNK 0x7A
118 #define NANOLR_READ_MEM_CHUNK 0x7B
119 #define NANOLR_COMMIT_FW 0x7F
120 
126 #define NANOLR_SUCCESS 0x00
127 #define NANOLR_GENERIC_ERROR 0x01
128 #define NANOLR_PARAM_NOT_ACCEPTED 0x02
129 #define NANOLR_OPERATION_TIMEOUT 0x03
130 #define NANOLR_NO_MEMORY 0x04
131 #define NANOLR_UNSUPPORTED 0x05
132 #define NANOLR_BUSY 0x06
133 
139 #define NANOLR_DEV_INFO_RESP 0x81
140 #define NANOLR_DEV_STATE_RESP 0x84
141 #define NANOLR_RESET_RESP 0x85
142 #define NANOLR_FW_VER_RESP 0x86
143 #define NANOLR_RESTORE_DEF_SETTINGS_RESP 0x87
144 #define NANOLR_SAVE_SETTINGS_RESP 0x88
145 #define NANOLR_SERIAL_PORT_CFG_RESP 0x89
146 #define NANOLR_OUTPUT_POWER_RESP 0x90
147 #define NANOLR_OP_CHAN_RESP 0x91
148 #define NANOLR_ENERGY_SAVE_RESP 0x93
149 #define NANOLR_PHYSICAL_ADR_RESP 0xA0
150 #define NANOLR_NETWORK_ADR_RESP 0xA1
151 #define NANOLR_NETWORK_ID_RESP 0xA2
152 #define NANOLR_NETWORK_ROLE_RESP 0xA3
153 #define NANOLR_NETWORK_AUTO_SETTINGS_RESP 0xA4
154 #define NANOLR_NETWORK_PREF_RESP 0xA5
155 #define NANOLR_NETWORK_SECURITY_RESP 0xA6
156 
162 #define NANOLR_BAUD_RATE_MAINTAIN_SPEED 0x00
163 #define NANOLR_BAUD_RATE_1200 0x01
164 #define NANOLR_BAUD_RATE_2400 0x02
165 #define NANOLR_BAUD_RATE_4800 0x03
166 #define NANOLR_BAUD_RATE_9600 0x04
167 #define NANOLR_BAUD_RATE_19200 0x05
168 #define NANOLR_BAUD_RATE_38400 0x06
169 #define NANOLR_BAUD_RATE_57600 0x07
170 #define NANOLR_BAUD_RATE_115200 0x08
171 
177 #define NANOLR_DEVICE_ID_UNKNOWN 0x00
178 #define NANOLR_DEVICE_ID_EMB_ZRF2XX 0x20
179 #define NANOLR_DEVICE_ID_EMB_ZRF231XX 0x24
180 #define NANOLR_DEVICE_ID_EMB_ZRF231PA 0x26
181 #define NANOLR_DEVICE_ID_EMB_ZRF212XX 0x28
182 #define NANOLR_DEVICE_ID_EMB_ZRF212B 0x29
183 #define NANOLR_DEVICE_ID_EMB_Z253X 0x30
184 #define NANOLR_DEVICE_ID_EMB_Z2530X 0x34
185 #define NANOLR_DEVICE_ID_EMB_Z2530PA 0x36
186 #define NANOLR_DEVICE_ID_EMB_Z2531X 0x38
187 #define NANOLR_DEVICE_ID_EMB_Z2531PA_USB 0x3A
188 #define NANOLR_DEVICE_ID_EMB_Z2538X 0x3C
189 #define NANOLR_DEVICE_ID_EMB_Z2538PA 0x3D
190 #define NANOLR_DEVICE_ID_EMB_WMBX 0x40
191 #define NANOLR_DEVICE_ID_EMB_WMB169X 0x44
192 #define NANOLR_DEVICE_ID_EMB_WMB169T 0x45
193 #define NANOLR_DEVICE_ID_EMB_WMB169PA 0x46
194 #define NANOLR_DEVICE_ID_EMB_WMB868X 0x48
195 #define NANOLR_DEVICE_ID_EMB_WMB868 0x49
196 #define NANOLR_DEVICE_ID_EMB_LRX 0x50
197 #define NANOLR_DEVICE_ID_EMB_LR1272 0x54
198 
204 #define NANOLR_NETWORK_ROLE_COORDINATOR 0x00
205 #define NANOLR_NETWORK_ROLE_RESERVED 0x01
206 #define NANOLR_NETWORK_ROLE_END_DEV 0x02
207 
213 #define NANOLR_DEV_STATE_BOOTING 0x00
214 #define NANOLR_DEV_STATE_INSIDE_BOOTLOADER 0x01
215 #define NANOLR_DEV_STATE_RDY_STARTUP_OP_SUCC 0x10
216 #define NANOLR_DEV_STATE_RDY_STARTUP_OP_FAILED 0x11
217 #define NANOLR_DEV_STATE_OFFLINE 0x20
218 #define NANOLR_DEV_STATE_CONNECTING 0x21
219 #define NANOLR_DEV_STATE_TRANSPARENT_MODE_STARTUP 0x22
220 #define NANOLR_DEV_STATE_ONLINE 0x30
221 #define NANOLR_DEV_STATE_DISCONNECTING 0x40
222 #define NANOLR_DEV_STATE_RESERVED 0x50
223 #define NANOLR_DEV_STATE_END_RECEIVING_WINDOW 0x51
224 
230 #define NANOLR_ENERGY_SAVE_MODE_ALWAYS_ON 0x00
231 #define NANOLR_ENERGY_SAVE_MODE_RX_WINDOW 0x01
232 #define NANOLR_ENERGY_SAVE_MODE_TX_ONLY 0x02
233 
239 #define NANOLR_OP_CHANNEL_CH_1_868_1MHz 0x01
240 #define NANOLR_OP_CHANNEL_CH_2_868_3MHz 0x02
241 #define NANOLR_OP_CHANNEL_CH_3_868_5MHz 0x03
242 #define NANOLR_OP_CHANNEL_CH_4_869_525MHz 0x04
243 #define NANOLR_OP_CHANNEL_SPR_FCT_128 0x07
244 #define NANOLR_OP_CHANNEL_SPR_FCT_256 0x08
245 #define NANOLR_OP_CHANNEL_SPR_FCT_512 0x09
246 #define NANOLR_OP_CHANNEL_SPR_FCT_1024 0x0A
247 #define NANOLR_OP_CHANNEL_SPR_FCT_2048 0x0B
248 #define NANOLR_OP_CHANNEL_SPR_FCT_4096 0x0C
249 #define NANOLR_OP_CHANNEL_BANDWIDTH_125KHz 0x00
250 #define NANOLR_OP_CHANNEL_BANDWIDTH_250KHz 0x01
251 #define NANOLR_OP_CHANNEL_CODING_RATE_4_5 0x01
252 #define NANOLR_OP_CHANNEL_CODING_RATE_4_6 0x02
253 #define NANOLR_OP_CHANNEL_CODING_RATE_4_7 0x03
254 #define NANOLR_OP_CHANNEL_CODING_RATE_4_8 0x04
255 
261 #define NANOLR_NTW_ROLE_COORDINATOR 0x00
262 #define NANOLR_NTW_ROLE_END_DEVICE 0x02
263 
269 #define NANOLR_NTW_PREFERENCE_PROTOCOL_LR_EMB 0x00
270 #define NANOLR_NTW_PREFERENCE_PROTOCOL_LR_WAN 0x80
271 #define NANOLR_NTW_PREFERENCE_AUTO_JOIN_DISABLE 0x00
272 #define NANOLR_NTW_PREFERENCE_AUTO_JOIN_ENABLE 0x40
273 #define NANOLR_NTW_PREFERENCE_ADAPTIVE_DATA_RATE_DISABLE 0x00
274 #define NANOLR_NTW_PREFERENCE_ADAPTIVE_DATA_RATE_ENABLE 0x20
275 
281 #define NANOLR_NTW_JOIN_MODE_ABP 0x00
282 #define NANOLR_NTW_JOIN_MODE_OTAA 0x01
283 
284 #define NANOLR_RSP_READY 0x01
285 #define NANOLR_RSP_NOT_READY 0x00
286 
287 #define NANOLR_ERR_CRC 0x01
288 #define NANOLR_ERR_STATUS_OK 0x00
289 
295 #define DRV_RX_BUFFER_SIZE 500
296  // End group macro
299 // --------------------------------------------------------------- PUBLIC TYPES
309 #define nanolr_err_t uint8_t
310 
314 typedef struct
315 {
316  // Output pins
317 
318  digital_out_t st;
319  digital_out_t rst;
320  digital_out_t cts;
321 
322  // Input pins
323 
324  digital_in_t gp1;
325  digital_in_t rts;
326 
327  // Modules
328 
329  uart_t uart;
330 
331  char uart_rx_buffer[ DRV_RX_BUFFER_SIZE ];
332  char uart_tx_buffer[ DRV_RX_BUFFER_SIZE ];
333 
334  char rx_data[ 256 ];
335  uint16_t rsp_len;
336  uint8_t rsp_rdy;
337 
338 } nanolr_t;
339 
343 typedef struct
344 {
345  // Communication gpio pins
346 
347  pin_name_t rx_pin;
348  pin_name_t tx_pin;
349 
350  // Additional gpio pins
351 
352  pin_name_t st;
353  pin_name_t rst;
354  pin_name_t cts;
355  pin_name_t gp1;
356  pin_name_t rts;
357 
358  // static variable
359 
360  uint32_t baud_rate; // Clock speed.
362  uart_data_bits_t data_bit; // Data bits.
363  uart_parity_t parity_bit; // Parity bit.
364  uart_stop_bits_t stop_bit; // Stop bits.
365 
366 } nanolr_cfg_t;
367 
371 typedef struct
372 {
373  uint16_t length;
374  uint8_t message_id;
375  uint8_t payload[ 256 ];
376  uint8_t crc;
377 
378 } nanolr_rsp_t;
379 
383 typedef struct
384 {
385  uint8_t channel;
387  uint8_t bandwidth;
388  uint8_t coding_rate;
389 
391  // End types group
393 // ----------------------------------------------- PUBLIC FUNCTION DECLARATIONS
394 
400 #ifdef __cplusplus
401 extern "C"{
402 #endif
403 
413 
423 
432 
440 void nanolr_reset ( nanolr_t *ctx );
441 
451 void nanolr_generic_write ( nanolr_t *ctx, char *data_buf, uint16_t len );
452 
464 int32_t nanolr_generic_read ( nanolr_t *ctx, char *data_buf, uint16_t max_len );
465 
476 
485 void nanolr_clear_2_send ( nanolr_t *ctx, uint8_t state );
486 
496 uint8_t nanolr_get_gp1_pin ( nanolr_t *ctx );
497 
506 void nanolr_set_st_pin ( nanolr_t *ctx, uint8_t state );
507 
516 
525 
533 void nanolr_sw_reset ( nanolr_t *ctx );
534 
543 
552 
561 
570 
579 
588 void nanolr_set_output_power ( nanolr_t *ctx, uint8_t out_pwr );
589 
632 
643 
653 
663 
672 
684 void nanolr_set_physical_address ( nanolr_t *ctx, uint8_t *app_eui, uint8_t *dev_eui );
685 
704 
717 void nanolr_set_network_address ( nanolr_t *ctx, uint16_t ntw_addr );
718 
736 
745 void nanolr_set_network_id ( nanolr_t *ctx, uint16_t ntw_id );
746 
755 
771 void nanolr_set_network_role ( nanolr_t *ctx, uint8_t ntw_role );
772 
781 
790 
821 void nanolr_set_network_preference ( nanolr_t *ctx, uint8_t prot, uint8_t auto_join, uint8_t adr );
822 
831 
844 void nanolr_set_network_join_mode ( nanolr_t *ctx, uint8_t ntw_join_mode );
845 
854 
863 
872 
882 
891 
900 
921 void nanolr_send_data ( nanolr_t *ctx, uint8_t *tx_data, uint8_t length );
922 
932 uint8_t nanolr_rsp_rdy ( nanolr_t *ctx );
933 
942 void nanolr_uart_isr ( nanolr_t *ctx );
943 
954 
955 #ifdef __cplusplus
956 }
957 #endif
958 #endif // _NANOLR_H_
959  // End public_function group
962 
963 // ------------------------------------------------------------------------- END
nanolr_get_wan_network_type
void nanolr_get_wan_network_type(nanolr_t *ctx)
Get LRWAN network type function.
DRV_RX_BUFFER_SIZE
#define DRV_RX_BUFFER_SIZE
Definition: nanolr.h:295
nanolr_cfg_setup
void nanolr_cfg_setup(nanolr_cfg_t *cfg)
Config Object Initialization function.
nanolr_network_t::spreading_factor
uint8_t spreading_factor
Definition: nanolr.h:386
nanolr_cfg_t
Click configuration structure definition.
Definition: nanolr.h:344
nanolr_get_operating_channel
void nanolr_get_operating_channel(nanolr_t *ctx)
Get operating channel function.
nanolr_get_network_address
void nanolr_get_network_address(nanolr_t *ctx)
Get network address function.
nanolr_set_network_preference
void nanolr_set_network_preference(nanolr_t *ctx, uint8_t prot, uint8_t auto_join, uint8_t adr)
Set network preference function.
nanolr_network_t::coding_rate
uint8_t coding_rate
Definition: nanolr.h:388
nanolr_t::cts
digital_out_t cts
Definition: nanolr.h:320
nanolr_clear_2_send
void nanolr_clear_2_send(nanolr_t *ctx, uint8_t state)
Clear to Send function.
nanolr_t
Click ctx object definition.
Definition: nanolr.h:315
nanolr_request_2_send
uint8_t nanolr_request_2_send(nanolr_t *ctx)
Request to Send function.
nanolr_rsp_t::length
uint16_t length
Definition: nanolr.h:373
nanolr_rsp_t::message_id
uint8_t message_id
Definition: nanolr.h:374
nanolr_cfg_t::tx_pin
pin_name_t tx_pin
Definition: nanolr.h:348
nanolr_cfg_t::rts
pin_name_t rts
Definition: nanolr.h:356
nanolr_save_energy_tx_only
void nanolr_save_energy_tx_only(nanolr_t *ctx)
Save energy tx only function.
nanolr_get_network_preference
void nanolr_get_network_preference(nanolr_t *ctx)
Get network preference function.
nanolr_cfg_t::rst
pin_name_t rst
Definition: nanolr.h:353
NANOLR_RETVAL
#define NANOLR_RETVAL
Definition: nanolr.h:76
nanolr_save_settings
void nanolr_save_settings(nanolr_t *ctx)
Restore to factory function.
nanolr_get_battery_level
void nanolr_get_battery_level(nanolr_t *ctx)
Get battery level function.
nanolr_cfg_t::cts
pin_name_t cts
Definition: nanolr.h:354
nanolr_t::rsp_len
uint16_t rsp_len
Definition: nanolr.h:335
nanolr_set_network_id
void nanolr_set_network_id(nanolr_t *ctx, uint16_t ntw_id)
Set network identifiers function.
nanolr_cfg_t::gp1
pin_name_t gp1
Definition: nanolr.h:355
nanolr_restore_2_factory
void nanolr_restore_2_factory(nanolr_t *ctx)
Restore to factory function.
nanolr_t::rts
digital_in_t rts
Definition: nanolr.h:325
nanolr_sw_reset
void nanolr_sw_reset(nanolr_t *ctx)
Software reset function.
nanolr_get_network_role
void nanolr_get_network_role(nanolr_t *ctx)
Get network role function.
nanolr_t::uart
uart_t uart
Definition: nanolr.h:329
nanolr_cfg_t::uart_blocking
bool uart_blocking
Definition: nanolr.h:361
nanolr_get_device_info
void nanolr_get_device_info(nanolr_t *ctx)
Get device information function.
nanolr_t::rst
digital_out_t rst
Definition: nanolr.h:319
nanolr_rsp_rdy
uint8_t nanolr_rsp_rdy(nanolr_t *ctx)
Check response ready function.
nanolr_set_network_address
void nanolr_set_network_address(nanolr_t *ctx, uint16_t ntw_addr)
Set network address function.
nanolr_wan_network_public
void nanolr_wan_network_public(nanolr_t *ctx)
Set LRWAN network type public function.
nanolr_set_output_power
void nanolr_set_output_power(nanolr_t *ctx, uint8_t out_pwr)
Set output power function.
nanolr_wan_network_private
void nanolr_wan_network_private(nanolr_t *ctx)
Set LRWAN network type private function.
nanolr_network_start
void nanolr_network_start(nanolr_t *ctx)
Network start function.
nanolr_reset
void nanolr_reset(nanolr_t *ctx)
Reset module.
nanolr_get_gp1_pin
uint8_t nanolr_get_gp1_pin(nanolr_t *ctx)
Get GP1 pin state function.
nanolr_get_physical_address
void nanolr_get_physical_address(nanolr_t *ctx)
Get physical address function.
nanolr_cfg_t::stop_bit
uart_stop_bits_t stop_bit
Definition: nanolr.h:364
nanolr_set_network_join_mode
void nanolr_set_network_join_mode(nanolr_t *ctx, uint8_t ntw_join_mode)
Set network join mode function.
nanolr_network_t
Click network structure definition.
Definition: nanolr.h:384
nanolr_get_network_id
void nanolr_get_network_id(nanolr_t *ctx)
Get network identifiers function.
nanolr_default_cfg
void nanolr_default_cfg(nanolr_t *ctx)
Click Default Configuration function.
nanolr_send_data
void nanolr_send_data(nanolr_t *ctx, uint8_t *tx_data, uint8_t length)
Send data function.
nanolr_set_network_role
void nanolr_set_network_role(nanolr_t *ctx, uint8_t ntw_role)
Set network role function.
nanolr_network_t::channel
uint8_t channel
Definition: nanolr.h:385
nanolr_rsp_t
Click response structure definition.
Definition: nanolr.h:372
nanolr_cfg_t::data_bit
uart_data_bits_t data_bit
Definition: nanolr.h:362
nanolr_save_energy_always_on
void nanolr_save_energy_always_on(nanolr_t *ctx)
Save energy on function.
nanolr_get_network_join_mode
void nanolr_get_network_join_mode(nanolr_t *ctx)
Get network join mode function.
nanolr_get_fw_ver
void nanolr_get_fw_ver(nanolr_t *ctx)
Get firmware version function.
nanolr_t::rsp_rdy
uint8_t rsp_rdy
Definition: nanolr.h:336
nanolr_cfg_t::st
pin_name_t st
Definition: nanolr.h:352
nanolr_uart_isr
void nanolr_uart_isr(nanolr_t *ctx)
UART ISR function.
nanolr_set_physical_address
void nanolr_set_physical_address(nanolr_t *ctx, uint8_t *app_eui, uint8_t *dev_eui)
Set physical address function.
nanolr_get_network_auto_settings
void nanolr_get_network_auto_settings(nanolr_t *ctx)
Get network automated settings function.
nanolr_network_stop
void nanolr_network_stop(nanolr_t *ctx)
Network stop function.
nanolr_cfg_t::rx_pin
pin_name_t rx_pin
Definition: nanolr.h:347
nanolr_rsp_t::crc
uint8_t crc
Definition: nanolr.h:376
nanolr_err_t
#define nanolr_err_t
Driver Error type.
Definition: nanolr.h:309
nanolr_cfg_t::baud_rate
uint32_t baud_rate
Definition: nanolr.h:360
nanolr_t::gp1
digital_in_t gp1
Definition: nanolr.h:324
nanolr_save_energy_rx_window
void nanolr_save_energy_rx_window(nanolr_t *ctx)
Save energy rx window function.
nanolr_get_output_power
void nanolr_get_output_power(nanolr_t *ctx)
Get output power function.
nanolr_set_operating_channel
void nanolr_set_operating_channel(nanolr_t *ctx, nanolr_network_t *net)
Set operating channel function.
nanolr_network_t::bandwidth
uint8_t bandwidth
Definition: nanolr.h:387
nanolr_set_st_pin
void nanolr_set_st_pin(nanolr_t *ctx, uint8_t state)
Set ST pin state function.
nanolr_parser_rsp
nanolr_err_t nanolr_parser_rsp(nanolr_t *ctx, nanolr_rsp_t *response)
Response parser function.
nanolr_cfg_t::parity_bit
uart_parity_t parity_bit
Definition: nanolr.h:363
nanolr_t::st
digital_out_t st
Definition: nanolr.h:318
nanolr_init
NANOLR_RETVAL nanolr_init(nanolr_t *ctx, nanolr_cfg_t *cfg)
Initialization function.
nanolr_generic_read
int32_t nanolr_generic_read(nanolr_t *ctx, char *data_buf, uint16_t max_len)
Generic read function.
nanolr_generic_write
void nanolr_generic_write(nanolr_t *ctx, char *data_buf, uint16_t len)
Generic write function.
nanolr_get_device_state
void nanolr_get_device_state(nanolr_t *ctx)
Get device state function.