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/sam0_common: UART: implement inverted RX & TX #14300

Merged
merged 1 commit into from
Jun 17, 2020

Conversation

benpicco
Copy link
Contributor

Contribution description

The UART TX and TX lines on SAMD5x and SAML1x can be inverted.
However, the flags don't do exactly what one would expect.

See errata 2.18.5: SERCOM-UART: TXINV and RXINV Bits Reference:

The TXINV and RXINV bits in the CTRLA register have inverted functionality.

Workaround:
In software interpret the TXINV bit as a functionality of RXINV, and conversely,
interpret the RXINV bit as a functionality of TXINV.

Testing procedure

Issues/PRs references

@benpicco benpicco added Type: new feature The issue requests / The PR implemements a new feature for RIOT Area: cpu Area: CPU/MCU ports labels Jun 16, 2020
The UART TX and TX lines on SAMD5x and SAML1x can be inverted.
However, the flags don't do exactly what one would expect.

See errata 2.18.5: SERCOM-UART: TXINV and RXINV Bits Reference:

> The TXINV and RXINV bits in the CTRLA register have inverted functionality.
>
> Workaround:
> In software interpret the TXINV bit as a functionality of RXINV, and conversely,
> interpret the RXINV bit as a functionality of TXINV.
@benpicco benpicco force-pushed the cpu/sam0_common/uart_txinv branch from 0c0569e to 585dc15 Compare June 16, 2020 20:55
@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 Jun 16, 2020
Copy link
Contributor

@fjmolinas fjmolinas left a comment

Choose a reason for hiding this comment

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

I don't have a BOARD supporting this functionality, but implementation matches the datasheet and errata. ACK.

@fjmolinas fjmolinas merged commit 4c05c02 into RIOT-OS:master Jun 17, 2020
@benpicco benpicco deleted the cpu/sam0_common/uart_txinv branch June 17, 2020 09:44
@miri64 miri64 added this to the Release 2020.07 milestone Jun 24, 2020
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.

3 participants