Skip to content
Permalink
Browse files

drivers: ieee802154_nrf5: Implement configure API

Implement newly introduced `configure` API for nRF 802154 radio driver.

Increase maximum number of slots for Frame Pending bit information in
the radio driver.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
  • Loading branch information...
rlubos authored and nashif committed Apr 16, 2019
1 parent 93a77c0 commit e0ff342a89dc87c6f0b89fb24a464d48e6f8dfb0
Showing with 44 additions and 2 deletions.
  1. +42 −0 drivers/ieee802154/ieee802154_nrf5.c
  2. +2 −2 ext/hal/nordic/drivers/nrf_radio_802154/CMakeLists.txt
@@ -388,6 +388,47 @@ static void nrf5_iface_init(struct net_if *iface)
ieee802154_init(iface);
}

int nrf5_configure(struct device *dev, enum ieee802154_config_type type,
const struct ieee802154_config *config)
{
ARG_UNUSED(dev);

switch (type) {
case IEEE802154_CONFIG_AUTO_ACK_FPB:
nrf_802154_auto_pending_bit_set(config->auto_ack_fpb.enabled);
break;

case IEEE802154_CONFIG_ACK_FPB:
if (config->ack_fpb.enabled) {
if (!nrf_802154_pending_bit_for_addr_set(
config->ack_fpb.addr,
config->ack_fpb.extended)) {
return -ENOMEM;
}

break;
}

if (config->ack_fpb.addr != NULL) {
if (!nrf_802154_pending_bit_for_addr_clear(
config->ack_fpb.addr,
config->ack_fpb.extended)) {
return -ENOENT;
}
} else {
nrf_802154_pending_bit_for_addr_reset(
config->ack_fpb.extended);
}

break;

default:
return -EINVAL;
}

return 0;
}

/* nRF5 radio driver callbacks */

void nrf_802154_received_raw(uint8_t *data, int8_t power, uint8_t lqi)
@@ -468,6 +509,7 @@ static struct ieee802154_radio_api nrf5_radio_api = {
.start = nrf5_start,
.stop = nrf5_stop,
.tx = nrf5_tx,
.configure = nrf5_configure,
};

#if defined(CONFIG_NET_L2_IEEE802154)
@@ -52,11 +52,11 @@ zephyr_compile_definitions(

# Number of slots containing short addresses of nodes for which
# pending data is stored.
NRF_802154_PENDING_SHORT_ADDRESSES=1
NRF_802154_PENDING_SHORT_ADDRESSES=16

# Number of slots containing extended addresses of nodes for which
# pending data is stored.
NRF_802154_PENDING_EXTENDED_ADDRESSES=1
NRF_802154_PENDING_EXTENDED_ADDRESSES=16

# Number of buffers in receive queue.
NRF_802154_RX_BUFFERS=8

0 comments on commit e0ff342

Please sign in to comment.
You can’t perform that action at this time.