![Silicon Laboratories RF-to-USB-RD2 User Manual Download Page 13](http://html1.mh-extra.com/html/silicon-laboratories/rf-to-usb-rd2/rf-to-usb-rd2_user-manual_1271794013.webp)
R F - t o - U S B - R D 2
Rev. 0.2
13
Within the same loop, the firmware checks the RxPacketReceived flag (set by an interrupt service routine). If true,
indicating there is data waiting, the firmware lights the red and green LED according to the value received.
// receive from other node, display value with LED's
if(RxPacketReceived)
{
ppPhyGetRxPacket(&RxPacketLength, RxBuffer);
switch (RxBuffer[0])
{
case 1:
LED_GRN = ILLUMINATE;
LED_RED = EXTINGUISH;
break;
case 2:
LED_GRN = EXTINGUISH;
LED_RED = ILLUMINATE;
break;
case 3:
LED_GRN = ILLUMINATE;
LED_RED = ILLUMINATE;
break;
default:
LED_GRN = EXTINGUISH;
LED_RED = EXTINGUISH;
break;
}
}//if RX
} //while (1)
The firmware sits in this loop indefinitely and waits for a transmit request keypress or an incoming packet.
This is a very simple code example. You may extend this example to suit your application by:
Adding power management: See code examples in C:\SiLabs\MCU\Examples\Si101x\SleepMode to place the
MCU core in low-power, waking up on keypress, or a real-time clock.
Making a measurement with the ADC: See code examples under C:\SiLabs\MCU\Examples\Si101x\ADC.
Adding communications via UART or SPI: See code examples under C:\SiLabs\MCU\Examples\Si101x\UART
and C:\SiLabs\MCU\Examples\Si101x\SPI
Note that these code examples are installed as part of the Silicon Laboratories IDE installation.
Summary of Contents for RF-to-USB-RD2
Page 16: ...RF to USB RD2 16 Rev 0 2 6 PCB Schematics and Layouts Figure 22 Node Schematic ...
Page 17: ...RF to USB RD2 Rev 0 2 17 Figure 23 Dongle Schematic ...
Page 19: ...RF to USB RD2 Rev 0 2 19 Figure 27 Node PCB Layout L4 Bottom ...
Page 20: ...RF to USB RD2 20 Rev 0 2 Figure 28 Dongle PCB Layout L1 Top Figure 29 Dongle PCB Layout L2 ...
Page 21: ...RF to USB RD2 Rev 0 2 21 Figure 30 Dongle PCB Layout L3 Figure 31 Dongle PCB Layout L4 Bottom ...