Revision 2eb9f241 hw/bitbang_i2c.c
b/hw/bitbang_i2c.c | ||
---|---|---|
38 | 38 |
RECEIVING_BIT2, |
39 | 39 |
RECEIVING_BIT1, |
40 | 40 |
RECEIVING_BIT0, |
41 |
SENDING_ACK |
|
41 |
SENDING_ACK, |
|
42 |
SENT_NACK |
|
42 | 43 |
} bitbang_i2c_state; |
43 | 44 |
|
44 | 45 |
struct bitbang_i2c_interface { |
... | ... | |
115 | 116 |
} |
116 | 117 |
switch (i2c->state) { |
117 | 118 |
case STOPPED: |
119 |
case SENT_NACK: |
|
118 | 120 |
return bitbang_i2c_ret(i2c, 1); |
119 | 121 |
|
120 | 122 |
case SENDING_BIT7 ... SENDING_BIT0: |
... | ... | |
155 | 157 |
i2c->state = RECEIVING_BIT7; |
156 | 158 |
if (data != 0) { |
157 | 159 |
DPRINTF("NACKED\n"); |
160 |
i2c->state = SENT_NACK; |
|
158 | 161 |
i2c_nack(i2c->bus); |
159 | 162 |
} else { |
160 | 163 |
DPRINTF("ACKED\n"); |
Also available in: Unified diff