Skip to content

arch/avr/src/avrdx: Add TWI support, fix missing pins code, doc update. - #17404

Merged
xiaoxiang781216 merged 2 commits into
apache:masterfrom
cederom:avrdx_twi_rfc1-2
Dec 1, 2025
Merged

arch/avr/src/avrdx: Add TWI support, fix missing pins code, doc update.#17404
xiaoxiang781216 merged 2 commits into
apache:masterfrom
cederom:avrdx_twi_rfc1-2

Conversation

@cederom

@cederom cederom commented Nov 29, 2025

Copy link
Copy Markdown
Contributor

Summary

This is a PR transfer from kerogit delivered over mailing list.

  1. This patch adds support for Two-Wire interface in AVR Dx chips. Only master mode is supported in this version.

  2. The Kconfig configuration was offering alternate routing options for USART peripherals but there was no code which would act on those settings. This patch fixes it.

  3. Additionally, since the code is being worked on, this patch also renames USART-related configuration options from AVR_HAS_ to AVR_HAVE_. This is based on GitHub and mailing list discussion where it was pointed out that other architectures use "HAVE".

  4. Documentation updates and fixes.

Depends-on: #17403.

Impact

  • AVR Dx: Adds support for TWI on AVR Dx chips.
  • AVR Dx: Adds missing code for USART alternate routing.
  • AVR Dx: Documentation update.

Testing

  1. The driver was tested using TC74Ax thermal sensor and simple application that read the temperature from it. (Driver for the sensor is not in-tree, it will be delivered in separate PR.)
  2. Patch was tested by choosing few combinations of the configuration and verifying which registers are being set in disassembly. Base configuration was also tested by an application that uses two ports.
nsh> tc74_test
tc74_test [4:100]
nsh> Starting TC74 test
Temperature read: 23
Temperature read: 23

@github-actions github-actions Bot added Area: Documentation Improvements or additions to documentation Arch: avr Issues related to all AVR(8-bit or 32-bit) architectures Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces. labels Nov 29, 2025
The Kconfig configuration was offering alternate routing options
for USART peripherals but there was no code which would act
on those settings. This patch fixes it.

Additionally, since the code is being worked on, this patch
also renames USART-related configuration options from AVR_HAS_
to AVR_HAVE_ . This is based on GitHub and mailing list discussion
where it was pointed out that other architectures use "HAVE".

Patch was tested by choosing few combinations of the configuration
and verifying which registers are being set in disassembly. Base
configuration was also tested by an application that uses two ports.

Signed-off-by: Kerogit <kr.git@kerogit.eu>
@cederom

cederom commented Nov 29, 2025

Copy link
Copy Markdown
Contributor Author

Response from kerogit:

the coding style errors in avrdx_lowconsole.c and avrdx_init.c are
fixed. Turns out I forgot to checkpatch some files, sorry about that.
Updated branches are avrdx_twi_rfc1-4 and avrdx_twi_rfc1-2. To be sure, I scanned the series as a whole now and it should hopefully be
everything.

This patch adds support for Two-Wire interface in AVR Dx chips.
Only master mode is supported in this version.

The driver was tested using TC74Ax thermal sensor and simple application
that read the temperature from it. (Driver for the sensor is not in-tree.)

Signed-off-by: Kerogit <kr.git@kerogit.eu>
@cederom

cederom commented Nov 29, 2025

Copy link
Copy Markdown
Contributor Author

Typos fixed, lets see now :-)

@xiaoxiang781216
xiaoxiang781216 merged commit 5318c1a into apache:master Dec 1, 2025
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: avr Issues related to all AVR(8-bit or 32-bit) architectures Area: Documentation Improvements or additions to documentation Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants