The value of the STATUS register is always transmitted by the chip when
reading any command. So a R_REGISTER command and the turnaround time can
be spared by issuing a NOP command instead.
This implementation suggested by the datasheet.
This operation is compatible with both nRF24L01 and nRF24L01+.
Signed-off-by: Marcell Pünkösd <punkosdmarcell@rocketmail.com>
The timeout condition was not handled before. Upon timeout, this caused
the chip to stay active until another send command changed it's state.
Sometimes when it was unable to transmit the data, it got stuck in the tx
fifo causing it to fill up over time, which set the TX_FULL flag in the
STATUS register.
Since there was no exceptions raised, the user code could not differentiate
a successful send or a timeout condition.
Signed-off-by: Marcell Pünkösd <punkosdmarcell@rocketmail.com>
According to the datasheet of the NRF240L1 chip, 150 μs startup time is
only acceptable when the chip is clocked externally. Most modules use a
crystal, which require 1.5 ms to settle. It should be okay to wait more in
both cases, for a reliable startup.
Signed-off-by: Marcell Pünkösd <punkosdmarcell@rocketmail.com>
This changes almost all uses of "u-module" to just "module" for the
following built-in modules:
- binascii
- collections
- errno
- io
- json
- socket
- struct
- sys
- time
There are some remaining uses of "u-module" naming, for the cases where the
built-in module is extended in Python, eg `python-stdlib/os` uses `uos`.
Also, there are remaining uses of `utime` when non-standard (compared to
CPython) functions are used, like `utime.ticks_ms()`.
Signed-off-by: Damien George <damien@micropython.org>
Mostly small cleanups to put each top-level import on its own line. But
explicitly disable the lint for examples/tests which insert the current
directory into the path before importing.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
This is the last remaining use of the "options" feature. Nothing in the
main repo which `require()`'s this package sets it.
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Looks like copy-pasta from bmi270 driver.
There is a soft reset capability documented in the BMM150 datasheet, but it
uses different register bits and I don't have a BMM150 at hand to test it.
Found by Ruff checking F821.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
Use explicit pin numbers to instantiate the SPI interface on RP2.
On ESP32 use SoftSPI(...) rather than SPI(-1, ...).
Update terminology to initiator/responder.
Tested with two Pico boards.
Originally by @peterhinch.
See https://github.com/micropython/micropython/pull/6007 for discussion.
The summary is that on some cards (especially older Kingston ones) if the
bus is shared with other SPI devices, then it seems to require that MISO
is high for a few cycles before the transaction is initiated.
Because CS is high, this change should otherwise be a no-op.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Check the machine module first, then search in previous places. This
supports having machine.dht_readinto as the new standard, while still being
backwards compatible.