Confusing comment on the `pio_i2c` example

Open
#673 1 comment 0 reactions 1 assignee View on GitHub

@Wren6991 is already working on this.

Since Oct 21, 2021.

Assessment

This issue has not been assessed yet.

Description

question

The PIO comments in i2c.pio state that:

; The TX FIFO should be accessed with halfword writes, to ensure
; the data is immediately available in the OSR.

In the c-sdk, the Tx FIFO is declared as an array of 32bit write only integers but the c code in pio_i2c.c goes some length to do 16bit writes.

This is a confusing claim as 32bits writes are expected to be atomic anyway.

I could not find information in the datasheet to confirm or deny that statement.

  • If that is really necessary the datasheet should be updated with some explanation as to why this is required.
  • If not the comment in i2c.pio should be amended and the code in pio_i2c.c be simplified.
Dominant language
C
Stars
3.9k
Forks
1k
Avg merge
1d 16h
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from raspberrypi/pico-examples

All issues in raspberrypi/pico-examples

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.