Skip to content

added nrf24l01 module code#873

Open
freaksplayground wants to merge 2 commits into
tinygo-org:devfrom
freaksplayground:nrf24l01
Open

added nrf24l01 module code#873
freaksplayground wants to merge 2 commits into
tinygo-org:devfrom
freaksplayground:nrf24l01

Conversation

@freaksplayground

@freaksplayground freaksplayground commented Jun 11, 2026

Copy link
Copy Markdown

Module: NRF24L01

How to use:

  1. Setup Pins:
    • SPI - SPI (frequency between 1_000_000 to 4_000_000)
    • CSN - PIN Output
    • CE - PIN Output
    • IRQ - PIN InputPullup
  2. Create SPI Config (default available)
  3. Create Config
  4. Create New Module

Establishing connection:

Make sure all conditions are met:

  • sender TX_ADDR == receiver RX_ADDR_P0 (only one available for now)
  • sender RF_CH == receiver RF_CH
  • sender Bandwidth == receiver Bandwidth
  • sender PowerOutput == receiver PowerOutput (could be different, just makes stuff a lot easier)
  • sender PackageSize == receiver PackageSize

Sending Data

  • A: Send(data) where data max length = 31 (if packagesize == 32)
  • B: WritePayload(data) but keep first index clear
  • C: WriteMultiRegister(W_TX_Payload,data) if you want to control everything

Reading Data

  • (OPTIONAL) Check HasIRQ() (for SPI performance)
  • HasData() to check FIFO values
  • A: ReadPayload() (opinionated message framing with first bit being message length)
  • B: ReadMultiRegister(R_RX_PAYLOAD) (raw data for custom framing)

Needed one, so I wrote one. Maybe this fits here.
If you have suggestions, you know what to do. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant