Skip to content

Commit

Permalink
Merge pull request #23 from IRNAS/release/v1.5.0
Browse files Browse the repository at this point in the history
Release v1.5.0
  • Loading branch information
TjazVracko authored Jul 4, 2023
2 parents 62874ef + 0d3527e commit 1580d87
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 20 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## [Unreleased]

## [1.5.0] - 2023-07-04

### Added

- Added additional device tree properties for TXCO, LF clock and regulator configuration.

## [1.4.0] - 2023-06-21

### Added
Expand Down Expand Up @@ -58,7 +64,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- WiFi scan sample.
- Modified ping-pong sample with signal reporting for LR 868 MHz, LR 2.4 GHz and BT signal strength.

[Unreleased]: https://github.com/IRNAS/SWDR001-Zephyr/compare/v1.4.0...HEAD
[Unreleased]: https://github.com/IRNAS/SWDR001-Zephyr/compare/v1.5.0...HEAD

[1.5.0]: https://github.com/IRNAS/SWDR001-Zephyr/compare/v1.4.0...v1.5.0

[1.4.0]: https://github.com/IRNAS/SWDR001-Zephyr/compare/v1.3.0...v1.4.0

Expand Down
42 changes: 28 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,30 +48,44 @@ Compatible Device Tree bing for `lr11xx` needs to be added to DT file, for examp
```dts
&spi2 {
cs-gpios = <&gpio1 8 GPIO_ACTIVE_LOW>;
lr1120: lr1120@0 {
lr11xx: lr11xx@0 {
compatible = "irnas,lr11xx";
reg = <0>;
spi-max-frequency = <4000000>;
label = "LR1120";
reset-gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
gps-lna-en-gpios = <&gpio0 29 0>;
busy-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
event-gpios = <&gpio1 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN) >;
rf-sw-enable = <(LR11XX_DIO5 | LR11XX_DIO6 | LR11XX_DIO7)>;
rf-sw-rx-mode = <LR11XX_DIO5>;
rf-sw-tx-mode = <(LR11XX_DIO5 | LR11XX_DIO6)>;
rf-sw-tx-hp-mode = <LR11XX_DIO6>;
rf-sw-gnss-mode = <LR11XX_DIO7>;
/* Pin configuration */
reset-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
pwr-en-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
busy-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>;
event-gpios = <&gpio0 30 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;
/* TX path configuration */
lf-tx-path = <LR11XX_TX_PATH_LF_HP>;
/* TCXO configuration */
tcxo-supply = <LR11XX_TCXO_SUPPLY_1_8V>;
tcxo-wakeup-time = <3>;
/* LF clock config */
lf-clk = <LR11XX_LFCLK_EXT>;
/* Regulator configuration */
reg-mode = <LR11XX_REG_MODE_DCDC>;
/* RF switch configuration */
rf-sw-enable = <(LR11XX_DIO5 | LR11XX_DIO6 | LR11XX_DIO7 | LR11XX_DIO8)>;
rf-sw-rx-mode = <(LR11XX_DIO6 | LR11XX_DIO8)>;
rf-sw-tx-hp-mode = <(LR11XX_DIO5 | LR11XX_DIO6 | LR11XX_DIO8)>;
rf-sw-wifi-mode = <(LR11XX_DIO5 | LR11XX_DIO8)>;
rf-sw-gnss-mode = <(LR11XX_DIO7)>;
};
};
```

LR11XX device structure can them be accessed trough device binding:

```c
const struct device *context = DEVICE_DT_GET(DT_NODELABEL(lr1120));
const struct device *context = DEVICE_DT_GET(DT_NODELABEL(lr11xx));
```

