lriot  2.1.0.0
lr1110_system.h
Go to the documentation of this file.
1 
35 #ifndef LR1110_SYSTEM_H
36 #define LR1110_SYSTEM_H
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 /*
43  * -----------------------------------------------------------------------------
44  * --- DEPENDENCIES ------------------------------------------------------------
45  */
46 
48 #include "common/lr1110_types.h"
49 #include "common/lr1110_hal.h"
50 
51 /*
52  * -----------------------------------------------------------------------------
53  * --- PUBLIC MACROS -----------------------------------------------------------
54  */
55 
56 /*
57  * -----------------------------------------------------------------------------
58  * --- PUBLIC CONSTANTS --------------------------------------------------------
59  */
60 
66 #define LR1110_SYSTEM_IMAGE_CALIBRATION_STEP_IN_MHZ 4
67 
68 /*
69  * -----------------------------------------------------------------------------
70  * --- PUBLIC TYPES ------------------------------------------------------------
71  */
72 
73 /*
74  * -----------------------------------------------------------------------------
75  * --- PUBLIC FUNCTIONS PROTOTYPES ---------------------------------------------
76  */
77 
86 
95 
114  lr1110_system_stat2_t* stat2, lr1110_system_irq_mask_t* irq_status );
115 
124 
134 
144 
161 err_t lr1110_system_get_errors( lriot_t *ctx, uint16_t* errors );
162 
175 
191 err_t lr1110_system_calibrate( lriot_t *ctx, uint8_t calib_param );
192 
207 
229 err_t lr1110_system_calibrate_image( lriot_t *ctx, uint8_t freq1, uint8_t freq2 );
230 
246 err_t lr1110_system_calibrate_image_in_mhz( lriot_t *ctx, uint16_t freq1_in_mhz, uint16_t freq2_in_mhz );
247 
261  lr1110_system_rfswitch_cfg_t* rf_switch_cfg );
262 
280  lr1110_system_irq_mask_t irqs_to_enable_dio1,
281  lr1110_system_irq_mask_t irqs_to_enable_dio2 );
282 
292 
304 
316 err_t lr1110_system_cfg_lfclk( lriot_t *ctx, lr1110_system_lfclk_cfg_t lfclock_cfg, bool wait_for_32k_ready );
317 
337 
351 err_t lr1110_system_reboot( lriot_t *ctx, bool stay_in_bootloader );
352 
364 err_t lr1110_system_get_vbat( lriot_t *ctx, uint8_t* vbat );
365 
381 err_t lr1110_system_get_temp( lriot_t *ctx, uint16_t* temp );
382 
400 err_t lr1110_system_set_sleep( lriot_t *ctx, lr1110_system_sleep_cfg_t sleep_cfg, uint32_t sleep_time );
401 
413 
424 
436 
451  uint16_t address, uint32_t* data_buf, uint8_t length );
452 
469  uint16_t address, uint32_t* data_buf, uint8_t length );
470 
482 err_t lr1110_system_read_uid( lriot_t *ctx, lr1110_system_uid_t unique_identifier );
483 
496 
512 
531  lr1110_system_join_eui_t join_eui, uint8_t rfu,
532  lr1110_system_pin_t pin );
533 
544 err_t lr1110_system_get_random_number( lriot_t *ctx, uint32_t* random_number );
545 
557 err_t lr1110_system_enable_spi_crc( lriot_t *ctx, bool enable_crc );
558 
571 err_t lr1110_system_drive_dio_in_sleep_mode( lriot_t *ctx, bool enable_drive );
572 
573 #ifdef __cplusplus
574 }
575 #endif
576 
577 #endif // LR1110_SYSTEM_H
578 
579 /* --- EOF ------------------------------------------------------------------ */
lr1110_system_get_errors
err_t lr1110_system_get_errors(lriot_t *ctx, uint16_t *errors)
Return the system errors.
lr1110_system_set_dio_irq_params
err_t lr1110_system_set_dio_irq_params(lriot_t *ctx, lr1110_system_irq_mask_t irqs_to_enable_dio1, lr1110_system_irq_mask_t irqs_to_enable_dio2)
Set which interrupt signals are redirected to the dedicated DIO pin.
lr1110_system_set_tcxo_mode
err_t lr1110_system_set_tcxo_mode(lriot_t *ctx, lr1110_system_tcxo_supply_voltage_t tune, uint32_t timeout)
Enable and configure TCXO supply voltage and detection timeout.
lriot_t
LR IoT Click context object.
Definition: lriot.h:259
lr1110_system_set_sleep
err_t lr1110_system_set_sleep(lriot_t *ctx, lr1110_system_sleep_cfg_t sleep_cfg, uint32_t sleep_time)
Set the device into Sleep or Deep Sleep Mode.
lr1110_system_set_fs
err_t lr1110_system_set_fs(lriot_t *ctx)
Set the device into Frequency Synthesis (FS) mode.
lr1110_system_lfclk_cfg_t
lr1110_system_lfclk_cfg_t
Low-frequency clock modes.
Definition: lr1110_system_types.h:203
lr1110_system_tcxo_supply_voltage_t
lr1110_system_tcxo_supply_voltage_t
TCXO supply voltage values.
Definition: lr1110_system_types.h:267
lr1110_system_set_standby
err_t lr1110_system_set_standby(lriot_t *ctx, lr1110_system_standby_cfg_t standby_cfg)
Set the device into the requested Standby mode.
lr1110_system_enable_spi_crc
err_t lr1110_system_enable_spi_crc(lriot_t *ctx, bool enable_crc)
Enable the CRC on SPI transactions.
lr1110_system_calibrate
err_t lr1110_system_calibrate(lriot_t *ctx, uint8_t calib_param)
lr1110_system_calibrate the requested blocks
lr1110_system_irq_mask_t
uint32_t lr1110_system_irq_mask_t
Type to store system interrupt flags.
Definition: lr1110_system_types.h:97
lr1110_system_rfswitch_cfg_s
RF switch configuration structure definition.
Definition: lr1110_system_types.h:243
lr1110_system_erase_infopage
err_t lr1110_system_erase_infopage(lriot_t *ctx, lr1110_system_infopage_id_t info_page_id)
Erase an info page.
lr1110_system_infopage_id_t
lr1110_system_infopage_id_t
Info page ID.
Definition: lr1110_system_types.h:222
lr1110_system_get_temp
err_t lr1110_system_get_temp(lriot_t *ctx, uint16_t *temp)
Returns the value of Temp.
lr1110_system_join_eui_t
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_uid_t
uint8_t lr1110_system_uid_t[LR1110_SYSTEM_UID_LENGTH]
Fixed-length array to store a UID.
Definition: lr1110_system_types.h:82
lr1110_system_drive_dio_in_sleep_mode
err_t lr1110_system_drive_dio_in_sleep_mode(lriot_t *ctx, bool enable_drive)
Configure the GPIO drive in sleep mode.
lr1110_system_get_status
err_t lr1110_system_get_status(lriot_t *ctx, lr1110_system_stat1_t *stat1, lr1110_system_stat2_t *stat2, lr1110_system_irq_mask_t *irq_status)
Return stat1, stat2, and irq_status.
lr1110_hal.h
Hardware Abstraction Layer (HAL) interface for LR1110.
lr1110_system_set_dio_as_rf_switch
err_t lr1110_system_set_dio_as_rf_switch(lriot_t *ctx, lr1110_system_rfswitch_cfg_t *rf_switch_cfg)
Set the RF switch configurations for each RF setup.
lr1110_system_calibrate_image_in_mhz
err_t lr1110_system_calibrate_image_in_mhz(lriot_t *ctx, uint16_t freq1_in_mhz, uint16_t freq2_in_mhz)
Launch an image calibration valid for all frequencies inside an interval, in MHz.
lr1110_system_calibrate_image
err_t lr1110_system_calibrate_image(lriot_t *ctx, uint8_t freq1, uint8_t freq2)
Launch an image calibration valid for all frequencies inside an interval, in steps.
lr1110_system_read_join_eui
err_t lr1110_system_read_join_eui(lriot_t *ctx, lr1110_system_join_eui_t join_eui)
Read and return the Join EUI of the LR1110.
lr1110_system_sleep_cfg_s
Sleep configuration structure definition.
Definition: lr1110_system_types.h:311
lr1110_system_stat2_s
Status register 2 structure definition.
Definition: lr1110_system_types.h:291
lr1110_system_get_irq_status
err_t lr1110_system_get_irq_status(lriot_t *ctx, lr1110_system_irq_mask_t *irq_status)
Return irq_status.
lr1110_system_standby_cfg_t
lr1110_system_standby_cfg_t
Stand by configuration values.
Definition: lr1110_system_types.h:258
lr1110_system_get_version
err_t lr1110_system_get_version(lriot_t *ctx, lr1110_system_version_t *version)
Return the version of the system (hardware and software)
lr1110_system_write_infopage
err_t lr1110_system_write_infopage(lriot_t *ctx, lr1110_system_infopage_id_t info_page_id, uint16_t address, uint32_t *data_buf, uint8_t length)
Write data in an info page.
lr1110_system_read_infopage
err_t lr1110_system_read_infopage(lriot_t *ctx, lr1110_system_infopage_id_t info_page_id, uint16_t address, uint32_t *data_buf, uint8_t length)
Read data from an info page.
lr1110_system_reg_mode_t
lr1110_system_reg_mode_t
Regulator modes.
Definition: lr1110_system_types.h:213
lr1110_system_stat1_s
Status register 1 structure definition.
Definition: lr1110_system_types.h:282
lr1110_types.h
Type definitions for LR1110.
lr1110_system_cfg_lfclk
err_t lr1110_system_cfg_lfclk(lriot_t *ctx, lr1110_system_lfclk_cfg_t lfclock_cfg, bool wait_for_32k_ready)
Defines which clock is used as Low Frequency (LF) clock.
lr1110_system_set_reg_mode
err_t lr1110_system_set_reg_mode(lriot_t *ctx, lr1110_system_reg_mode_t reg_mode)
Configure the regulator mode to be used in specific modes.
lr1110_system_wakeup
err_t lr1110_system_wakeup(lriot_t *ctx)
Wake the radio up from sleep mode.
lr1110_system_clear_irq_status
err_t lr1110_system_clear_irq_status(lriot_t *ctx, lr1110_system_irq_mask_t irqs_to_clear)
Clear requested bits in the internal pending interrupt register.
lr1110_system_reboot
err_t lr1110_system_reboot(lriot_t *ctx, bool stay_in_bootloader)
Software reset of the chip.
lr1110_system_version_s
Version structure definition.
Definition: lr1110_system_types.h:301
lr1110_system_read_pin
err_t lr1110_system_read_pin(lriot_t *ctx, lr1110_system_pin_t pin)
Compute and return the PIN of the LR1110 based on factory default EUIs.
lr1110_system_reset
err_t lr1110_system_reset(lriot_t *ctx)
Reset the radio.
lr1110_system_get_vbat
err_t lr1110_system_get_vbat(lriot_t *ctx, uint8_t *vbat)
Returns the value of Vbat.
lr1110_system_read_pin_custom_eui
err_t lr1110_system_read_pin_custom_eui(lriot_t *ctx, lr1110_system_uid_t device_eui, lr1110_system_join_eui_t join_eui, uint8_t rfu, lr1110_system_pin_t pin)
Compute and return the PIN of the LR1110 based on EUIs provided as parameters.
lr1110_system_clear_reset_status_info
err_t lr1110_system_clear_reset_status_info(lriot_t *ctx)
Clear the reset status information stored in stat2.
lr1110_system_get_random_number
err_t lr1110_system_get_random_number(lriot_t *ctx, uint32_t *random_number)
Read and return a 32-bit random number.
lr1110_system_pin_t
uint8_t lr1110_system_pin_t[LR1110_SYSTEM_PIN_LENGTH]
Fixed-length array to store a PIN.
Definition: lr1110_system_types.h:92
lr1110_system_get_and_clear_irq_status
err_t lr1110_system_get_and_clear_irq_status(lriot_t *ctx, lr1110_system_irq_mask_t *irq)
This helper function clears any radio irq status flags that are set and returns the flags that were c...
lr1110_system_read_uid
err_t lr1110_system_read_uid(lriot_t *ctx, lr1110_system_uid_t unique_identifier)
Read and return the Unique Identifier of the LR1110.
lr1110_system_clear_errors
err_t lr1110_system_clear_errors(lriot_t *ctx)
Clear all error flags pending.
lr1110_system_types.h
System driver types for LR1110.