Skip to content

Commit 6b3d6b1

Browse files
committed
Add register documentation
1 parent 57111a8 commit 6b3d6b1

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed

rtl/i2c_master_wbs_8.v

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,78 @@ sda \__/_6_X_5_X_4_X_3_X_2_X_1_X_0_/_W_\_A_/_7_X_6_X_5_X_4_X_3_X_2_X_1_X_0_\_A
8181
____ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ____
8282
scl ST \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ SP
8383
84+
Registers:
85+
86+
| Addr | Name | Bit 7 | Bit 6 | Bit 5 | Bit 4 | Bit 3 | Bit 2 | Bit 1 | Bit 0 |
87+
|-------|---------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
88+
| 0x00 | Status | - | - | - | - | miss_ack | bus_act | bus_cont | busy |
89+
| 0x01 | FIFO Status | rd_full | rd_empty | wr_ovf | wr_full | wr_empty | cmd_ovf | cmd_full | cmd_empty |
90+
| 0x02 | Cmd Addr | - | cmd_address[6:0] |
91+
| 0x03 | Command | - | - | - | cmd_stop | - | cmd_write | cmd_read | cmd_start |
92+
| 0x04 | Data | data[7:0] |
93+
| 0x05 | Reserved | - |
94+
| 0x06 | Prescale Low | prescale[7:0] |
95+
| 0x07 | Prescale High | prescale[15:8] |
96+
97+
Status registers:
98+
99+
| Addr | Name | Bit 7 | Bit 6 | Bit 5 | Bit 4 | Bit 3 | Bit 2 | Bit 1 | Bit 0 |
100+
|-------|---------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
101+
| 0x00 | Status | - | - | - | - | miss_ack | bus_act | bus_cont | busy |
102+
| 0x01 | FIFO Status | rd_full | rd_empty | wr_ovf | wr_full | wr_empty | cmd_ovf | cmd_full | cmd_empty |
103+
104+
busy: high when module is performing an I2C operation
105+
bus_cont: high when module has control of active bus
106+
bus_act: high when bus is active
107+
miss_ack: set high when an ACK pulse from a slave device is not seen; cleared when read
108+
cmd_empty: command FIFO empty
109+
cmd_full: command FIFO full
110+
cmd_ovf: command FIFO overflow; cleared when read
111+
wr_empty: write data FIFO empty
112+
wr_full: write data FIFO full
113+
wr_ovf: write data FIFO overflow; cleared when read
114+
rd_empty: read data FIFO is empty
115+
rd_full: read data FIFO is full
116+
117+
Command registers:
118+
119+
| Addr | Name | Bit 7 | Bit 6 | Bit 5 | Bit 4 | Bit 3 | Bit 2 | Bit 1 | Bit 0 |
120+
|-------|---------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
121+
| 0x02 | Cmd Addr | - | cmd_address[6:0] |
122+
| 0x03 | Command | - | - | - | cmd_stop | - | cmd_write | cmd_read | cmd_start |
123+
124+
cmd_address: I2C address for command
125+
cmd_start: set high to issue I2C start, write to push on command FIFO
126+
cmd_read: set high to start read, write to push on command FIFO
127+
cmd_write: set high to start write, write to push on command FIFO
128+
cmd_stop: set high to issue I2C stop, write to push on command FIFO
129+
130+
Setting more than one command bit is allowed. Start or repeated start
131+
will be issued first, followed by read or write, followed by stop. Note
132+
that setting read and write at the same time is not allowed, this will
133+
result in the command being ignored.
134+
135+
Data register:
136+
137+
| Addr | Name | Bit 7 | Bit 6 | Bit 5 | Bit 4 | Bit 3 | Bit 2 | Bit 1 | Bit 0 |
138+
|-------|---------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
139+
| 0x04 | Data | data[7:0] |
140+
141+
data: I2C data, write to push on write data FIFO, read to pull from read data FIFO
142+
143+
Prescale register:
144+
145+
| Addr | Name | Bit 7 | Bit 6 | Bit 5 | Bit 4 | Bit 3 | Bit 2 | Bit 1 | Bit 0 |
146+
|-------|---------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
147+
| 0x06 | Prescale Low | prescale[7:0] |
148+
| 0x07 | Prescale High | prescale[15:8] |
149+
150+
prescale: prescale value
151+
152+
set prescale to 1/4 of the minimum clock period in units of input clk cycles
153+
154+
prescale = Fclk / (FI2Cclk * 4)
155+
84156
Commands:
85157
86158
read

0 commit comments

Comments
 (0)