## Development installation
Expand Down
8 changes: 4 additions & 4 deletions drivers/radio/lr11xx_board.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,15 +352,15 @@ static int lr11xx_pm_action(const struct device *dev, enum pm_device_action acti

#define LR11XX_CFG_LF_CLCK(inst) \
.lf_clck_cfg = { \
.lf_clk_cfg = LR11XX_SYSTEM_LFCLK_RC, \
.lf_clk_cfg = DT_INST_PROP(inst, lf_clk), \
.wait_32k_ready = true, \
},

#define LR11XX_CFG_TCXO(inst) \
.tcxo_cfg = { \
.has_tcxo = true, \
.supply = LR11XX_SYSTEM_TCXO_CTRL_1_8V, \
.timeout_ms = BOARD_TCXO_WAKEUP_TIME, \
.supply = DT_INST_PROP(inst, tcxo_supply), \
.timeout_ms = DT_INST_PROP(inst, tcxo_wakeup_time), \
},

#define LR11XX_CONFIG(inst) \
Expand All @@ -369,7 +369,7 @@ static int lr11xx_pm_action(const struct device *dev, enum pm_device_action acti
.busy = GPIO_DT_SPEC_INST_GET(inst, busy_gpios), \
.reset = GPIO_DT_SPEC_INST_GET(inst, reset_gpios), \
.event = GPIO_DT_SPEC_INST_GET(inst, event_gpios), \
.reg_mode = LR11XX_SYSTEM_REG_MODE_DCDC, \
.reg_mode = DT_INST_PROP(inst, reg_mode), \
.lf_tx_path_options = DT_INST_PROP(inst, lf_tx_path), \
COND_CODE_1(DT_INST_NODE_HAS_PROP(inst, pwr_en_gpios), (LR11XX_CFG_PWR_EN(inst)), \
()) COND_CODE_1(DT_INST_NODE_HAS_PROP(inst, gps_lna_en_gpios), \
Expand Down
37 changes: 36 additions & 1 deletion dts/bindings/irnas,lr11xx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,45 @@ properties:
- 2
description: |
Configuration of the low power TX path placement. Selects which RF paths
are placed and thus which paths LR11XX will use.
are placed and thus which paths lr11xx will use.
Use the LR11XX_TX_PATH_* macros in lr11xx_bindings_def.h when setting
this property.
tcxo-supply:
type: int
required: true
description: |
Supply voltage of the TCXO used by lr11xx. This is the voltage that
lr11xx will output on the VTCXO pin. Use the LR11XX_TCXO_SUPPLY_*
macros in lr11xx_bindings_def.h when setting this property.
tcxo-wakeup-time:
type: int
required: true
description: |
In milliseconds, the wakeup (or stabilization) time of the TCXO used by lr11xx.
lf-clk:
type: int
required: true
enum:
- 0
- 1
- 2
description: |
Low frequency clock source for lr11xx. Use the LR11XX_LFCLK_* macros
in lr11xx_bindings_def.h when setting this property.
reg-mode:
type: int
required: true
enum:
- 0
- 1
description: |
Configuration of the lr11xx regulator mode. Use the LR11XX_REG_MODE_*
macros in lr11xx_bindings_def.h when setting this property.
rf-sw-enable:
type: int
required: false
Expand Down
16 changes: 16 additions & 0 deletions dts/lr11xx_bindings_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,20 @@
/* Both the low frequency low power and low frequency high power paths are placed. */
#define LR11XX_TX_PATH_LF_LP_HP 2

#define LR11XX_TCXO_SUPPLY_1_6V 0x00 /* Supply voltage = 1.6v */
#define LR11XX_TCXO_SUPPLY_1_7V 0x01 /* Supply voltage = 1.7v */
#define LR11XX_TCXO_SUPPLY_1_8V 0x02 /* Supply voltage = 1.8v */
#define LR11XX_TCXO_SUPPLY_2_2V 0x03 /* Supply voltage = 2.2v */
#define LR11XX_TCXO_SUPPLY_2_4V 0x04 /* Supply voltage = 2.4v */
#define LR11XX_TCXO_SUPPLY_2_7V 0x05 /* Supply voltage = 2.7v */
#define LR11XX_TCXO_SUPPLY_3_0V 0x06 /* Supply voltage = 3.0v */
#define LR11XX_TCXO_SUPPLY_3_3V 0x07 /* Supply voltage = 3.3v */

#define LR11XX_LFCLK_RC 0x00 /* Use 32.768kHz RC oscillator */
#define LR11XX_LFCLK_XTAL 0x01 /* Use 32.768kHz crystal oscillator */
#define LR11XX_LFCLK_EXT 0x02 /* Use externally provided 32.768kHz signal on DIO11 pin */

#define LR11XX_REG_MODE_LDO 0x00 /* Do not switch on the DC-DC converter in any mode */
#define LR11XX_REG_MODE_DCDC 0x01 /* Automatically switch on the DC-DC converter when required */

#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_LR11XX_H_*/

0 comments on commit 1580d87

Please sign in to comment.