There's nothing against writing an I2C master interface from the scratch, but to do so, you would start with studying the NXP I2C specification, particularly the required signal timing. Then implement hierarchical state machines for bit timing, byte read/write, overall control. ...
Device(I2C1) { Name(_HID, "BCM2841") Name(_CID, "BCMI2C") Name(_UID, 0x1) Method(_STA) { Return(0xf) } Method(_CRS, 0x0, NotSerialized) { Name(RBUF, ResourceTemplate() { Memory32Fixed(ReadWrite, 0x3F804000, 0x20) Interrupt(ResourceConsumer, Level, ActiveHigh, Shared) { 0x...
Hey I really need help writing an I2C Controller that can perform a single byte write and a single byte read. Compensation may be given. Here is
module i2c(SCL_io, SDA_io, clk, rst, write); input write, clk, rst; output SCL_io; inout SDA_io; reg stopcount = 0; reg bitcount = 0; reg msbcount = 0; reg indata = 8'b01001010; reg SCL,SDA; reg pres, next; parameter s0=4'b0000,s1=4'b0001,s2=4'b0010,s3=4'b0011...