
MOTOROLA
Appendix E. MPC8240 Drivers
E-21
NOTE
The function does not actually perform the data buffer receive,
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 receive 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_Timer_Event( unsigned int eumbbar, I2CStatus (*handler)( unsigned
int ) );
eumbbar is the address of the Embedded Utilities Memory Block
handler is a pointer to the function to call to handle any existing status event,
Returns: I2CNOEVENT if there is no completed event, the I2CSR MIF bit is not set
results from call to the handler function if there was a pending event completed
Description:
In polling mode, I2C_Timer_Event can be called to check the I2C status and call the given
(or the default: I2C_ISR) handler function if the I2CSR MIF bit is set.
I2CStatus I2C_Start( unsigned int eumbbar,
unsigned char slave_addr,
I2C_MODE mode,
unsigned int is_cnt );
eumbbar is the address of the Embedded Utilities Memory Block
slave_addr is the I2C address of the receiver
mode: XMIT(1) - put (write)
RCV(0) - get (read)
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:
Generate a START signal in the desired mode. Caller is the master. The slave_addr is
written to bits 7:1 of the I2CDR and bit 0 of the I2CDR is set to 0 for mode = XMIT or 1
for mode = RCV. A DLI-global variable MasterRcvAddress is set if mode = RCV (used by
I2C_ISR function).
I2CStatus I2C_Stop( unsigned int eumbbar );
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.