Koncentrator
Dependencies: SX127x mbed-rtos mbed
main.cpp
00001 #include "mbed.h" 00002 #include "rtos.h" 00003 #include "stdlib.h" 00004 #include "sx127x_lora.h" 00005 #include "comm.h" 00006 #include "fun.h" 00007 #include "application.h" 00008 00009 // Lora TX/RX indication 00010 DigitalOut RX_LED(LED1); // LED blink on receive - LoRa 00011 DigitalOut TX_LED(LED2); // LED blink on transmit - LoRa 00012 00013 // Serial ports 00014 RawSerial pc(USBTX,USBRX); // USB serial port 00015 RawSerial fiberOptic(PTE0,PTE1); // Fiber Optic serial port 00016 00017 // Lora communication 00018 SX127x kom(PTD2, PTD3, PTD1, PTD0, PTD5, PTA13, PTC9); 00019 SX127x_lora Lora(kom); 00020 00021 // Enable/Disable fiber optic mode 00022 DigitalIn OperationMode(PTE20); 00023 00024 // Enable disable tx pin on fiber optic 00025 //DigitalOut FIBER_OPTIC_TX(PTE0); 00026 DigitalOut FIBER_OPTIC_TX_PWR(PTB9); 00027 DigitalOut FIBER_OPTIC_RX_PWR(PTB8); 00028 00029 systemStructure sys; // System structure 00030 00031 int main(void) { 00032 00033 Thread pcThread(pc_thread); 00034 Thread loraThread(lora_thread); 00035 //Thread fiberOpticThread(fiberOptic_thread); 00036 Thread loraRXThread(lora_rx_thread); 00037 00038 while(true) { 00039 if(loraBuffer.flg) { 00040 } 00041 TX_LED = ClearLed; 00042 RX_LED = ClearLed; 00043 wait_ms(1); 00044 } 00045 }
Generated on Tue Jul 12 2022 18:10:08 by 1.7.2