Skip to content

[I2C, hal, SW] Restructured and refactored the functions#535

Open
KinzaQamar wants to merge 4 commits into
lowRISC:mainfrom
KinzaQamar:i2c_sw_modif
Open

[I2C, hal, SW] Restructured and refactored the functions#535
KinzaQamar wants to merge 4 commits into
lowRISC:mainfrom
KinzaQamar:i2c_sw_modif

Conversation

@KinzaQamar
Copy link
Copy Markdown
Contributor

@KinzaQamar KinzaQamar commented May 7, 2026

Taking the transfer checking part out from the i2c_read_byte() and i2c_write_byte() functions. It is needed when you want to controller wants to read / write multiple bytes.

Merge #545 first as a dependency on this PR

@KinzaQamar KinzaQamar marked this pull request as draft May 7, 2026 20:26
@KinzaQamar KinzaQamar force-pushed the i2c_sw_modif branch 8 times, most recently from c431f00 to a0269e1 Compare May 8, 2026 14:49
@KinzaQamar KinzaQamar marked this pull request as ready for review May 8, 2026 15:38
Comment thread sw/device/examples/i2c.c Outdated
Comment thread sw/device/lib/hal/i2c.c Outdated
@KinzaQamar KinzaQamar marked this pull request as draft May 11, 2026 19:33
@KinzaQamar KinzaQamar force-pushed the i2c_sw_modif branch 8 times, most recently from 49e9862 to ab7f1dc Compare May 12, 2026 12:20
@KinzaQamar KinzaQamar marked this pull request as ready for review May 12, 2026 12:20
Comment thread sw/device/lib/hal/i2c.c Outdated
Comment thread sw/device/lib/hal/i2c.c Outdated
Comment thread sw/device/lib/hal/i2c.c Outdated
@KinzaQamar KinzaQamar force-pushed the i2c_sw_modif branch 3 times, most recently from 79c9fa4 to bb82b9a Compare May 13, 2026 15:08
Taking the transfer checking part out from the i2c_read_byte()
and i2c_write_byte() functions. It is needed when you want to
controller wants to read / write multiple bytes.

Signed-off-by: Kinza Qamar <kqzaman@lowrisc.org>
This is suggested in programmer's guide.

As a precautionary step, reset the FMT fifo before sending any transfer

Signed-off-by: Kinza Qamar <kqzaman@lowrisc.org>
Signed-off-by: Kinza Qamar <kqzaman@lowrisc.org>
Signed-off-by: Kinza Qamar <kqzaman@lowrisc.org>
@KinzaQamar
Copy link
Copy Markdown
Contributor Author

KinzaQamar commented May 13, 2026

Tested examples/i2c.c on an FPGA server:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants