Skip to content

Commit e42edd8

Browse files
committed
lora: Rename radio_reset pin argument to reset.
1 parent dfc04c8 commit e42edd8

9 files changed

Lines changed: 22 additions & 22 deletions

File tree

‎micropython/lora/README.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ cs = Pin(9, mode=Pin.OUT, value=1)
6363
modem = SX1262(spi, cs,
6464
busy=Pin(2, mode=Pin.IN), # Required
6565
dio1=Pin(20, mode=Pin.IN), # Optional, recommended
66-
radio_reset=Pin(15, mode=Pin.OUT), # Optional, recommended
66+
reset=Pin(15, mode=Pin.OUT), # Optional, recommended
6767
lora_cfg=lora_cfg)
6868
```
6969

@@ -87,7 +87,7 @@ cs = Pin(9, mode=Pin.OUT, value=1)
8787
modem = SX1276(spi, cs,
8888
dio0=Pin(10, mode=Pin.IN), # Optional, recommended
8989
dio1=Pin(11, mode=Pin.IN), # Optional, recommended
90-
radio_reset=Pin(13, mode=Pin.OPEN_DRAIN), # Optional, recommended
90+
reset=Pin(13, mode=Pin.OPEN_DRAIN), # Optional, recommended
9191
lora_cfg=lora_cfg)
9292
```
9393

@@ -124,7 +124,7 @@ Here is a full list of parameters that can be passed to both constructors:
124124
| `dio2_rf_sw` | No, defaults to `True` | By default, configures the modem's DIO2 pin as an RF switch. The modem will drive this pin high when transmitting and low otherwise. Set this parameter to False if DIO2 is connected elsewhere on your LoRa board/module and you don't want it toggling on transmit. |
125125
| `dio3_tcxo_millivolts` | No | If set to an integer value, DIO3 will be used as a variable voltage source for the modem's main TCXO clock source. DIO3 will automatically disable the TCXO to save power when the 32MHz clock source is not needed. The value is units of millivolts and should be one of the voltages listed in the SX1261 datasheet section 13.3.6 "SetDIO3AsTCXOCtrl". Any value between `1600` and `3300` can be specified and the driver will round down to a lower supported voltage step if necessary. The manufacturer of the LoRa board or module you are using should be able to tell you what value to pass here, if any. |
126126
| `dio3_tcxo_start_time_us` | No | This value is ignored unless `dio3_tcxo_millivolts` is set, and is the startup delay in microseconds for the TCXO connected to DIO3. Each time the modem needs to enable the TCXO, it will wait this long. The default value is `1000` (1ms). Values can be set in units of `15.625`us and range from 0us to 262 seconds (settings this high will make the modem unusable). |
127-
| radio_reset | No | If set to a `machine.Pin` output attached to the modem's NRESET pin , then it will be used to hard reset the modem before initializing it. If unset, the programmer is responsible for ensuring the modem is in an idle state when the constructor is called. |
127+
| reset | No | If set to a `machine.Pin` output attached to the modem's NRESET pin , then it will be used to hard reset the modem before initializing it. If unset, the programmer is responsible for ensuring the modem is in an idle state when the constructor is called. |
128128
| `lora_cfg` | No | If set to an initial LoRa configuration then the modem is set up with this configuration. If not set here, can be set by calling `configure()` later on. |
129129
| `ant_sw` | No | Optional antenna switch object instance, see below for description. |
130130

@@ -137,7 +137,7 @@ Here is a full list of parameters that can be passed to both constructors:
137137
| `cs` | Yes | Instance of a `machine.Pin` input, as connected to the modem's NSS pin. | |
138138
| `dio0` | No | Instance of a `machine.Pin` input, as connected to the modem's DIO0 pin. If set, allows the driver to use interrupts to detect "RX done" and "TX done" events. | |
139139
| `dio1` | No | Instance of a `machine.Pin` input, as connected to the modem's DIO1/DCLK pin. If set, allows the driver to use interrupts to detect "RX timeout" events. Setting this pin requires dio0 to also be set. | |
140-
| `radio_reset` | No | If set to a `machine.Pin` output attached the modem's NRESET pin , it will be used to hard reset the modem before initializing it. If unset, the programmer is responsible for ensuring the modem should be is in an idle state when the object is instantiated. | |
140+
| `reset` | No | If set to a `machine.Pin` output attached the modem's NRESET pin , it will be used to hard reset the modem before initializing it. If unset, the programmer is responsible for ensuring the modem should be is in an idle state when the object is instantiated. | |
141141
| `lora_cfg` | No | If set to an initial LoRa configuration then the modem is set up with this configuration. If not set here, can be set by calling `configure()` later on. | |
142142
| `ant`_sw | No | Optional antenna switch object instance, see below for description. | |
143143

‎micropython/lora/examples/reliable_delivery/receiver.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def main():
4343
cs,
4444
dio0=Pin(10, mode=Pin.PULL_UP),
4545
dio1=Pin(11, mode=Pin.PULL_UP),
46-
radio_reset=Pin(13, mode=Pin.OPEN_DRAIN),
46+
reset=Pin(13, mode=Pin.OPEN_DRAIN),
4747
lora_cfg=lora_cfg,
4848
)
4949

‎micropython/lora/examples/reliable_delivery/receiver_async.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def main():
4343
cs,
4444
dio0=Pin(10, mode=Pin.PULL_UP),
4545
dio1=Pin(11, mode=Pin.PULL_UP),
46-
radio_reset=Pin(13, mode=Pin.OPEN_DRAIN),
46+
reset=Pin(13, mode=Pin.OPEN_DRAIN),
4747
lora_cfg=lora_cfg,
4848
)
4949

