Skip to content

sx127x: add functions used for FSK radio communication - #823

Merged
deadprogram merged 1 commit into
devfrom
sx127x-fsk
Jan 3, 2026
Merged

sx127x: add functions used for FSK radio communication#823
deadprogram merged 1 commit into
devfrom
sx127x-fsk

Conversation

@deadprogram

Copy link
Copy Markdown
Member

This PR adds a few missing functions to the sx127x that are used for FSK radio communication. It also cleans up a few existing functions to clarify the implementation. Also tested that Lora still works!

@deadprogram

Copy link
Copy Markdown
Member Author

Review requested please! 😸

@HattoriHanzo031 HattoriHanzo031 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some small, non-functional adjustments for clarity/consistency.

Comment thread sx127x/sx127x.go
d.spiRxBuf = append(d.spiRxBuf, 0)
d.spi.Tx(nil, d.spiRxBuf)
d.controller.SetNss(true)
if d.controller != nil {

@HattoriHanzo031 HattoriHanzo031 Dec 26, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a use-case of using the driver without the controller? If yes, maybe we could in New set the default nopControler that does nothing to avoid this checks.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to leave that question for a future PR.

Comment thread sx127x/sx127x.go Outdated
Comment thread sx127x/sx127x.go
Comment thread sx127x/sx127x.go
controller RadioController // to manage interrupts with the radio
deepSleep bool // Internal Sleep state
deviceType int // sx1261,sx1262,sx1268 (defaults sx1261)
deviceType int // sx1272, sx1273, sx1276, sx1279 (defaults sx1276)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deviceType is actually not used anywhere

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was an oversight on my part, I think. I have added SetDeviceType() to make consistent with sx126x.

@deadprogram

Copy link
Copy Markdown
Member Author

Thanks for the feedback @HattoriHanzo031 I have made a few updates.

I also added a smoketest for the sx127x which was missing. So I think this PR is now ready.

Comment thread sx127x/registers.go Outdated

@HattoriHanzo031 HattoriHanzo031 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me (after unused constants are removed)

Signed-off-by: deadprogram <ron@hybridgroup.com>
@deadprogram
deadprogram merged commit a35786b into dev Jan 3, 2026
1 check passed
@deadprogram
deadprogram deleted the sx127x-fsk branch January 3, 2026 16:49
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.

2 participants