
RP6 ROBOT SYSTEM - 4. Programming the RP6
Apart from the requestedDataReady Handler there is an Event Handler for error-pro-
cessing. Whenever an error occurs in data transfers, e.g. by a non-responding slave, a
special Event Handler will be called. It has to be registered with this function:
void I2CTWI_setTransmissionErrorHandler(void (*transmissionErrorHandler)
(uint8_t))
The handler must have the signature pattern:
void I2C_transmissionError(uint8_t errorState)
defining an error state-code as parameter. You can find an overview of these error
codes in the “I²C Master Mode”-header file.
In fact, you can use this Event Handler for detecting errors for all, background, fore-
ground and blocking functions.
There are a few example programs for Master Mode on the CD – and we will discuss
then in detail in the next chapter.
- 110 -