Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

✨ add new module: device-mode I²C controller ("TWD") #1121

Merged
merged 20 commits into from
Dec 15, 2024

Conversation

stnolting
Copy link
Owner

@stnolting stnolting commented Dec 14, 2024

This PR add a new module - the Two-Wire Device (TWD). It implements a device-mode I2C-compatible peripheral external I2C hosts can communicate with.

Key Features

  • configurable RX/TX data FIFO to allow CPU-independent operation
  • programmable 7-bit device address
  • programmable interrupt condition

I²C Sequence Layout

  • START condition
  • 7 address bits + R/W bit
  • address-match ACK generated by TWD
  • read: arbitrary number of TX data bytes (read from TX FIFO); ACK generated by the host
  • write: arbitrary number of RX data bytes (written to RX FIFO); ACK generated by TWD
  • STOP condition

New Top Generics

IO_TWD_EN   : boolean                  := false; -- implement two-wire device (TWD)?
IO_TWD_FIFO : natural range 1 to 2**15 := 1;     -- TWD RX/TX FIFO depth, has to be zero or a power of two, min 1

New Top Ports

-- TWD (available if IO_TWD_EN = true) --
twd_sda_i  : in  std_ulogic := 'H'; -- serial data line sense input
twd_sda_o : out std_ulogic;         -- serial data line output (pull low only)
twd_scl_i : in  std_ulogic := 'H';  -- serial clock line sense input
twd_scl_o : out std_ulogic;         -- serial clock line output (pull low only)

@stnolting stnolting added enhancement New feature or request HW Hardware-related labels Dec 14, 2024
@stnolting stnolting self-assigned this Dec 14, 2024
@stnolting stnolting changed the title ✨ add new module: device-mode I²C controller ✨ add new module: device-mode I²C controller ("TWD") Dec 14, 2024
@stnolting stnolting marked this pull request as ready for review December 15, 2024 19:27
@stnolting stnolting merged commit 3d986cb into main Dec 15, 2024
10 checks passed
@stnolting stnolting deleted the i2c_device_controller branch December 15, 2024 21:00
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request HW Hardware-related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant