![Silicon Laboratories RF-to-USB-RD2 Скачать руководство пользователя страница 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.
Содержание RF-to-USB-RD2
Страница 16: ...RF to USB RD2 16 Rev 0 2 6 PCB Schematics and Layouts Figure 22 Node Schematic ...
Страница 17: ...RF to USB RD2 Rev 0 2 17 Figure 23 Dongle Schematic ...
Страница 19: ...RF to USB RD2 Rev 0 2 19 Figure 27 Node PCB Layout L4 Bottom ...
Страница 20: ...RF to USB RD2 20 Rev 0 2 Figure 28 Dongle PCB Layout L1 Top Figure 29 Dongle PCB Layout L2 ...
Страница 21: ...RF to USB RD2 Rev 0 2 21 Figure 30 Dongle PCB Layout L3 Figure 31 Dongle PCB Layout L4 Bottom ...
Страница 24: ...RF to USB RD2 24 Rev 0 2 DOCUMENT CHANGE LIST Revision 0 1 to Revision 0 2 Content completely revised ...
Страница 25: ...RF to USB RD2 Rev 0 2 25 NOTES ...