‎micropython/lora/examples/reliable_delivery/sender.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def main():
5656
cs=Pin(3, mode=Pin.OUT, value=1),
5757
busy=Pin(2, mode=Pin.IN),
5858
dio1=Pin(20, mode=Pin.IN),
59-
radio_reset=Pin(15, mode=Pin.OUT),
59+
reset=Pin(15, mode=Pin.OUT),
6060
dio2_rf_sw=True,
6161
dio3_tcxo_millivolts=3300,
6262
lora_cfg=lora_cfg,

‎micropython/lora/examples/reliable_delivery/sender_async.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def main():
5757
cs=Pin(3, mode=Pin.OUT, value=1),
5858
busy=Pin(2, mode=Pin.IN),
5959
dio1=Pin(20, mode=Pin.IN),
60-
radio_reset=Pin(15, mode=Pin.OUT),
60+
reset=Pin(15, mode=Pin.OUT),
6161
dio2_rf_sw=True,
6262
dio3_tcxo_millivolts=3300,
6363
lora_cfg=lora_cfg,

‎micropython/lora/examples/simple_rxtx/simple_rxtx.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def main():
3737
cs,
3838
dio0=Pin(10, mode=Pin.PULL_UP),
3939
dio1=Pin(11, mode=Pin.PULL_UP),
40-
radio_reset=Pin(13, mode=Pin.OPEN_DRAIN),
40+
reset=Pin(13, mode=Pin.OPEN_DRAIN),
4141
lora_cfg=lora_cfg,
4242
)
4343

‎micropython/lora/examples/simple_rxtx/simple_rxtx_async.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ async def main_task():
4141
cs=Pin(3, mode=Pin.OUT, value=1),
4242
busy=Pin(2, mode=Pin.IN),
4343
dio1=Pin(20, mode=Pin.IN),
44-
radio_reset=Pin(15, mode=Pin.OUT),
44+
reset=Pin(15, mode=Pin.OUT),
4545
dio2_rf_sw=True,
4646
dio3_tcxo_millivolts=3300,
4747
lora_cfg=lora_cfg,

‎micropython/lora/lora-sx126x/lora/sx126x.py‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def __init__(
128128
dio2_rf_sw,
129129
dio3_tcxo_millivolts,
130130
dio3_tcxo_start_time_us,
131-
radio_reset,
131+
reset,
132132
lora_cfg,
133133
ant_sw,
134134
):
@@ -154,11 +154,11 @@ def __init__(
154154
# 0x02 is 40us, default value appears undocumented but this is the SX1276 default
155155
self._ramp_val = 0x02
156156

157-
if radio_reset:
157+
if reset:
158158
# If the caller supplies a reset pin argument, reset the radio
159-
radio_reset(0)
159+
reset(0)
160160
time.sleep_ms(1)
161-
radio_reset(1)
161+
reset(1)
162162
time.sleep_ms(5)
163163
else:
164164
self.standby() # Otherwise, at least put the radio to a known state
@@ -730,7 +730,7 @@ def __init__(
730730
dio2_rf_sw=True,
731731
dio3_tcxo_millivolts=None,
732732
dio3_tcxo_start_time_us=1000,
733-
radio_reset=None,
733+
reset=None,
734734
lora_cfg=None,
735735
ant_sw=None,
736736
):
@@ -742,7 +742,7 @@ def __init__(
742742
dio2_rf_sw,
743743
dio3_tcxo_millivolts,
744744
dio3_tcxo_start_time_us,
745-
radio_reset,
745+
reset,
746746
lora_cfg,
747747
ant_sw,
748748
)
@@ -803,7 +803,7 @@ def __init__(
803803
dio2_rf_sw=True,
804804
dio3_tcxo_millivolts=None,
805805
dio3_tcxo_start_time_us=1000,
806-
radio_reset=None,
806+
reset=None,
807807
lora_cfg=None,
808808
ant_sw=None,
809809
):
@@ -815,7 +815,7 @@ def __init__(
815815
dio2_rf_sw,
816816
dio3_tcxo_millivolts,
817817
dio3_tcxo_start_time_us,
818-
radio_reset,
818+
reset,
819819
lora_cfg,
820820
ant_sw,
821821
)

‎micropython/lora/lora-sx127x/lora/sx127x.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ class SX127x(BaseModem):
241241
_IRQ_TX_COMPLETE = _IRQ_TX_DONE
242242

243243
def __init__(
244-
self, spi, cs, dio0=None, dio1=None, radio_reset=None, lora_cfg=None, ant_sw=None
244+
self, spi, cs, dio0=None, dio1=None, reset=None, lora_cfg=None, ant_sw=None
245245
):
246246
super().__init__(ant_sw)
247247

@@ -262,11 +262,11 @@ def __init__(
262262
# Note: a number of these are set in the base class constructor
263263
self._pa_boost = False
264264

265-
if radio_reset:
265+
if reset:
266266
# If the user supplies a reset pin argument, reset the radio
267-
radio_reset(0)
267+
reset(0)
268268
time.sleep_ms(1)
269-
radio_reset(1)
269+
reset(1)
270270
time.sleep_ms(5)
271271

272272
version = self._reg_read(_REG_VERSION)

0 commit comments

Comments
 (0)