[riot-notifications] [RIOT-OS/RIOT] drivers/dose: make use of UART collision detection feature (#16681)

benpicco notifications at github.com
Mon Jul 26 15:06:52 CEST 2021


### Contribution description

The UART peripheral may have a collision detect feature where it compares each sent bit with each received bit.
This allows us to skip the software collision detection and save CPU cycles and context switches by relying on the hardware.

![image](https://user-images.githubusercontent.com/1301112/126993075-9cbdbc56-8058-455c-ac8c-8dd188a03a3a.png)

To prevent unnecessary interrupts during TX, we disable the RX complete interrupt when collision detection is enabled.

### Testing procedure

This is still entirely untested. 
It should show a significant reduction in CPU cycles spent on the `dose` thread when sending data.


### Issues/PRs references

build on top of #16506

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

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

-- Commit Summary --

  * drivers/periph/uart: add periph_uart_rx_start feature
  * cpu/sam0_common: implement periph_uart_rx_start feature
  * drivers/dose: make use of periph_uart_rx_start feature
  * tests/periph_uart: add automated test
  * drivers/periph/uart: add periph_uart_collision feature
  * cpu/sam0_common: implement periph_uart_collision feature
  * drivers/dose: make use of periph_uart_collision feature
  * tests/periph_uart: add test for periph_uart_collision feature

-- File Changes --

    M cpu/sam0_common/Kconfig (1)
    M cpu/sam0_common/Makefile.features (1)
    M cpu/sam0_common/periph/uart.c (70)
    M cpu/samd21/Kconfig (4)
    M cpu/samd21/Makefile.features (4)
    M cpu/samd5x/Kconfig (1)
    M cpu/samd5x/Makefile.features (1)
    M cpu/saml1x/Kconfig (1)
    M cpu/saml1x/Makefile.features (1)
    M cpu/saml21/Kconfig (1)
    M cpu/saml21/Makefile.features (1)
    M drivers/dose/Makefile.dep (2)
    M drivers/dose/dose.c (87)
    M drivers/dose/include/dose_params.h (5)
    M drivers/include/dose.h (7)
    M drivers/include/periph/uart.h (94)
    M drivers/periph_common/Kconfig.uart (8)
    M kconfigs/Kconfig.features (10)
    M tests/periph_uart/Kconfig (2)
    M tests/periph_uart/Makefile (2)
    M tests/periph_uart/main.c (102)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/16681.patch
https://github.com/RIOT-OS/RIOT/pull/16681.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/16681
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210726/62785ac4/attachment.htm>


More information about the notifications mailing list