MOTOROLA
Appendix E. MPC8240 Drivers
E-45
— results from call to I2C_Slave_Rcv if slave receive data mode ( untested )
— I2CSUCCESS if slave has not acknowledged, generated STOP ( untested )
— I2CSUCCESS if master has not acknowledged, wait for STOP
( untested )
— I2CSUCCESS if bus arbitration lost ( untested )
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.
The following DLI functions were 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 );
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.