lriot 2.1.0.0
lr1110_system_types.h
Go to the documentation of this file.
1
35#ifndef LR1110_SYSTEM_TYPES_H
36#define LR1110_SYSTEM_TYPES_H
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
42/*
43 * -----------------------------------------------------------------------------
44 * --- DEPENDENCIES ------------------------------------------------------------
45 */
46
47#include <stdint.h>
48#include <stdbool.h>
49
50/*
51 * -----------------------------------------------------------------------------
52 * --- PUBLIC MACROS -----------------------------------------------------------
53 */
54
55/*
56 * -----------------------------------------------------------------------------
57 * --- PUBLIC CONSTANTS --------------------------------------------------------
58 */
59
63#define LR1110_SYSTEM_VERSION_LENGTH ( 4 )
64
70#define LR1110_SYSTEM_UID_LENGTH ( 8 )
71#define LR1110_SYSTEM_JOIN_EUI_LENGTH ( 8 )
72#define LR1110_SYSTEM_PIN_LENGTH ( 4 )
73
74/*
75 * -----------------------------------------------------------------------------
76 * --- PUBLIC TYPES ------------------------------------------------------------
77 */
78
83
88
93
97typedef uint32_t lr1110_system_irq_mask_t;
98
102#define LR1110_SYSTEM_IRQ_NONE ( 0 << 0 )
103#define LR1110_SYSTEM_IRQ_TX_DONE ( 1 << 2 )
104#define LR1110_SYSTEM_IRQ_RX_DONE ( 1 << 3 )
105#define LR1110_SYSTEM_IRQ_PREAMBLE_DETECTED ( 1 << 4 )
106#define LR1110_SYSTEM_IRQ_SYNC_WORD_HEADER_VALID ( 1 << 5 )
107#define LR1110_SYSTEM_IRQ_HEADER_ERROR ( 1 << 6 )
108#define LR1110_SYSTEM_IRQ_CRC_ERROR ( 1 << 7 )
109#define LR1110_SYSTEM_IRQ_CAD_DONE ( 1 << 8 )
110#define LR1110_SYSTEM_IRQ_CAD_DETECTED ( 1 << 9 )
111#define LR1110_SYSTEM_IRQ_TIMEOUT ( 1 << 10 )
112#define LR1110_SYSTEM_IRQ_LR_FHSS_INTRA_PKT_HOP ( 1 << 11 )
113#define LR1110_SYSTEM_IRQ_GNSS_SCAN_DONE ( 1ul << 19 )
114#define LR1110_SYSTEM_IRQ_WIFI_SCAN_DONE ( 1ul << 20 )
115#define LR1110_SYSTEM_IRQ_EOL ( 1ul << 21 )
116#define LR1110_SYSTEM_IRQ_CMD_ERROR ( 1ul << 22 )
117#define LR1110_SYSTEM_IRQ_ERROR ( 1ul << 23 )
118#define LR1110_SYSTEM_IRQ_FSK_LEN_ERROR ( 1ul << 24 )
119#define LR1110_SYSTEM_IRQ_FSK_ADDR_ERROR ( 1ul << 25 )
120#define LR1110_SYSTEM_IRQ_ALL_MASK \
121 LR1110_SYSTEM_IRQ_TX_DONE | LR1110_SYSTEM_IRQ_RX_DONE | LR1110_SYSTEM_IRQ_PREAMBLE_DETECTED | \
122 LR1110_SYSTEM_IRQ_SYNC_WORD_HEADER_VALID | LR1110_SYSTEM_IRQ_HEADER_ERROR | LR1110_SYSTEM_IRQ_CRC_ERROR | \
123 LR1110_SYSTEM_IRQ_CAD_DONE | LR1110_SYSTEM_IRQ_CAD_DETECTED | LR1110_SYSTEM_IRQ_TIMEOUT | \
124 LR1110_SYSTEM_IRQ_GNSS_SCAN_DONE | LR1110_SYSTEM_IRQ_WIFI_SCAN_DONE | LR1110_SYSTEM_IRQ_EOL | \
125 LR1110_SYSTEM_IRQ_CMD_ERROR | LR1110_SYSTEM_IRQ_ERROR | LR1110_SYSTEM_IRQ_FSK_LEN_ERROR | \
126 LR1110_SYSTEM_IRQ_FSK_ADDR_ERROR
127
140
142
157
158typedef uint16_t lr1110_system_errors_t;
159
173
187
198
208
217
226
238
243{
244 uint8_t enable;
245 uint8_t standby;
246 uint8_t rx_mode;
247 uint8_t tx_mode;
248 uint8_t tx_hp;
249 uint8_t tx_hf;
250 uint8_t gnss;
251 uint8_t wifi;
253
262
277
286
296
301{
302 uint8_t hw;
303 uint8_t type;
304 uint16_t fw;
306
315
316/*
317 * -----------------------------------------------------------------------------
318 * --- PUBLIC FUNCTIONS PROTOTYPES ---------------------------------------------
319 */
320
321#ifdef __cplusplus
322}
323#endif
324
325#endif // LR1110_SYSTEM_TYPES_H
326
327/* --- EOF ------------------------------------------------------------------ */
lr1110_system_reset_status_t
Reset status.
Definition lr1110_system_types.h:178
@ LR1110_SYSTEM_RESET_STATUS_SYSTEM
Definition lr1110_system_types.h:182
@ LR1110_SYSTEM_RESET_STATUS_RTC_RESTART
Definition lr1110_system_types.h:185
@ LR1110_SYSTEM_RESET_STATUS_CLEARED
Definition lr1110_system_types.h:179
@ LR1110_SYSTEM_RESET_STATUS_ANALOG
Definition lr1110_system_types.h:180
@ LR1110_SYSTEM_RESET_STATUS_WATCHDOG
Definition lr1110_system_types.h:183
@ LR1110_SYSTEM_RESET_STATUS_IOCD_RESTART
Definition lr1110_system_types.h:184
@ LR1110_SYSTEM_RESET_STATUS_EXTERNAL
Definition lr1110_system_types.h:181
lr1110_system_reg_mode_t
Regulator modes.
Definition lr1110_system_types.h:213
@ LR1110_SYSTEM_REG_MODE_DCDC
Definition lr1110_system_types.h:215
@ LR1110_SYSTEM_REG_MODE_LDO
(Default)
Definition lr1110_system_types.h:214
struct lr1110_system_stat1_s lr1110_system_stat1_t
Status register 1 structure definition.
lr1110_system_calibration_e
Calibration flags.
Definition lr1110_system_types.h:132
@ LR1110_SYSTEM_CALIB_ADC_MASK
Definition lr1110_system_types.h:136
@ LR1110_SYSTEM_CALIB_IMG_MASK
Definition lr1110_system_types.h:137
@ LR1110_SYSTEM_CALIB_PLL_TX_MASK
Definition lr1110_system_types.h:138
@ LR1110_SYSTEM_CALIB_PLL_MASK
Definition lr1110_system_types.h:135
@ LR1110_SYSTEM_CALIB_LF_RC_MASK
Definition lr1110_system_types.h:133
@ LR1110_SYSTEM_CALIB_HF_RC_MASK
Definition lr1110_system_types.h:134
uint8_t lr1110_system_pin_t[LR1110_SYSTEM_PIN_LENGTH]
Fixed-length array to store a PIN.
Definition lr1110_system_types.h:92
#define LR1110_SYSTEM_PIN_LENGTH
Definition lr1110_system_types.h:72
struct lr1110_system_rfswitch_cfg_s lr1110_system_rfswitch_cfg_t
RF switch configuration structure definition.
#define LR1110_SYSTEM_UID_LENGTH
Length of the LR1110 Unique Identifier in bytes.
Definition lr1110_system_types.h:70
struct lr1110_system_stat2_s lr1110_system_stat2_t
Status register 2 structure definition.
lr1110_system_chip_modes_t
Chip modes.
Definition lr1110_system_types.h:164
@ LR1110_SYSTEM_CHIP_MODE_STBY_RC
Definition lr1110_system_types.h:166
@ LR1110_SYSTEM_CHIP_MODE_RX
Definition lr1110_system_types.h:169
@ LR1110_SYSTEM_CHIP_MODE_FS
Definition lr1110_system_types.h:168
@ LR1110_SYSTEM_CHIP_MODE_SLEEP
Definition lr1110_system_types.h:165
@ LR1110_SYSTEM_CHIP_MODE_STBY_XOSC
Definition lr1110_system_types.h:167
@ LR1110_SYSTEM_CHIP_MODE_TX
Definition lr1110_system_types.h:170
@ LR1110_SYSTEM_CHIP_MODE_LOC
Definition lr1110_system_types.h:171
lr1110_system_tcxo_supply_voltage_t
TCXO supply voltage values.
Definition lr1110_system_types.h:267
@ LR1110_SYSTEM_TCXO_CTRL_3_0V
Supply voltage = 3.0v.
Definition lr1110_system_types.h:274
@ LR1110_SYSTEM_TCXO_CTRL_1_6V
Supply voltage = 1.6v.
Definition lr1110_system_types.h:268
@ LR1110_SYSTEM_TCXO_CTRL_1_8V
Supply voltage = 1.8v.
Definition lr1110_system_types.h:270
@ LR1110_SYSTEM_TCXO_CTRL_2_2V
Supply voltage = 2.2v.
Definition lr1110_system_types.h:271
@ LR1110_SYSTEM_TCXO_CTRL_1_7V
Supply voltage = 1.7v.
Definition lr1110_system_types.h:269
@ LR1110_SYSTEM_TCXO_CTRL_3_3V
Supply voltage = 3.3v.
Definition lr1110_system_types.h:275
@ LR1110_SYSTEM_TCXO_CTRL_2_7V
Supply voltage = 2.7v.
Definition lr1110_system_types.h:273
@ LR1110_SYSTEM_TCXO_CTRL_2_4V
Supply voltage = 2.4v.
Definition lr1110_system_types.h:272
lr1110_system_rfswitch_cfg_pin_e
RF switch configuration pin.
Definition lr1110_system_types.h:231
@ LR1110_SYSTEM_RFSW0_HIGH
Definition lr1110_system_types.h:232
@ LR1110_SYSTEM_RFSW1_HIGH
Definition lr1110_system_types.h:233
@ LR1110_SYSTEM_RFSW2_HIGH
Definition lr1110_system_types.h:234
@ LR1110_SYSTEM_RFSW3_HIGH
Definition lr1110_system_types.h:235
@ LR1110_SYSTEM_RFSW4_HIGH
Definition lr1110_system_types.h:236
uint8_t lr1110_system_uid_t[LR1110_SYSTEM_UID_LENGTH]
Fixed-length array to store a UID.
Definition lr1110_system_types.h:82
struct lr1110_system_version_s lr1110_system_version_t
Version structure definition.
uint8_t lr1110_system_cal_mask_t
Definition lr1110_system_types.h:141
lr1110_system_standby_cfg_t
Stand by configuration values.
Definition lr1110_system_types.h:258
@ LR1110_SYSTEM_STANDBY_CFG_XOSC
Definition lr1110_system_types.h:260
@ LR1110_SYSTEM_STANDBY_CFG_RC
Definition lr1110_system_types.h:259
lr1110_system_lfclk_cfg_t
Low-frequency clock modes.
Definition lr1110_system_types.h:203
@ LR1110_SYSTEM_LFCLK_EXT
Definition lr1110_system_types.h:206
@ LR1110_SYSTEM_LFCLK_RC
(Default)
Definition lr1110_system_types.h:204
@ LR1110_SYSTEM_LFCLK_XTAL
Definition lr1110_system_types.h:205
struct lr1110_system_sleep_cfg_s lr1110_system_sleep_cfg_t
Sleep configuration structure definition.
uint16_t lr1110_system_errors_t
Definition lr1110_system_types.h:158
#define LR1110_SYSTEM_JOIN_EUI_LENGTH
Definition lr1110_system_types.h:71
lr1110_system_command_status_t
Command status.
Definition lr1110_system_types.h:192
@ LR1110_SYSTEM_CMD_STATUS_FAIL
Definition lr1110_system_types.h:193
@ LR1110_SYSTEM_CMD_STATUS_DATA
Definition lr1110_system_types.h:196
@ LR1110_SYSTEM_CMD_STATUS_OK
Definition lr1110_system_types.h:195
@ LR1110_SYSTEM_CMD_STATUS_PERR
Definition lr1110_system_types.h:194
uint32_t lr1110_system_irq_mask_t
Type to store system interrupt flags.
Definition lr1110_system_types.h:97
lr1110_system_infopage_id_t
Info page ID.
Definition lr1110_system_types.h:222
@ LR1110_SYSTEM_INFOPAGE_0
Info page #0.
Definition lr1110_system_types.h:223
@ LR1110_SYSTEM_INFOPAGE_1
Info page #1.
Definition lr1110_system_types.h:224
uint8_t lr1110_system_join_eui_t[LR1110_SYSTEM_JOIN_EUI_LENGTH]
Fixed-length array to store a joinEUI.
Definition lr1110_system_types.h:87
lr1110_system_errors_e
Error flags.
Definition lr1110_system_types.h:147
@ LR1110_SYSTEM_ERRORS_HF_XOSC_START_MASK
Definition lr1110_system_types.h:153
@ LR1110_SYSTEM_ERRORS_PLL_CALIB_MASK
Definition lr1110_system_types.h:151
@ LR1110_SYSTEM_ERRORS_LF_RC_CALIB_MASK
Definition lr1110_system_types.h:148
@ LR1110_SYSTEM_ERRORS_PLL_LOCK_MASK
Definition lr1110_system_types.h:155
@ LR1110_SYSTEM_ERRORS_IMG_CALIB_MASK
Definition lr1110_system_types.h:152
@ LR1110_SYSTEM_ERRORS_HF_RC_CALIB_MASK
Definition lr1110_system_types.h:149
@ LR1110_SYSTEM_ERRORS_ADC_CALIB_MASK
Definition lr1110_system_types.h:150
@ LR1110_SYSTEM_ERRORS_LF_XOSC_START_MASK
Definition lr1110_system_types.h:154
RF switch configuration structure definition.
Definition lr1110_system_types.h:243
uint8_t tx_mode
Definition lr1110_system_types.h:247
uint8_t enable
Definition lr1110_system_types.h:244
uint8_t gnss
Definition lr1110_system_types.h:250
uint8_t standby
Definition lr1110_system_types.h:245
uint8_t wifi
Definition lr1110_system_types.h:251
uint8_t rx_mode
Definition lr1110_system_types.h:246
uint8_t tx_hp
Definition lr1110_system_types.h:248
uint8_t tx_hf
Definition lr1110_system_types.h:249
Sleep configuration structure definition.
Definition lr1110_system_types.h:311
bool is_warm_start
Definition lr1110_system_types.h:312
bool is_rtc_timeout
Definition lr1110_system_types.h:313
Status register 1 structure definition.
Definition lr1110_system_types.h:282
bool is_interrupt_active
Definition lr1110_system_types.h:284
uint8_t command_status
Definition lr1110_system_types.h:283
Status register 2 structure definition.
Definition lr1110_system_types.h:291
bool is_running_from_flash
Definition lr1110_system_types.h:294
uint8_t reset_status
Definition lr1110_system_types.h:292
uint8_t chip_mode
Definition lr1110_system_types.h:293
Version structure definition.
Definition lr1110_system_types.h:301
uint8_t hw
Definition lr1110_system_types.h:302
uint8_t type
Definition lr1110_system_types.h:303
uint16_t fw
Definition lr1110_system_types.h:304