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

cpu/qn908x: Add support for UART. #15550

Merged
merged 1 commit into from Dec 3, 2020
Merged

Conversation

iosabi
Copy link
Contributor

@iosabi iosabi commented Dec 3, 2020

Contribution description

The QN908x has four FLEXCOMM interfaces that support a subset of UART,
SPI or I2C each one. This patch adds generic support for dealing with
the FLEXCOMM initialization and interrupts and adds a driver for
RX/TX support in UART.

With this patch is now possible to use a shell on the device over UART.

Testing procedure

make BOARD=qn9080dk -C examples/hello-world/ flash

main(): This is RIOT! (Version: 2021.01-devel-1350-g7624b8-qn908x_uart)
Hello World!
You are running RIOT on a(n) qn9080dk board.
This board features a(n) qn908x MCU.

Issues/PRs references

This is part of the FR #13852 .

@benpicco benpicco added Area: cpu Area: CPU/MCU ports Type: new feature The issue requests / The PR implemements a new feature for RIOT labels Dec 3, 2020
cpu/qn908x/periph/flexcomm.c Show resolved Hide resolved
cpu/qn908x/periph/flexcomm.c Show resolved Hide resolved
cpu/qn908x/periph/flexcomm.c Show resolved Hide resolved
cpu/qn908x/periph/uart.c Outdated Show resolved Hide resolved
cpu/qn908x/periph/uart.c Outdated Show resolved Hide resolved
cpu/qn908x/periph/uart.c Outdated Show resolved Hide resolved
cpu/qn908x/periph/uart.c Outdated Show resolved Hide resolved
The QN908x has four FLEXCOMM interfaces that support a subset of UART,
SPI or I2C each one. This patch adds generic support for dealing with
the FLEXCOMM initialization and interrupts and adds a driver for
RX/TX support in UART.

With this patch is now possible to use a shell on the device over UART.
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Dec 3, 2020
@iosabi
Copy link
Contributor Author

iosabi commented Dec 3, 2020

I have the next one ready: https://github.com/iosabi/RIOT/tree/qn908x_ctimer but due to conflicts with this one I have it stacked on top of this commit. Turns out I need xtimer to work to be able to test rtc with this tests/

I'm not quite sure who should decide the number of CTIMER blocks used for the periph_timer, because you can also use them for counters and maybe pwm, so is it the app board or cpu?

@benpicco benpicco merged commit a1e9d3b into RIOT-OS:master Dec 3, 2020
@benpicco
Copy link
Contributor

benpicco commented Dec 3, 2020

I'm not quite sure who should decide the number of CTIMER blocks used for the periph_timer, because you can also use them for counters and maybe pwm, so is it the app board or cpu?

On most MCUs the timers can also be used for PWM.
E.g. see sam0_common (samd21, samd51 etc).

Here the board must ensure that timers and pwm do not conflict. On saml1x there are only three TC peripherals (Timer Counter / PWM), or two if TC0 & TC1 are used as one 32 bit timer.

That's why not all PWM configurations are enabled by default there, those can only be used with another timer source (e.g. SysTick) - but eventually it's up to the user / application builder to solve the conflict.

@iosabi iosabi deleted the qn908x_uart branch December 4, 2020 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: cpu Area: CPU/MCU ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants