MOTOROLA
Appendix E. MPC8240 Drivers
E-41
eumbbar is the address of the Embedded Utilities Memory Block
rcv_addr is the receiver's I2C device address
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
is_cnt: 1 - this is a restart, don't check MBB
0 - this is a not restart, check MBB
Returns: Any defined status indicator
Description:
Set up to send a buffer of data to the intended rcv_addr. If stop_flag is set, after the whole
buffer is sent, generate a STOP signal provided that the receiver doesn't signal the STOP in
the middle. Caller is the master performing transmitting. If no STOP signal is generated at
the end of current transaction, the master can generate a START signal to another slave
address.
NOTE
The function does not actually perform the data buffer transmit,
it just sets up the DLI global variables to control the transaction
and calls I2C_Start to send the slave address out on the I2C bus
in transmit mode. The application must check the return status
to find out if the bus was obtained, then enter a loop of calling
I2C_Timer_Event to poll the I2C handler to actually perform
the transaction one byte at a time, while checking the return
status to determine if there were any errors and if the
transaction has completed.
I2CStatus I2C_get( unsigned int eumbbar,
unsigned char sender_addr,
unsigned char *buffer_ptr,
unsigned int length,
unsigned int stop_flag,
unsigned int is_cnt );
eumbbar is the address of the Embedded Utilities Memory Block
sender_addr is the sender's I2C device address
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
is_cnt: 1 - this is a restart, don't check MBB
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.