Skip to content
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

IEEE802.15.4 support for nrf52 #11617

Merged
merged 4 commits into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
nrf52/nrf52_radio: various changes to support IEEE802154
- remove read-write logic - this should be handled by radio protocol implementation
- remove EVENTS and TASKS bit definitions - we can just use a signle definition
- add more radio ops
- fix frequency configuration
- fix printf warnings
- fix radio reset
  • Loading branch information
raiden00pl committed Feb 17, 2024
commit 59b9ac6cc38fc88bb59a0cb6c300cddd05caf28b
22 changes: 22 additions & 0 deletions arch/arm/src/nrf52/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ config ARCH_CHIP_NRF52840
select NRF52_HAVE_USBDEV
select NRF52_HAVE_PWM3
select NRF52_HAVE_CRYPTOCELL
select NRF52_HAVE_IEEE802154
select NRF52_HAVE_BLELR

endchoice # NRF52 Chip Selection

Expand Down Expand Up @@ -134,6 +136,14 @@ config NRF52_HAVE_CRYPTOCELL
bool
default n

config NRF52_HAVE_BLELE
bool
default n

config NRF52_HAVE_IEEE802154
bool
default n

# Peripheral Selection

config NRF52_I2C_MASTER
Expand Down Expand Up @@ -611,6 +621,18 @@ endif # NRF52_PWM

endmenu # PWM configuration

menu "RADIO Configuration"

if NRF52_RADIO

config NRF52_RADIO_CUSTOM
bool "RADIO uses custom IRQ handlers"
default n

endif #NRF52_RADIO

endmenu # "RADIO Configuration"

menu "SAADC Configuration"

if NRF52_SAADC
Expand Down
146 changes: 6 additions & 140 deletions arch/arm/src/nrf52/hardware/nrf52_radio.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,146 +206,6 @@

/* Register Bitfield Definitions ********************************************/

/* TASKS_TXEN Register */

#define RADIO_TASKS_TXEN (1 << 0) /* Bit 0: Enable RADIO in TX mode */

/* TASKS_RXEN Register */

#define RADIO_TASKS_RXEN (1 << 0) /* Bit 0: Enable RADIO in RX mode */

/* TASKS_START Register */

#define RADIO_TASKS_START (1 << 0) /* Bit 0: Start RADIO */

/* TASKS_STOP Register */

#define RADIO_TASKS_STOP (1 << 0) /* Bit 0: Stop RADIO */

/* TASKS_DISABLE Register */

#define RADIO_TASKS_DISABLE (1 << 0) /* Bit 0: Disable RADIO */

/* TASKS_RSSISTART Register */

#define RADIO_TASKS_RSSISTART (1 << 0) /* Bit 0: Start the RSSI */

/* TASKS_RSSISTOP Register */

#define RADIO_TASKS_RSSISTOP (1 << 0) /* Bit 0: Stop the RSSI */

/* TASKS_BCSTART Register */

#define RADIO_TASKS_BCSTART (1 << 0) /* Bit 0: Start the bit counter */

/* TASKS_BCSTOP Register */

#define RADIO_TASKS_BCSTOP (1 << 0) /* Bit 0: Stop the bit counter */

/* TASKS_EDSTART Register */

#define RADIO_TASKS_EDSTART (1 << 0) /* Bit 0: Start the energy detect measurement (IEEE 802.15.4) */

/* TASKS_EDSTOP Register */

#define RADIO_TASKS_EDSTOP (1 << 0) /* Bit 0: Stop the energy detect measurement (IEEE 802.15.4) */

/* TASKS_CCASTART Register */

#define RADIO_TASKS_CCASTART (1 << 0) /* Bit 0: Start the channel assessment (IEEE 802.15.4) */

/* TASKS_CCASTOP Register */

#define RADIO_TASKS_CCASTOP (1 << 0) /* Bit 0: Stop the channel assessment (IEEE 802.15.4) */

/* EVENTS_READY Register */

#define RADIO_EVENTS_READY (1 << 0) /* Bit 0: RADIO has ramped up and is ready to be started */

/* EVENTS_ADDRESS Register */

#define RADIO_EVENTS_ADDRESS (1 << 0) /* Bit 0: Address sent or received */

/* EVENTS_PAYLOAD Register */

#define RADIO_EVENTS_PAYLOAD (1 << 0) /* Bit 0: Packet payload sent or received */

/* EVENTS_END Register */

#define RADIO_EVENTS_END (1 << 0) /* Bit 0: Packet sent or received */

/* EVENTS_DISABLED Register */

