39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
73#define LR10_CMD_AT "AT"
74#define LR10_CMD_FDEFAULT "FDEFAULT"
75#define LR10_CMD_RESET "RESET"
76#define LR10_CMD_LOWPOWER "LOWPOWER"
77#define LR10_CMD_VER "VER"
78#define LR10_CMD_MSG "MSG"
79#define LR10_CMD_MSGHEX "MSGHEX"
80#define LR10_CMD_CMSG "CMSG"
81#define LR10_CMD_CMSGHEX "CMSGHEX"
82#define LR10_CMD_PMSG "PMSG"
83#define LR10_CMD_PMSGHEX "PMSGHEX"
84#define LR10_CMD_CH "CH"
85#define LR10_CMD_DR "DR"
86#define LR10_CMD_ADR "ADR"
87#define LR10_CMD_REPT "REPT"
88#define LR10_CMD_RETRY "RETRY"
89#define LR10_CMD_POWER "POWER"
90#define LR10_CMD_RXWIN2 "RXWIN2"
91#define LR10_CMD_RXWIN1 "RXWIN1"
92#define LR10_CMD_PORT "PORT"
93#define LR10_CMD_MODE "MODE"
94#define LR10_CMD_ID "ID"
95#define LR10_CMD_KEY "KEY"
96#define LR10_CMD_CLASS "CLASS"
97#define LR10_CMD_JOIN "JOIN"
98#define LR10_CMD_LW "LW"
99#define LR10_CMD_BEACON "BEACON"
100#define LR10_CMD_TEST "TEST"
101#define LR10_CMD_UART "UART"
102#define LR10_CMD_DELAY "DELAY"
103#define LR10_CMD_VDD "VDD"
104#define LR10_CMD_RTC "RTC"
105#define LR10_CMD_EEPROM "EEPROM"
106#define LR10_CMD_WDT "WDT"
107#define LR10_CMD_TEMP "TEMP"
108#define LR10_CMD_LOG "LOG"
114#define LR10_SUB_CMD_ID_DEVADDR "DEVADDR"
115#define LR10_SUB_CMD_ID_DEVEUI "DEVEUI"
116#define LR10_SUB_CMD_ID_APPEUI "APPEUI"
117#define LR10_SUB_CMD_CH_NUM "NUM"
118#define LR10_SUB_CMD_KEY_NWKSKEY "NWKSKEY"
119#define LR10_SUB_CMD_KEY_APPSKEY "APPSKEY"
120#define LR10_SUB_CMD_MODE_TEST "TEST"
121#define LR10_SUB_CMD_MODE_LWOTAA "LWOTAA"
122#define LR10_SUB_CMD_MODE_LWABP "LWABP"
123#define LR10_SUB_CMD_JOIN_FORCE "FORCE"
124#define LR10_SUB_CMD_JOIN_AUTO "AUTO"
125#define LR10_SUB_CMD_BEACON_DMMUL "DMMUL"
126#define LR10_SUB_CMD_BEACON_INFO "INFO"
127#define LR10_SUB_CMD_BEACON_GWGPS "GWGPS"
128#define LR10_SUB_CMD_DELAY_RX1 "RX1"
129#define LR10_SUB_CMD_DELAY_RX2 "RX2"
130#define LR10_SUB_CMD_DELAY_JRX1 "JRX1"
131#define LR10_SUB_CMD_DELAY_JRX2 "JRX2"
132#define LR10_SUB_CMD_LW_CDR "CDR"
133#define LR10_SUB_CMD_LW_ULDL "ULDL"
134#define LR10_SUB_CMD_LW_DC "DC"
135#define LR10_SUB_CMD_LW_NET "NET"
136#define LR10_SUB_CMD_LW_MC "MC"
137#define LR10_SUB_CMD_LW_THLD "THLD"
138#define LR10_SUB_CMD_LW_BAT "BAT"
139#define LR10_SUB_CMD_LW_TPS "TPS"
140#define LR10_SUB_CMD_LW_SCR "SCR"
141#define LR10_SUB_CMD_LW_JDC "JDC"
142#define LR10_SUB_CMD_LW_CT "CT"
143#define LR10_SUB_CMD_LW_LEN "LEN"
144#define LR10_SUB_CMD_LW_VER "VER"
145#define LR10_SUB_CMD_LW_DTR "DTR"
146#define LR10_SUB_CMD_LW_LCR "LCR"
147#define LR10_SUB_CMD_LW_LDRO "LDRO"
148#define LR10_SUB_CMD_LW_DCMRX "DCMRX"
149#define LR10_SUB_CMD_LW_DUMRX "DUMRX"
150#define LR10_SUB_CMD_LW_AFPACK "AFPACK"
151#define LR10_SUB_CMD_LW_CHRB "CHRB"
152#define LR10_SUB_CMD_RTC_ZONE "ZONE"
153#define LR10_SUB_CMD_RTC_FULL "FULL"
154#define LR10_SUB_CMD_RTC_LEAPSEC "LEAPSEC"
155#define LR10_SUB_CMD_RTC_UTCMS "UTCMS"
156#define LR10_SUB_CMD_EEPROM_ADDR "ADDR"
157#define LR10_SUB_CMD_UART_TIMEOUT "TIMEOUT"
158#define LR10_SUB_CMD_UART_BR "BR"
159#define LR10_SUB_CMD_TEST_STOP "STOP"
160#define LR10_SUB_CMD_TEST_HELP "HELP"
161#define LR10_SUB_CMD_TEST_TXCW "TXCW"
162#define LR10_SUB_CMD_TEST_TXCLORA "TXCLORA"
163#define LR10_SUB_CMD_TEST_RFCFG "RFCFG"
164#define LR10_SUB_CMD_TEST_RX "RXLRPKT"
165#define LR10_SUB_CMD_TEST_TX_HEX "TXLRPKT"
166#define LR10_SUB_CMD_TEST_TX_STR "TXLRSTR"
167#define LR10_SUB_CMD_TEST_RSSI "RSSI"
168#define LR10_SUB_CMD_LOG_DEBUG "DEBUG"
169#define LR10_SUB_CMD_LOG_QUIET "QUIET"
175#define LR10_SYMBOL_END_CMD "\r\n"
176#define LR10_SYMBOL_QUERY "?"
177#define LR10_SYMBOL_SET_VAL_CMD "="
178#define LR10_SYMBOL_PREFIX_CMD "+"
179#define LR10_SYMBOL_SEPARATOR ","
180#define LR10_SYMBOL_SPACE " "
181#define LR10_SYMBOL_NULL ""
182#define LR10_SYMBOL_QUOTE "\""
183#define LR10_ASCII_SPACE 0x20
184#define LR10_ASCII_QUOTE 0x22
192#define LR10_TX_DRV_BUFFER_SIZE 100
193#define LR10_RX_DRV_BUFFER_SIZE 300
211#define LR10_MAP_MIKROBUS( cfg, mikrobus ) \
212 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
213 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
214 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST )
#define LR10_TX_DRV_BUFFER_SIZE
LR 10 driver buffer size.
Definition lr10.h:192
#define LR10_RX_DRV_BUFFER_SIZE
Definition lr10.h:193
err_t lr10_write_cmd_param(lr10_t *ctx, uint8_t *command, uint8_t *param)
LR 10 command - parameter writing function.
err_t lr10_inquire_cmd(lr10_t *ctx, uint8_t *command)
LR 10 inquire command function.
err_t lr10_write_cmd(lr10_t *ctx, uint8_t *command)
LR 10 command writing function.
err_t lr10_generic_write(lr10_t *ctx, uint8_t *data_in, uint16_t len)
LR 10 data writing function.
err_t lr10_generic_read(lr10_t *ctx, uint8_t *data_out, uint16_t len)
LR 10 data reading function.
void lr10_cfg_setup(lr10_cfg_t *cfg)
LR 10 configuration object setup function.
err_t lr10_write_cmd_sub_param(lr10_t *ctx, uint8_t *command, uint8_t *sub_param, uint8_t *param, lr10_en_quote_t en_quote)
LR 10 command - subcommands - parameter writing function.
err_t lr10_init(lr10_t *ctx, lr10_cfg_t *cfg)
LR 10 initialization function.
void lr10_hw_reset(lr10_t *ctx)
LR 10 HW reset function.
lr10_return_value_t
LR 10 Click return value data.
Definition lr10.h:264
@ LR10_ERROR
Definition lr10.h:266
@ LR10_OK
Definition lr10.h:265
lr10_en_quote_t
LR 10 Click enable quote value data.
Definition lr10.h:275
@ LR10_QUOTE_ENABLE
Definition lr10.h:277
@ LR10_QUOTE_DISABLE
Definition lr10.h:276
LR 10 Click configuration object.
Definition lr10.h:242
uint32_t baud_rate
Definition lr10.h:251
bool uart_blocking
Definition lr10.h:252
uart_data_bits_t data_bit
Definition lr10.h:253
pin_name_t tx_pin
Definition lr10.h:245
pin_name_t rx_pin
Definition lr10.h:244
uart_stop_bits_t stop_bit
Definition lr10.h:255
uart_parity_t parity_bit
Definition lr10.h:254
pin_name_t rst
Definition lr10.h:248
LR 10 Click context object.
Definition lr10.h:224
uart_t uart
Definition lr10.h:229
digital_out_t rst
Definition lr10.h:226