FLI R
ADK
Ge tt in g S ta rt ed
The information contained herein does not contain technology as
defined by EAR,15 CFR772, is publicly available, and therefore
not subject to EAR.
12
byte
checkRXbuffer
()
{
// byte addy = 0x6C;
byte
reg
=
0x12
;
return
i2cread
(
transAdd
,
reg
);
delay
(
50
);
}
byte
checkTXbuffer
()
{
// byte addy = 0x6C;
byte
reg
=
0x11
;
return
i2cread
(
transAdd
,
reg
);
}
Send I2C Command Array:
byte
transAdd
=
0x6C
;
// 0x6C
–
7bit address. 0xD8 - I2C to UART Chip 8-bit
address
void
sendI2CCommandArray
(
byte
commandBytes
[],
int
len
)
{
i2cwrite
(
transAdd
,
0x09
,
0x02
);
// disable the transmitter on transceiver
for
(
int
i
=
0
;
i
<
len
;
i
++){
i2cwrite
(
transAdd
,
0x00
,
commandBytes
[
i
]);
// write byte to fifo buffer
register on transceiver
}
if
(
debug_messages
)
{
DEBUG
.
(
"Message queued: 0x"
);
DEBUG
.
(
checkTXbuffer
(),
HEX
);
DEBUG
.
(
"\n"
);
DEBUG
.
(
"\nCommand Sent\n\n"
);
}
i2cwrite
(
transAdd
,
0x09
,
0x00
);
// enable the transmitter on transceiver.
This flushed the fifo buffer to the boson.
}
It’s also necessary to write I2C co
mmands to the Serializer and Deserializer that are 16-bit
addressed. These are also shown here.
void
i2cwrite16
(
byte
addy
,
byte
regH
,
byte
regL
,
byte
val
)
{
byte
err
;