Extracts all I2C events including START,STOP,ACK,NAK. Also sends separate events for special codes, address, R/W and data fields. Note that framing is inherent in this protocol so the preparser sends START and STOP events to your plug-in.
Configuration Options provided by the pre-processor
The built-in I2C preparser generates 16 events. A single event is sent at a time. The event code is placed in byte and is encoded as shown below:
Generated whenever the start condition is detected on the bus.
Generated when the first byte holds the special code: 0000 0001. Under normal operation, the plug-in should expect to receive a NAK event followed by a Repeated start (Sr) event and then any normal ADDRESS event.
Generated for all general 7 bit addresses in the first byte. byte contains the entire 8 bit value of the first field. This includes the 7 bit address in the upper 7 bits and the direction bit in the LSB. One would normally ignore the direction bit and just grab the address at this point. A DIR event will follow shortly to timestamp the direction bit. It will include the same data as this call, allowing you to handle the address and/or direction in either/both calls.
Generated when the GENERAL-CALL code ( 0000 0000) is detected in the first byte. Under normal operation, the plug-in would then expect to receive an ACK event followed by the general-call sub code in a DATA event.
Generated when the first byte contains the CBUS code (0000 001X). Following this event, the preparser ignores all bus activity until a STOP condition is detected. The plug-in will receive a STOP event when the CBUS activity completes.
Generated when the special HSMASTER code (0000 1XXX) is detected in the first byte. The XXX is the master's code. Data contains the full 8 bit code. Under normal operation the plug-in would expect this to be followed by a NAK event, a repeated start event and then a normal 7bit address event. High speed operations remains in effect until a STOP event is received.
Generated when an address within the 2 reserved ranges is detected in the first byte. data contains the address and direction bit. A DIR event will follow with direction bit's timestamp and the same data.
Generated when the special 10Bit Code (1111 0XX) is detected in the upper 7 bits of the first byte. Notice the XX bits are the upper 2 bits of a 10 bit address. The remaining 8 bits come from the next byte or are assumed from the context. The pre-parser does not look at the direction bit, the next byte and/or the presence of a Repeated start to decode the actual 10 bit address. It simply reports the detection of this code. Of course, additional events will follow to report DIR, data and start/repeated starts so that a plug-in could determine the full 10 bit address just as a slave device would.
Generated for the Direction bit. The LSB of data indicates the bit value; 1=> Read, 0=> Write. The upper 7 bits of data contain the 7bit address this DIR event refers to. It can be ignored as it was sent to the ADDRESS event earlier.
Generated for the Ack/Nak bit. The LSB of data indicates the bit value; 1=> NAK, 0=> ACK
Generated at the start of each byte of data in the payload. data contains the data.
Generated whenever the stop condition is detected on the bus.
Generated when a partial byte of data was received.
Generated whenever the start condition is detected on the bus WITHOUT a preceding STOP condition. This is called a Repeated Start.
Generated to timestamp the end of a byte of data. Usually used to allow display of idle periods between the last data bit and the ACK.NAK bit.