E-24
DINK32 PowerPC ISA Debugger User’s Manual
For More Information On This Product,
Go to: www.freescale.com
MOTOROLA
MPC8240 I2C Driver Library
Description:
Read the I2CCR and I2CSR to determine why the I2CSR.MIF bit was set which caused this
function to be called. Handle condition, see above in possible return values. This function
is called in polling mode as the handler function when an I2C event has occurred. It is
intended to be a model for an interrupt service routine for polling mode, but this is untested
and the design has not been reviewed or confirmed. This function may only be called when
the following condition is met: I2CSR.MIF = 1
NOTE
This function is tested only for the master-transmit and
master-receive in polling mode. I don’t think it is tested even in
those modes for situations when the slave does not
acknowledge or bus arbitration is lost or buffers overflow, etc.
E.2.5.1
DLI Functions Written but Not Used and Not Tested
I2CStatus I2C_write( unsigned int eumbbar,
unsigned char *buffer_ptr,
unsigned int length,
unsigned int stop_flag );
eumbbar is the address of the Embedded Utilities Memory Block
buffer_ptr is pointer to the data buffer to transmit
length is the number of bytes in the buffer
stop_flag: 1 - signal STOP when buffer is empty
0 - don't signal STOP when buffer is empty
Returns: Any defined status indicator
Description:
Send a buffer of data to the requiring master. If stop_flag is set, after the whole buffer is
sent, generate a STOP signal provided that the requiring receiver doesn't signal the STOP
in the middle. Caller is the slave performing transmitting.
I2CStatus I2C_read( unsigned int eumbbar,
unsigned char *buffer_ptr,
unsigned int length,
unsigned int stop_flag );
eumbbar is the address of the Embedded Utilities Memory Block
buffer_ptr is pointer to the data buffer to transmit
length is the number of bytes in the buffer
stop_flag: 1 - signal STOP when buffer is empty
F
n
.