`_set_csma_params()` spends some time to prepare a value in
`uint8_t tmp`, which then is never used. Likely this is a leftover
of moving code to `mrf24j40_set_csma_max_retries()`. This drops the
leftover code.
- most were trivial
- missing group close or open
- extra space
- no doxygen comment
- name commad might open an implicit group
this hould also be implicit cosed but does not happen somtimes
- crazy: internal declared groups have to be closed internal
A if `netdev_driver_t::confirm_send()` is provided, it provides the
new netdev API. However, detecting the API at runtime and handling
both API styles comes at a cost. This can be optimized in case only
new or only old style netdevs are in use.
To do so, this adds the pseudo modules `netdev_legacy_api` and
`netdev_new_api`. As right now no netdev actually implements the new
API, all netdevs pull in `netdev_legacy_api`. If `netdev_legacy_api` is
in used but `netdev_new_api` is not, we can safely assume at compile
time that only legacy netdevs are in use. Similar, if only
`netdev_new_api` is used, only support for the new API is needed. Only
when both are in use, run time checks are needed.
This provides two helper function to check for a netif if the
corresponding netdev implements the old or the new API. (With one
being the inverse of the other.) They are suitable for constant folding
when only new or only legacy devices are in use. Consequently, dead
branches should be eliminated by the optimizer.
This changes the prefixes of the symbols generated from USEMODULE and
USEPKG variables. The changes are as follow:
KCONFIG_MODULE_ => KCONFIG_USEMODULE_
KCONFIG_PKG_ => KCONFIG_USEPKG_
MODULE_ => USEMODULE_
PKG_ => USEPKG_
MRF24J40 supports a proprietary turbo mode with a data rate of 625 kbit/s
instead of the standard 250 kbit/s.
It can be enabled through
ifconfig 7 set high_rate 1
During production it is often desirable for devices to perform
some kind of basic self-test to isolate defects.
For this it is necessary for the initialization not to hang if a
component is faulty / not connected.
This moves an already exising self-test that was previously enabled
as a debug option to an independent compile-time configurable.
It is necessary to call this in _init() before mrf24j40_hardware_reset()
as the reset function uses xtimer_usleep() which will cause another
thread to get scheduled.
If this thread (e.g. rpl or ipv6) then tries to access the netdev, RIOT
will crash.
When hooking up the mrf24j40 to a bluepill board, the driver would
always get stuck on init.
Debugging revealed that it would get stuck in the mrf24j40_reset_state_machine()
function because it expects the RFSTATE to have a special value after reset.
However, the data sheet does not mention this in section 3.1 Reset.
Waiting 192µs should be enough - the value of the RFSTATE is not specified.
The Linux driver also does not wait for the RFSTATE register.
And even without the loop, the driver is functioning fine.
The MRF24J40MC/MD/ME modules contain an external power amplifier &
low noise amplifier that has to be enabled manually by setting three bits
in the TESTMODE register.
On MRF24J40MC the power amplifier is powered by a separate voltage regualtor
that has to be enabled by setting GPIO3 to HIGH.
During Sleep and CCA the PA should be disabled.
Co-authored-by: Carton <joel.carron@eeproperty.ch>
Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
This write access is only required when a modification to the PAN ID
happened directly via this function and not via a netdev::set operation.
The only direct call was done in the reset function of the driver