FM6124 Ramtron Corporation, FM6124 Datasheet - Page 41

no-image

FM6124

Manufacturer Part Number
FM6124
Description
Event Data Recorder With F-ram
Manufacturer
Ramtron Corporation
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
FM6124
Manufacturer:
FM/富满电子
Quantity:
20 000
Part Number:
FM6124-QG
Manufacturer:
ABOV
Quantity:
3 000
////////////////////////////////////////////////////////////////////////////////
// Function:
// Description:
//
//
//
// Parameters:
// Return value:
//
// Remarks:
////////////////////////////////////////////////////////////////////////////////
rbool
IsI2CSlaveReady(ruint8 a_uiSlaveId)
{
}
////////////////////////////////////////////////////////////////////////////////
// Function:
// Description:
// Parameters:
// Return value:
// Remarks:
//
//
////////////////////////////////////////////////////////////////////////////////
ruint8
FM6124ReadReg(ruint8 a_uiRegAddr)
{
Rev. 4.0 (EOL)
July 2010
// Send Write command to Slave Module
I2CRXTX = a_uiSlaveId | g_uiI2CDevSelect | IC2_WRITE;
// Wait for TX Buffer to be empty
while(!(I2CSTATUS & 0x01));
// Wait for I2C to be Idle
// This will generate a STOP and cancel the Write operation
while(!(I2CSTATUS & 0x08));
if (I2CSTATUS & 0x40)
{
}
return RTRUE;
ruint8
// Make sure I2C is Idle
while(!(I2CSTATUS & 0x08));
// Wait for TX Buffer to be empty
while((I2CSTATUS & 0x01) == 0);
// Dummy Read to clear the I2CRXAVF
l_uiValue = I2CRXTX;
// "Fake" write operation to send the register address we want to read
I2CRXTX = I2C_ID_EDR | g_uiI2CDevSelect | IC2_WRITE;
// Wait for TX Buffer to be empty
while((I2CSTATUS & 0x01) == 0);
// Make sure we received an ACK.
if (I2CSTATUS & 0xC0)
{
}
// Send Read Address
I2CRXTX = a_uiRegAddr;
// Wait for I2C to be Idle and generate a STOP
while(!(I2CSTATUS & 0x08));
// Make sure we received an ACK.
if (I2CSTATUS & 0xC0)
{
}
// No ACK received, Slave Module is not ready
return RFALSE;
return 0xFF;
return 0xFF;
l_uiValue
IsI2CSlaveReady
Check if an I2C Slave module is ready by issuing a write
operation. We abort the write operation after the I2C Id
is transmitted. If the I2C Id is Acknowledged, it means
that the I2C slave module is ready.
ruint8 a_uiSlaveId:
rbool:
None
FM6124ReadReg
Read a Register of the FM6124
ruint8 a_uiRegAddr
ruint8: Value of the register read
To Read a register on the I2C, we first need to "fake"
a write operation in order to send the register address to the
slave module.
= 0x00;
RFALSE = Slave is not ready
RTRUE
= Slave is ready
Id of the Slave Module to check
Page 41 of 53

Related parts for FM6124