FM6124 Ramtron Corporation, FM6124 Datasheet - Page 47

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
FM6124StreamEventsAtRP(ruint8* a_puiEvents, ruint8 a_uiNbEvents)
{
Rev. 4.0 (EOL)
July 2010
ruint8
ruint8
rbool
ruint8* l_puiVufPrt
// Send STEAM command to the FM6124
FM6124WriteReg(EDR_REG_BUFFER_CTRL, EDR_BC_CMD_STREAM);
// Make sure I2C is Idle
while(!(I2CSTATUS & 0x08));
// Wait for TX Buffer to be empty
while((I2CSTATUS & 0x01) == 0);
// Dummy Read, to clear the I2CRxAv flag.
*a_puiEvents = 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 and that there was no error during transfer
if (I2CSTATUS & 0xC0)
{
}
I2CRXTX = EDR_REG_EVT_CODE;
while(!(I2CSTATUS & 0x08)); // Wait for I2C to be Idle: STOP
// Make sure we received an ACK and that there was no error during transfer
if (I2CSTATUS & 0xC0)
{
}
// Start the Event Streaming by sending the read command.
// Make sure we will ACK the Data we will receive
I2CCONFIG &= 0xFD;
// Dummy Read to clear the I2CRXAVF
*a_puiEvents = I2CRXTX;
// Now, send the Read command
I2CRXTX = I2C_ID_EDR | g_uiI2CDevSelect | IC2_READ;
l_uiCurEvent
l_bEventFF
while ((l_bEventFF == RFALSE) &&
{
return RFALSE;
return RFALSE;
l_bEventFF = RTRUE;
// Receive 8 bytes per Event
for (l_uiCurData = 0; l_uiCurData < 8; l_uiCurData++)
{
}
l_uiCurEvent++;
// Send Read Address
(l_uiCurEvent < a_uiNbEvents))
l_uiCurEvent
l_uiCurData
l_bEventFF
// Wait for Data to comeback
while(!(I2CSTATUS & 0x02));
*l_puiVufPrt = I2CRXTX;
if (*l_puiVufPrt != 0xFF)
{
}
l_puiVufPrt++;
l_bEventFF = RFALSE;
FM6124StreamEventsAtRP
Read x events by Streaming, starting at RP
rbool: RTRUE = Read Ok.
User is responsible of:
1- Making sure a_puiEvents has enough space to contain
2- There is at least a_uiNbEvents in the Event Buffer of the
= 0;
= RFALSE;
a_uiNbEvents events.
FM6124.
= 0x00;
= 0x00;
= RFALSE;
= a_puiEvents;
Page 47 of 53

Related parts for FM6124