Download Promira Platform User Manual v1.00

Transcript
Promira Platform User Manual
ctrlId
index of the subsystem
timeout_ms
the requested bus lock timeout in ms.
Return Value
This function returns the actual timeout set.
Specific Error Codes
None.
Details
The power-on default timeout is 200ms. The minimum timeout value is 10ms and
the maximum is 450ms. If a timeout value outside this range is passed to the API
function, the timeout will be restricted. The exact timeout that is set can vary based
on the resolution of the timer within the Promira application. The nominal timeout
that was set is returned back by the API function.
If timeout_ms is 0, the function will return the bus lock timeout presently set on the
Promira application and the bus lock timeout will be left unmodified.
If the bus is locked during the middle of any I2C transaction (master transmit, master
receive, slave transmit, slave receive) the appropriate extended API function will
return the status code PS_I2C_STATUS_BUS_LOCKED as described in the
preceding Notes section. The bus lock timeout is measured between events on the I
2
C bus, where an event is a start condition, the completion of 9bits of data transfer,
a repeated start condition, or a stop condition. For example, if a full 9 bits are not
completed within the bus lock timeout (due to clock stretching or some other error),
the bus lock error will be triggered.
Please note that once the Promira application detects a bus lock timeout, it will abort
its I2C interface, even if the timeout condition is seen in the middle of a byte. When
the Promira application is acting as an I2C mater device, this may result in only a
partial byte being executed on the bus.
5.6.3 I2C Master
Set Bitrate (ps_i2c_bitrate)
int ps_i2c_bitrate (PromiraChannelHandle channel,
u08
ctrlId,
int
bitrate_khz);
Set the I2C bitrate in kilohertz.
53