-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drivers: Add support for KW41Z builtin transceiver #7107
Closed
Closed
Changes from all commits
Commits
Show all changes
82 commits
Select commit
Hold shift + click to select a range
3e59f40
drivers/kw41zrf: Transceiver driver for the KW41Z radio
f8dfec7
squash kw41zrf fix warnings unused arguments
ff79569
squash kw41zrf vendor whitespace fixes
a83c963
squash kw41zrf vendor code fix warnings
0c35238
squash kw41zrf vendor driver RIOT fixes
63c244b
squash kw41zrf fix vendor LLVM warnings
907ae8e
squash kw41zrf wait for OSC ready before accessing the link layer in …
b1ed075
kw41zrf: Disable VLPS+LLS when radio is active
18c625a
squash kw41zrf LLS fixes
66f8575
squash kw41zrf Improve RF_OSC_CTRL handling
bcce5cd
squash kw41zrf Check that radio is awake before attempting to set opt…
a9ba20d
squash kw41zrf ignore IRQ while in DSM
461768d
squash kw41zrf Turn power on for netdev get/set if necessary
8de0889
squash kw41zrf fix init error RF_OSC_EN
35ad28c
squash kw41zrf set idle_state on sleep
4f5c067
squash kw41zrf fix race in DSM sleep
fb0f551
squash kw41zrf avoid crash if transceiver is already in DSM
dd04c4f
squash kw41zrf fix netdev_get when in DSM
26b7dfc
squash kw41zrf clean up
a0d72b1
squash kw41zrf EINVAL on invalid CCA mode
a9eabaf
squash kw41zrf clean up netdev get
2e1a258
squash kw41zrf init null return value
1cf9fb6
squash kw41zrf send while sleeping stability improvements
4dacd86
squash kw41zrf ifdef MODULE_NETOPT
f5dcf23
squash kw41zrf allow recv during DSM
7c9ec71
squash kw41zrf auto-init
48e9916
fixup! squash kw41zrf auto-init
7a33172
squash fix cppcheck comments
82856a9
squash fsl_xcvr extern C
26718a4
fixup! squash fsl_xcvr extern C
2f7fed6
squash auto init doxygen typo
f6ecb7c
squash kw41zrf clean up init
2ba0911
squash kw41zrf clean up SEQ_IDLE handling
c226f93
squash kw41zrf correct NETOPT_CHANNEL width check
2940893
squash kw41zrf add comment on CCA threshold
b0a4353
squash kw41zrf add cppcheck suppression reason
1f46ef3
squash kw41zrf refactor tx_exec to avoid races
d07734a
squash kw41zrf refactor IRQ flags with DSM
30ee233
squash kw41zrf prevent dead lock when ISR is run while DSM
c0606ce
REMOVE kw41zrf deugging calibration failures
90a2ffa
squash kw41zrf Clean up unused vendor code
fff23d0
squash kw41zrf slimmer vendor init
9eec35b
squash kw41zrf vendor clean up exports
acbfb17
squash kw41zrf vendor slimming WIP
61e5bc0
squash kw41zrf add back handle_ifr
89bd803
squash kw41zrf WIP eliminate float
4ec4d5d
squash kw41zrf split xcvr stuff into separate file
8faf15e
squash kw41zrf clean up xcvr trim
5936c3f
squash kw41zrf disable debug
d4fc730
squash kw41zrf slim vendor calibration
5f7c54f
squash kw41zrf vendor clean up
7c7aae9
squash kw41zrf refactor RESET
71a243e
squash kw41zrf refactor vendor code
e356de6
squash kw41zrf refactor vendor code
03e39ef
squash kw41zrf refactor vendor code, eliminate dead paths
56108a7
squash kw41zrf remove debug timing
10dcf8f
squash kw41zrf Clean up options
28638a6
squash kw41zrf set the correct state at init
d77dae4
squash kw41zrf silence codacy
e3fb55b
squash kw41zrf perform CSMA retry even without NETOPT TELL TX END
dc5cf26
squash kw41zrf add support for debug LEDs
7f1e472
squash kw41zrf debug LED updates
6c7ef37
squash kw41zrf Update flags handling to match changes in #9581
f31a2c4
squash kw41zrf fixup signed bitmask literals
ae975b4
fixup! squash kw41zrf debug LED updates
8e90d22
squash kw41zrf minor clean ups and variable types refactor
9dffa28
examples/default: Add frdm-kw41z to netif boards list
063b038
usb-kw41z: Add settings for SoC radio
767f6eb
usb-kw41z: kw41zrf LED settings
e30291e
squash kw41zrf: Refactor power management to make pm_layered optional
4f561b9
squash kw41zrf clean up LED configuration
fc7c841
fixup! squash kw41zrf: Refactor power management to make pm_layered o…
e4af47c
squash kw41zrf rm old vendor headers
bef0d8d
squash kw41zrf: Remove references to netdev_t::stats, required by #9793
5a362bd
squash kw41zrf remove netdev_t accesses in getset
27f83ee
squash kw41zrf fix _get_txpower declaration
43515a8
squash kw41zrf Refactor addr,chan,nid getters/setters
d3e202d
squash kw41zrf workaround for netdev_t::pan updating until upper laye…
6d3b252
fixup! squash kw41zrf minor clean ups and variable types refactor
75cab70
squash kw41zrf disable LEDs by default
1944a58
phynode-kw41z: Add settings for SoC radio
09ad33f
squash kw41zrf correct PM name in comment
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
/* | ||
* Copyright (C) 2017 SKF AB | ||
* | ||
* This file is subject to the terms and conditions of the GNU Lesser | ||
* General Public License v2.1. See the file LICENSE in the top level | ||
* directory for more details. | ||
*/ | ||
|
||
/** | ||
* @defgroup drivers_kw41zrf KW41Z radio-driver | ||
* @ingroup drivers_netdev | ||
* @brief Device driver for the NXP KW41Z, KW21Z in-cpu transceiver | ||
* @{ | ||
* | ||
* @file | ||
* @brief Interface definition for the kw41zrf driver | ||
* | ||
* @author Joakim Nohlgård <[email protected]> | ||
*/ | ||
|
||
#ifndef KW41ZRF_H | ||
#define KW41ZRF_H | ||
|
||
#include <stdint.h> | ||
|
||
#include "mutex.h" | ||
#include "board.h" | ||
#include "net/netdev.h" | ||
#include "net/netdev/ieee802154.h" | ||
#include "net/gnrc/nettype.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/** | ||
* @brief Maximum packet length | ||
*/ | ||
#define KW41ZRF_MAX_PKT_LENGTH (IEEE802154_FRAME_LEN_MAX) | ||
|
||
/** | ||
* @brief Default PAN ID used after initialization | ||
*/ | ||
#define KW41ZRF_DEFAULT_PANID (IEEE802154_DEFAULT_PANID) | ||
|
||
/** | ||
* @brief Default channel used after initialization | ||
* | ||
* @{ | ||
*/ | ||
#ifndef KW41ZRF_DEFAULT_CHANNEL | ||
#define KW41ZRF_DEFAULT_CHANNEL (IEEE802154_DEFAULT_CHANNEL) | ||
#endif | ||
/** @} */ | ||
|
||
/** | ||
* @brief Allowed range of channels | ||
* | ||
* @{ | ||
*/ | ||
#define KW41ZRF_MIN_CHANNEL (11U) | ||
#define KW41ZRF_MAX_CHANNEL (26U) | ||
/** @} */ | ||
|
||
/** | ||
* @brief Default TX_POWER in dbm used after initialization | ||
*/ | ||
#define KW41ZRF_DEFAULT_TX_POWER (IEEE802154_DEFAULT_TXPOWER) | ||
|
||
/** | ||
* @brief Maximum output power of the kw41z device in dBm | ||
*/ | ||
#define KW41ZRF_OUTPUT_POWER_MAX (4) | ||
|
||
/** | ||
* @brief Minimum output power of the kw41z device in dBm | ||
*/ | ||
#define KW41ZRF_OUTPUT_POWER_MIN (-19) | ||
|
||
/** | ||
* @brief ISR callback function type | ||
*/ | ||
typedef void (*kw41zrf_cb_t)(void *arg); | ||
|
||
/** | ||
* @brief Device descriptor for KW41ZRF radio devices | ||
* | ||
* @extends netdev_ieee802154_t | ||
*/ | ||
typedef struct { | ||
netdev_ieee802154_t netdev; /**< netdev parent struct */ | ||
/** | ||
* @name device specific fields | ||
* @{ | ||
*/ | ||
thread_t *thread; /**< Network driver thread, for providing feedback from IRQ handler */ | ||
uint32_t tx_warmup_time; /**< TX warmup time, in event timer ticks */ | ||
uint32_t rx_warmup_time; /**< RX warmup time, in event timer ticks */ | ||
uint32_t rf_osc_en_idle; /**< RF_OSC_EN bits setting when RF module is in standby */ | ||
int16_t tx_power; /**< The current tx-power setting of the device */ | ||
uint8_t flags; /**< Internal driver option flags */ | ||
uint8_t max_retrans; /**< Maximum number of frame retransmissions | ||
* when no Ack frame is received (macMaxFrameRetries) */ | ||
uint8_t csma_max_backoffs; /**< Maximum number of CSMA backoffs when | ||
* waiting for channel clear (macMaxCsmaBackoffs) */ | ||
uint8_t csma_min_be; /**< Minimum backoff exponent (macMinBe) */ | ||
uint8_t csma_max_be; /**< Maximum backoff exponent (macMaxBe) */ | ||
uint8_t idle_seq; /**< state to return to after sending */ | ||
uint8_t cca_result; /**< Used for passing CCA result from ISR to user */ | ||
uint8_t csma_be; /**< Counter used internally by send implementation */ | ||
uint8_t csma_num_backoffs; /**< Counter used internally by send implementation */ | ||
uint8_t num_retrans; /**< Counter used internally by send implementation */ | ||
uint8_t pm_blocked; /**< true if we have blocked a low power mode in the CPU */ | ||
uint8_t recv_blocked; /**< blocks moving to XCVSEQ_RECEIVE to prevent | ||
* overwriting the RX buffer before the higher | ||
* layers have copied it to system RAM */ | ||
/** @} */ | ||
} kw41zrf_t; | ||
|
||
/** | ||
* @brief Setup an KW41ZRF based device state | ||
* | ||
* @param[out] dev device descriptor | ||
*/ | ||
void kw41zrf_setup(kw41zrf_t *dev); | ||
|
||
/** | ||
* @brief Initialize the given KW41ZRF device | ||
* | ||
* @param[out] dev device descriptor | ||
* @param[in] cb irq callback | ||
* | ||
* @return 0 on success | ||
* @return <0 on error | ||
*/ | ||
int kw41zrf_init(kw41zrf_t *dev, kw41zrf_cb_t cb); | ||
|
||
/** | ||
* @brief Reset radio hardware and restore default settings | ||
* | ||
* @param[in] dev device to reset | ||
* | ||
* @return 0 on success | ||
* @return <0 on initialization failure | ||
*/ | ||
int kw41zrf_reset(kw41zrf_t *dev); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* KW41ZRF_H */ | ||
/** @} */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Use vendor-supplied low level XCVR hardware initialization | ||
DIRS += vendor/XCVR/MKW41Z4 | ||
|
||
include $(RIOTBASE)/Makefile.base |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With #10384 close to being merged, this is not required anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the notify! 👍
Will address this soon-ish.