An example project for the Heltec Turtle LoRa board (STM32L4 and SX1276 chips). The projects is only supported for the Nucleo-L432KC board platform in the mbed online and offline compiler environment. Visit www.radioshuttle.de (choose Turtle board) for instructions. Note that most source files and libraries are open source, however some files especially the RadioShuttle core protocol is copyrighted work. Check header for details.
Dependencies: mbed BufferedSerial SX1276GenericLib OLED_SSD1306 HELIOS_Si7021 NVProperty RadioShuttle-STM32L4 USBDeviceHT
main.h
00001 /* 00002 * Copyright (c) 2019 Helmut Tschemernjak 00003 * 30826 Garbsen (Hannover) Germany 00004 * Licensed under the Apache License, Version 2.0); 00005 */ 00006 00007 #include "mbed.h" 00008 #include "PinMap.h" 00009 #include "BufferedSerial.h" 00010 #ifdef FEATURE_USBSERIAL 00011 #include "USBSerialBuffered.h" 00012 #endif 00013 #include "arch.h" 00014 #include "mbed-util.h" 00015 #ifdef FEATURE_SI7021 00016 #include "HELIOS_Si7021.h" 00017 #endif 00018 00019 00020 enum InterruptDevice { 00021 INT_BUTTON1 = 0x01, // user button 00022 INT_UNUSED1 = 0x02, 00023 INT_UNUSED2 = 0x04, 00024 INT_LORA = 0x08, // LoRa needs to stay on 0x08 00025 INT_TIMEOUT = 0x10, // Low power timer timeout 00026 }; 00027 00028 extern volatile uint32_t PendingInterrupts; 00029 extern void InterruptMSG(enum InterruptDevice irqid); 00030 extern uint32_t readclrPendingInterrupts(void); 00031 extern uint32_t readPendingInterrupts(void); 00032 00033 extern BufferedSerial *ser; 00034 #ifdef FEATURE_USBSERIAL 00035 extern USBSerialBuffered *usb; 00036 #endif 00037 extern bool _useDprintf; 00038 extern void InitSerial(int timeout, DigitalOut *led, InterruptIn *intr); 00039 extern void RunStartup(void); 00040 extern size_t MemoryAvailable(bool print); 00041 00042 extern void dump(const char *title, const void *data, int len, bool dwords = false); 00043 extern const char *BatterySource(void); 00044 00045 extern void dprintf(const char *format, ...) __attribute__((format(printf,1,2))); 00046 extern void rprintf(const char *format, ...) __attribute__((format(printf,1,2))); 00047 extern void VAprintf(bool timstamp, bool newline, bool printEnabled, const char *format, va_list arg); 00048 extern char *ConsoleReadline(char *buf, int buflen, bool echo, int timeout_ms = 0); 00049 extern void NVPropertyEditor(void); 00050 extern void MCUReset(void); 00051 extern void RunCommands(int timeout_ms); 00052 00053 #ifdef FEATURE_SI7021 00054 extern HELIOS_Si7021 *sensorSI7021; 00055 #endif
Generated on Wed Jul 13 2022 12:02:31 by 1.7.2