Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Turtle_RadioShuttle
RadioStatus.h
00001 /* 00002 * The file is licensed under the Apache License, Version 2.0 00003 * (c) 2019 Helmut Tschemernjak 00004 * 30826 Garbsen (Hannover) Germany 00005 */ 00006 00007 #if defined(ARDUINO_Heltec_WIFI_LoRa_32) || defined(ARDUINO_WIFI_LORA_32) \ 00008 || defined(ARDUINO_WIFI_LORA_32_V2) || defined(ARDUINO_WIRELESS_STICK) \ 00009 || defined(ARDUINO_ESP32_DEV) // the Heltec and ECO boards 00010 #define HAS_OLED_DISPLAY 00011 #include <Wire.h> 00012 #include "SSD1306.h" 00013 #endif 00014 00015 #ifdef ARDUINO_ESP32_DEV 00016 #undef HAS_OLED_DISPLAY // remove this line to enable the board 00017 #endif 00018 00019 #ifdef FEATURE_SSD1306 00020 #include "SSD1306I2C.h" 00021 #define HAS_OLED_DISPLAY 00022 #define SSD1306 SSD1306I2C 00023 #endif 00024 00025 #ifndef UNUSED 00026 #define UNUSED(x) (void)(x) 00027 #endif 00028 00029 00030 class MyRadioStatus : public RadioStatusInterface { 00031 public: 00032 MyRadioStatus(); 00033 virtual ~MyRadioStatus(); 00034 00035 virtual void TXStart(int AppID, int toStation, int length, int dBm); 00036 virtual void TXComplete(void); 00037 virtual void RxDone(int size, int rssi, int snr); 00038 virtual void RxCompleted(void); 00039 virtual void MessageTimeout(int AppID, int toStation); 00040 00041 void UpdateDisplay(bool invert); 00042 private: 00043 DigitalOut *ledTX; 00044 DigitalOut *ledRX; 00045 DigitalOut *ledTimeout; 00046 int _totalTX; 00047 int _totalRX; 00048 int _totalError; 00049 int _totalTimeout; 00050 bool inverted; 00051 00052 #ifdef HAS_OLED_DISPLAY 00053 SSD1306 *display; 00054 DigitalOut *displayReset; 00055 char _line1[64]; 00056 char _line2[64]; 00057 char _line3[64]; 00058 char _line4[64]; 00059 char _line5[64]; 00060 bool invertedDisplay; 00061 #endif 00062 }; 00063
Generated on Mon Jul 18 2022 05:09:52 by
1.7.2