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 
42 #ifdef PREINIT_SUPPORTED
43 #include "preinit.h"
44 #endif
45 
46 #ifdef MikroCCoreVersion
47  #if MikroCCoreVersion >= 1
48  #include "delays.h"
49  #endif
50 #endif
51 
52 #include "drv_digital_out.h"
53 #include "drv_digital_in.h"
54 #include "drv_uart.h"
55 
56 // -------------------------------------------------------------- PUBLIC MACROS
66 #define NANOLR_MAP_MIKROBUS( cfg, mikrobus ) \
67  cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
68  cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
69  cfg.st = MIKROBUS( mikrobus, MIKROBUS_AN ); \
70  cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
71  cfg.cts = MIKROBUS( mikrobus, MIKROBUS_CS ); \
72  cfg.gp1 = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
73  cfg.rts = MIKROBUS( mikrobus, MIKROBUS_INT )
74 
80 #define NANOLR_RETVAL uint8_t
81 
82 #define NANOLR_OK 0x00
83 #define NANOLR_INIT_ERROR 0xFF
84 
90 #define NANOLR_CMD_DEV_INFO 0x01
91 #define NANOLR_CMD_DEV_STATE 0x04
92 #define NANOLR_CMD_RESET 0x05
93 #define NANOLR_CMD_FW_VER 0x06
94 #define NANOLR_CMD_RESTORE_DEF_SETTINGS 0x07
95 #define NANOLR_CMD_SAVE_SETTINGS 0x08
96 #define NANOLR_CMD_SERIAL_PORT_CFG 0x09
97 #define NANOLR_CMD_OUTPUT_POWER 0x10
98 #define NANOLR_CMD_OP_CHAN 0x11
99 #define NANOLR_CMD_ENERGY_SAVE 0x13
100 #define NANOLR_CMD_PHYSICAL_ADR 0x20
101 #define NANOLR_CMD_NETWORK_ADR 0x21
102 #define NANOLR_CMD_NETWORK_ID 0x22
103 #define NANOLR_CMD_NETWORK_ROLE 0x23
104 #define NANOLR_CMD_NETWORK_AUTO_SETTINGS 0x24
105 #define NANOLR_CMD_NETWORK_PREF 0x25
106 #define NANOLR_CMD_NETWORK_SECURITY 0x26
107 #define NANOLR_CMD_NETWORK_JOIN_MODE 0x27
108 #define NANOLR_CMD_NETWORK_STOP 0x30
109 #define NANOLR_CMD_NETWORK_START 0x31
110 #define NANOLR_CMD_SEND_DATA 0x50
111 #define NANOLR_CMD_RECEIVED_DATA 0x60
112 #define NANOLR_CMD_ENTER_BOOTLOADER 0x70
113 
119 #define NANOLR_SET_BOOTLOADER_OPTIONS 0x71
120 #define NANOLR_ERASE_MEM 0x78
121 #define NANOLR_WRITE_MEM_CHUNK 0x7A
122 #define NANOLR_READ_MEM_CHUNK 0x7B
123 #define NANOLR_COMMIT_FW 0x7F
124 
130 #define NANOLR_SUCCESS 0x00
131 #define NANOLR_GENERIC_ERROR 0x01
132 #define NANOLR_PARAM_NOT_ACCEPTED 0x02
133 #define NANOLR_OPERATION_TIMEOUT 0x03
134 #define NANOLR_NO_MEMORY 0x04
135 #define NANOLR_UNSUPPORTED 0x05
136 #define NANOLR_BUSY 0x06
137 
143 #define NANOLR_DEV_INFO_RESP 0x81
144 #define NANOLR_DEV_STATE_RESP 0x84
145 #define NANOLR_RESET_RESP 0x85
146 #define NANOLR_FW_VER_RESP 0x86
147 #define NANOLR_RESTORE_DEF_SETTINGS_RESP 0x87
148 #define NANOLR_SAVE_SETTINGS_RESP 0x88
149 #define NANOLR_SERIAL_PORT_CFG_RESP 0x89
150 #define NANOLR_OUTPUT_POWER_RESP 0x90
151 #define NANOLR_OP_CHAN_RESP 0x91
152 #define NANOLR_ENERGY_SAVE_RESP 0x93
153 #define NANOLR_PHYSICAL_ADR_RESP 0xA0
154 #define NANOLR_NETWORK_ADR_RESP 0xA1
155 #define NANOLR_NETWORK_ID_RESP 0xA2
156 #define NANOLR_NETWORK_ROLE_RESP 0xA3
157 #define NANOLR_NETWORK_AUTO_SETTINGS_RESP 0xA4
158 #define NANOLR_NETWORK_PREF_RESP 0xA5
159 #define NANOLR_NETWORK_SECURITY_RESP 0xA6
160 
166 #define NANOLR_BAUD_RATE_MAINTAIN_SPEED 0x00
167 #define NANOLR_BAUD_RATE_1200 0x01
168 #define NANOLR_BAUD_RATE_2400 0x02
169 #define NANOLR_BAUD_RATE_4800 0x03
170 #define NANOLR_BAUD_RATE_9600 0x04
171 #define NANOLR_BAUD_RATE_19200 0x05
172 #define NANOLR_BAUD_RATE_38400 0x06
173 #define NANOLR_BAUD_RATE_57600 0x07
174 #define NANOLR_BAUD_RATE_115200 0x08
175 
181 #define NANOLR_DEVICE_ID_UNKNOWN 0x00
182 #define NANOLR_DEVICE_ID_EMB_ZRF2XX 0x20
183 #define NANOLR_DEVICE_ID_EMB_ZRF231XX 0x24
184 #define NANOLR_DEVICE_ID_EMB_ZRF231PA 0x26
185 #define NANOLR_DEVICE_ID_EMB_ZRF212XX 0x28
186 #define NANOLR_DEVICE_ID_EMB_ZRF212B 0x29
187 #define NANOLR_DEVICE_ID_EMB_Z253X 0x30
188 #define NANOLR_DEVICE_ID_EMB_Z2530X 0x34
189 #define NANOLR_DEVICE_ID_EMB_Z2530PA 0x36
190 #define NANOLR_DEVICE_ID_EMB_Z2531X 0x38
191 #define NANOLR_DEVICE_ID_EMB_Z2531PA_USB 0x3A
192 #define NANOLR_DEVICE_ID_EMB_Z2538X 0x3C
193 #define NANOLR_DEVICE_ID_EMB_Z2538PA 0x3D
194 #define NANOLR_DEVICE_ID_EMB_WMBX 0x40
195 #define NANOLR_DEVICE_ID_EMB_WMB169X 0x44
196 #define NANOLR_DEVICE_ID_EMB_WMB169T 0x45
197 #define NANOLR_DEVICE_ID_EMB_WMB169PA 0x46
198 #define NANOLR_DEVICE_ID_EMB_WMB868X 0x48
199 #define NANOLR_DEVICE_ID_EMB_WMB868 0x49
200 #define NANOLR_DEVICE_ID_EMB_LRX 0x50
201 #define NANOLR_DEVICE_ID_EMB_LR1272 0x54
202 
208 #define NANOLR_NETWORK_ROLE_COORDINATOR 0x00
209 #define NANOLR_NETWORK_ROLE_RESERVED 0x01
210 #define NANOLR_NETWORK_ROLE_END_DEV 0x02
211 
217 #define NANOLR_DEV_STATE_BOOTING 0x00
218 #define NANOLR_DEV_STATE_INSIDE_BOOTLOADER 0x01
219 #define NANOLR_DEV_STATE_RDY_STARTUP_OP_SUCC 0x10
220 #define NANOLR_DEV_STATE_RDY_STARTUP_OP_FAILED 0x11
221 #define NANOLR_DEV_STATE_OFFLINE 0x20
222 #define NANOLR_DEV_STATE_CONNECTING 0x21
223 #define NANOLR_DEV_STATE_TRANSPARENT_MODE_STARTUP 0x22
224 #define NANOLR_DEV_STATE_ONLINE 0x30
225 #define NANOLR_DEV_STATE_DISCONNECTING 0x40
226 #define NANOLR_DEV_STATE_RESERVED 0x50
227 #define NANOLR_DEV_STATE_END_RECEIVING_WINDOW 0x51
228 
234 #define NANOLR_ENERGY_SAVE_MODE_ALWAYS_ON 0x00
235 #define NANOLR_ENERGY_SAVE_MODE_RX_WINDOW 0x01
236 #define NANOLR_ENERGY_SAVE_MODE_TX_ONLY 0x02
237 
243 #define NANOLR_OP_CHANNEL_CH_1_868_1MHz 0x01
244 #define NANOLR_OP_CHANNEL_CH_2_868_3MHz 0x02
245 #define NANOLR_OP_CHANNEL_CH_3_868_5MHz 0x03
246 #define NANOLR_OP_CHANNEL_CH_4_869_525MHz 0x04
247 #define NANOLR_OP_CHANNEL_SPR_FCT_128 0x07
248 #define NANOLR_OP_CHANNEL_SPR_FCT_256 0x08
249 #define NANOLR_OP_CHANNEL_SPR_FCT_512 0x09
250 #define NANOLR_OP_CHANNEL_SPR_FCT_1024 0x0A
251 #define NANOLR_OP_CHANNEL_SPR_FCT_2048 0x0B
252 #define NANOLR_OP_CHANNEL_SPR_FCT_4096 0x0C
253 #define NANOLR_OP_CHANNEL_BANDWIDTH_125KHz 0x00
254 #define NANOLR_OP_CHANNEL_BANDWIDTH_250KHz 0x01
255 #define NANOLR_OP_CHANNEL_CODING_RATE_4_5 0x01
256 #define NANOLR_OP_CHANNEL_CODING_RATE_4_6 0x02
257 #define NANOLR_OP_CHANNEL_CODING_RATE_4_7 0x03
258 #define NANOLR_OP_CHANNEL_CODING_RATE_4_8 0x04
259 
265 #define NANOLR_NTW_ROLE_COORDINATOR 0x00
266 #define NANOLR_NTW_ROLE_END_DEVICE 0x02
267 
273 #define NANOLR_NTW_PREFERENCE_PROTOCOL_LR_EMB 0x00
274 #define NANOLR_NTW_PREFERENCE_PROTOCOL_LR_WAN 0x80
275 #define NANOLR_NTW_PREFERENCE_AUTO_JOIN_DISABLE 0x00
276 #define NANOLR_NTW_PREFERENCE_AUTO_JOIN_ENABLE 0x40
277 #define NANOLR_NTW_PREFERENCE_ADAPTIVE_DATA_RATE_DISABLE 0x00
278 #define NANOLR_NTW_PREFERENCE_ADAPTIVE_DATA_RATE_ENABLE 0x20
279 
285 #define NANOLR_NTW_JOIN_MODE_ABP 0x00
286 #define NANOLR_NTW_JOIN_MODE_OTAA 0x01
287 
288 #define NANOLR_RSP_READY 0x01
289 #define NANOLR_RSP_NOT_READY 0x00
290 
291 #define NANOLR_ERR_CRC 0x01
292 #define NANOLR_ERR_STATUS_OK 0x00
293 
299 #define DRV_RX_BUFFER_SIZE 500
300  // End group macro
303 // --------------------------------------------------------------- PUBLIC TYPES
313 #define nanolr_err_t uint8_t
314 
318 typedef struct
319 {
320  // Output pins
321 
322  digital_out_t st;
323  digital_out_t rst;
324  digital_out_t cts;
325 
326  // Input pins
327 
328  digital_in_t gp1;
329  digital_in_t rts;
330 
331  // Modules
332 
333  uart_t uart;
334 
335  char uart_rx_buffer[ DRV_RX_BUFFER_SIZE ];
336  char uart_tx_buffer[ DRV_RX_BUFFER_SIZE ];
337 
338  char rx_data[ 256 ];
339  uint16_t rsp_len;
340  uint8_t rsp_rdy;
341 
342 } nanolr_t;
343 
347 typedef struct
348 {
349  // Communication gpio pins
350 
351  pin_name_t rx_pin;
352  pin_name_t tx_pin;
353 
354  // Additional gpio pins
355 
356  pin_name_t st;
357  pin_name_t rst;
358  pin_name_t cts;
359  pin_name_t gp1;
360  pin_name_t rts;
361 
362  // static variable
363 
364  uint32_t baud_rate; // Clock speed.
366  uart_data_bits_t data_bit; // Data bits.
367  uart_parity_t parity_bit; // Parity bit.
368  uart_stop_bits_t stop_bit; // Stop bits.
369 
370 } nanolr_cfg_t;
371 
375 typedef struct
376 {
377  uint16_t length;
378  uint8_t message_id;
379  uint8_t payload[ 256 ];
380  uint8_t crc;
381 
382 } nanolr_rsp_t;
383 
387 typedef struct
388 {
389  uint8_t channel;
391  uint8_t bandwidth;
392  uint8_t coding_rate;
393 
395  // End types group
397 // ----------------------------------------------- PUBLIC FUNCTION DECLARATIONS
398 
404 #ifdef __cplusplus
405 extern "C"{
406 #endif
407 
417 
427 
436 
444 void nanolr_reset ( nanolr_t *ctx );
445 
455 void nanolr_generic_write ( nanolr_t *ctx, char *data_buf, uint16_t len );
456 
468 int32_t nanolr_generic_read ( nanolr_t *ctx, char *data_buf, uint16_t max_len );
469 
480 
489 void nanolr_clear_2_send ( nanolr_t *ctx, uint8_t state );
490 
500 uint8_t nanolr_get_gp1_pin ( nanolr_t *ctx );
501 
510 void nanolr_set_st_pin ( nanolr_t *ctx, uint8_t state );
511 
520 
529 
537 void nanolr_sw_reset ( nanolr_t *ctx );
538 
547 
556 
565 
574 
583 
592 void nanolr_set_output_power ( nanolr_t *ctx, uint8_t out_pwr );
593 
636 
647 
657 
667 
676 
688 void nanolr_set_physical_address ( nanolr_t *ctx, uint8_t *app_eui, uint8_t *dev_eui );
689 
708 
721 void nanolr_set_network_address ( nanolr_t *ctx, uint16_t ntw_addr );
722 
740 
749 void nanolr_set_network_id ( nanolr_t *ctx, uint16_t ntw_id );
750 
759 
775 void nanolr_set_network_role ( nanolr_t *ctx, uint8_t ntw_role );
776 
785 
794 
825 void nanolr_set_network_preference ( nanolr_t *ctx, uint8_t prot, uint8_t auto_join, uint8_t adr );
826 
835 
848 void nanolr_set_network_join_mode ( nanolr_t *ctx, uint8_t ntw_join_mode );
849 
858 
867 
876 
886 
895 
904 
925 void nanolr_send_data ( nanolr_t *ctx, uint8_t *tx_data, uint8_t length );
926 
936 uint8_t nanolr_rsp_rdy ( nanolr_t *ctx );
937 
946 void nanolr_uart_isr ( nanolr_t *ctx );
947 
958 
959 #ifdef __cplusplus
960 }
961 #endif
962 #endif // _NANOLR_H_
963  // End public_function group
966 
967 // ------------------------------------------------------------------------- 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:299
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:390
nanolr_cfg_t
Click configuration structure definition.
Definition: nanolr.h:348
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:392
nanolr_t::cts
digital_out_t cts
Definition: nanolr.h:324
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:319
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:377
nanolr_rsp_t::message_id
uint8_t message_id
Definition: nanolr.h:378
nanolr_cfg_t::tx_pin
pin_name_t tx_pin
Definition: nanolr.h:352
nanolr_cfg_t::rts
pin_name_t rts
Definition: nanolr.h:360
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:357
NANOLR_RETVAL
#define NANOLR_RETVAL
Definition: nanolr.h:80
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:358
nanolr_t::rsp_len
uint16_t rsp_len
Definition: nanolr.h:339
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:359
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:329
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:333
nanolr_cfg_t::uart_blocking
bool uart_blocking
Definition: nanolr.h:365
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:323
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:368
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:388
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:389
nanolr_rsp_t
Click response structure definition.
Definition: nanolr.h:376
nanolr_cfg_t::data_bit
uart_data_bits_t data_bit
Definition: nanolr.h:366
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:340
nanolr_cfg_t::st
pin_name_t st
Definition: nanolr.h:356
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:351
nanolr_rsp_t::crc
uint8_t crc
Definition: nanolr.h:380
nanolr_err_t
#define nanolr_err_t
Driver Error type.
Definition: nanolr.h:313
nanolr_cfg_t::baud_rate
uint32_t baud_rate
Definition: nanolr.h:364
nanolr_t::gp1
digital_in_t gp1
Definition: nanolr.h:328
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:391
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:367
nanolr_t::st
digital_out_t st
Definition: nanolr.h:322
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.