I am trying to get the mgc3130 development board working (through I2C) with the Intel Edison using MRAA. I got it working with a teensy in the past but the hassle is the 'open drain' TS_line required in this particular case. Is there a way to define a GPIO (or other) pin as 'open drain'? And can this be done in combination with a level convertor?
From the MGC3130 gestuc kubrart
The TS line is used to check whether the I2C data is valid and can be sent from MGC3X30 to the host controller.
The MGC3X30 (I2C Slave) uses this line to inform the host controller (I2C Master) that there is data available to be transferred. The host controller uses the TS line to indicate that data is being transferred and prevents MGC3X30 from updating its data buffer.
MGC3X30 can update the I2C buffer only when TS is released by both chips, and a data transfer can only be started when MGC3X30 pulls TS low.
This procedure secures that:
• the host is always informed when new sensor data is available
• buffer updates in MGC3X30 are always completed before data is sent to the I2C bus
Table 2-1 shows how the TS line is used in the different states of communication.This is required:
|MGC3X30||Host Controller||TS Line||Status|
|Released (H)||Released (H)||High||Host finished reading data (Transfer end). No more data to be transferred to the host. MGC3X30 is allowed to update the data buffer.|
|Asserted (L)||Released (H)||Low||Data from MGC3X30 is available to be sent, but the host has not yet started reading. If the host is busy and did not start reading before the next data update (5 ms), the MGC3X30 will assert the TS line high while updating the data buffer.c|
|Asserted (L)||Asserted (L)||Low||Data from MGC3X30 is available to be sent, but the host has not yet started reading. If the host is busy and did not start reading before the next data update (5 ms), the MGC3X30 will assert the TS line high while updating the data buffer.|
|Released (H)||Asserted (L)||Low||MGC3X30 is ready to update the data buffer, but the host is still reading the previous data. MGC3X30 is allowed to update the data only when the host releases the TS high.|