[riot-notifications] [RIOT-OS/RIOT] sx126x: add support for multiple simultaneous variants (#16597)

José Alamos notifications at github.com
Wed Jun 30 14:51:47 CEST 2021


<!--
The RIOT community cares a lot about code quality.
Therefore, before describing what your contribution is about, we would like
you to make sure that your modifications are compliant with the RIOT
coding conventions, see https://github.com/RIOT-OS/RIOT/wiki/Coding-conventions.
-->

### Contribution description
This PR adds support for multiple simultaneous sx126x variants running in the same binary, while at the same time keeping all compile time optimizations.

This idea can be used as a base for #16579, in which a periph version of the driver and an external might be used at the same time.

This PR reduces already ~12 bytes for sx1261 because the compile is not always able to put the pa_cfg structure in ROM (see https://github.com/RIOT-OS/RIOT/commit/f635a102f62cec0408cfb0b579b4e7414dad6fec). After the last commit, this remains unchanged.
<!--
Put here the description of your contribution:
- describe which part(s) of RIOT is (are) involved
- if it's a bug fix, describe the bug that it solves and how it is solved
- you can also give more information to reviewers about how to test your changes
-->


### Testing procedure
The easiest way to test it is to select the corresponding driver version in periph_conf.h and compile it with an extra module. E.g
```
USEMODULE="sx1261 llcc68" make flash term
```
And make sure everything works.

<!--
Details steps to test your contribution:
- which test/example to compile for which board and is there a 'test' command
- how to know that it was not working/available in master
- the expected success test output
-->


### Issues/PRs references
#16579
<!--
Examples: Fixes #1234. See also #5678. Depends on PR #9876.

Please use keywords (e.g., fixes, resolve) with the links to the issues you
resolved, this way they will be automatically closed when your pull request
is merged. See https://help.github.com/articles/closing-issues-using-keywords/.
-->

You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/16597

-- Commit Summary --

  * sx126x: move pa_cfg to ROM
  * sx126x: add static inline functions to get driver type
  * sx126x: add support for multiple simultaneous variants

-- File Changes --

    M drivers/include/sx126x.h (119)
    M drivers/sx126x/include/sx126x_params.h (17)
    M drivers/sx126x/sx126x.c (51)
    M drivers/sx126x/sx126x_netdev.c (12)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/16597.patch
https://github.com/RIOT-OS/RIOT/pull/16597.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16597
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210630/f759729d/attachment.htm>


More information about the notifications mailing list