This is modified program from original CC1101_Transceiver. CC1101 Test succeeded STM32-F407 platform. Feature are improved little bit.
Dependencies: mbed
TI CC1101 chip is embedded along with STM32-F407 MCU.
Diff: main.cpp
- Revision:
- 2:54c832c68208
- Parent:
- 1:e96096a7b90b
--- a/main.cpp Tue Mar 31 07:48:52 2015 +0000 +++ b/main.cpp Tue Mar 31 08:48:00 2015 +0000 @@ -3,9 +3,9 @@ * Test result: TX, RX work well with 433MHz on STM32-F407 platform. * Two features are improved from the original source code. * - Synchronous implementation of CC1101::SendPacket() - * For subsequent packet transmission, now this function returns after packet transmission. + * For subsequent packet transmission, now this function returns after packet transmission. * - FIFO checking routine changed. - * Original code uses timer to check FIFO, it may cause resource corruption by timer interrupt. + * Original code uses timer to check FIFO, it may cause resource corruption by timer interrupt. */ #include "mbed.h" #include "CC1101.h" @@ -32,16 +32,22 @@ const PinName gdo0 = PE_0; // pin for checking that sent a packet -// It related with CC1101 IOCFG01register. -const PinName gdo1 = PE_1; +// It related with CC1101 IOCFG02register. +const PinName gdo2 = PE_1; + +CC1101 cc1101(mosi, miso, clk, csn, RDmiso, gdo0, gdo2); -CC1101 cc1101(mosi, miso, clk, csn, RDmiso, gdo0, gdo1); - +#if 1 +Serial pc(PD_8, PD_9); // tx, rx +DigitalOut led1(PD_12); // FIFO led +DigitalOut led2(PD_13); // RX led +DigitalOut led3(PD_14); // TX led +#else Serial pc(USBTX, USBRX); DigitalOut led1(LED1); // FIFO led DigitalOut led2(LED2); // RX led DigitalOut led3(LED3); // TX led - +#endif RingBuffer pcRX(512); // ring buffer for the pc RX data RingBuffer pcTX(512); // ring buffer for the pc TX data Timeout pcRXtimeout;