#define RADIO_EVENTS_DISABLED (1 << 0) /* Bit 0: RADIO has been disabled */

/* EVENTS_DEVMATCH Register */

#define RADIO_EVENTS_DEVMATCH (1 << 0) /* Bit 0: A device address match */

/* EVENTS_DEVMISS Register */

#define RADIO_EVENTS_DEVMISS (1 << 0) /* Bit 0: No device address match */

/* EVENTS_RSSIEND Register */

#define RADIO_EVENTS_RSSIEND (1 << 0) /* Bit 0: Sampling of receive signal strength complete */

/* EVENTS_BCMATCH Register */

#define RADIO_EVENTS_BCMATCH (1 << 0) /* Bit 0: Bit counter reached bit count value */

/* EVENTS_CRCOK Register */

#define RADIO_EVENTS_CRCOK (1 << 0) /* Bit 0: Packet received with CRC ok */

/* EVENTS_CRCERROR Register */

#define RADIO_EVENTS_CRCERROR (1 << 0) /* Bit 0: Packet received with CRC error */

/* EVENTS_FRAMESTART Register */

#define RADIO_EVENTS_FRAMESTART (1 << 0) /* Bit 0: IEEE 802.15.4 length field received*/

/* EVENTS_EDEND Register */

#define RADIO_EVENTS_EDEND (1 << 0) /* Bit 0: ampling of energy detection complete */

/* EVENTS_EDSTOPPED Register */

#define RADIO_EVENTS_EDSTOPPED (1 << 0) /* Bit 0: The sampling of energy detection has stopped */

/* EVENTS_CCAIDLE Register */

#define RADIO_EVENTS_CCAIDLE (1 << 0) /* Bit 0: Wireless medium in idle */

/* EVENTS_CCABUSY Register */

#define RADIO_EVENTS_CCABUSY (1 << 0) /* Bit 0: Wireless medium busy */

/* EVENTS_CCASTOPPED Register */

#define RADIO_EVENTS_CCASTOPPED (1 << 0) /* Bit 0: The CCA has stopped */

/* EVENTS_RATEBOOST Register */

#define RADIO_EVENTS_RATEBOOST (1 << 0) /* Bit 0: Ble_LR CI field received */

/* EVENTS_TXREADY Register */

#define RADIO_EVENTS_TXREADY (1 << 0) /* Bit 0: RADIO has ramped up and is ready to be started TX path */

/* EVENTS_RXREADY Register */

#define RADIO_EVENTS_RXREADY (1 << 0) /* Bit 0: RADIO has ramped up and is ready to be started RX path */

/* EVENTS_MHRMATCH Register */

#define RADIO_EVENTS_MHRMATCH (1 << 0) /* Bit 0: MAC header match found */

/* EVENTS_PHYEND Register */

#define RADIO_EVENTS_PHYEND (1 << 0) /* Bit 0: Last bit is sent on air */

/* SHORTS Register */

#define RADIO_SHORTS_READY_START (1 << 0) /* Bit 0: Shortcut between event READY and task START */
Expand Down Expand Up @@ -622,6 +482,12 @@
# define RADIO_CCACTRL_CCAMODE_CANDED (2 << RADIO_CCACTRL_CCAMODE_SHIFT)
# define RADIO_CCACTRL_CCAMODE_CORED (3 << RADIO_CCACTRL_CCAMODE_SHIFT)
# define RADIO_CCACTRL_CCAMODE_EDTST1 (4 << RADIO_CCACTRL_CCAMODE_SHIFT)
#define RADIO_CCACTRL_CCAEDTHRES_SHIFT (8)
#define RADIO_CCACTRL_CCAEDTHRES_MASK (0xff << RADIO_CCACTRL_CCAEDTHRES_SHIFT)
#define RADIO_CCACTRL_CCACORRTHRES_SHIFT (16)
#define RADIO_CCACTRL_CCACORRTHRES_MASK (0xff << RADIO_CCACTRL_CCACORRTHRES_SHIFT)
#define RADIO_CCACTRL_CCACORRCNT_SHIFT (24)
#define RADIO_CCACTRL_CCACORRCNT_MASK (0xff << RADIO_CCACTRL_CCACORRCNT_SHIFT)

/* POWER Register */

Expand Down
2 changes: 2 additions & 0 deletions arch/arm/src/nrf52/hardware/nrf52_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

#include <nuttx/config.h>

#include "arm_internal.h"

/****************************************************************************
* Public Function Prototypes / Inline Functions
****************************************************************************/
Expand Down
Loading