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

Committer:
Helmut Tschemernjak
Date:
2019-03-04
Revision:
49:6c7d42d48672
Parent:
47:59a9923a9f77
Child:
50:28166f6fdaa2

File content as of revision 49:6c7d42d48672:

/*
 * Copyright (c) 2019 Helmut Tschemernjak
 * 30826 Garbsen (Hannover) Germany
 * Licensed under the Apache License, Version 2.0);
 */

#include "mbed.h"
#include "PinMap.h"
#include "BufferedSerial.h"
#ifdef FEATURE_USBSERIAL
#include "USBSerialBuffered.h"
#endif
#include "arch.h"
#include "mbed-util.h"


enum InterruptDevice {
    INT_BUTTON1 = 0x01,	// user button
    INT_UNUSED1 = 0x02,
    INT_UNUSED2 = 0x04,
    INT_LORA    = 0x08,	// LoRa needs to stay on 0x08
	INT_TIMEOUT	= 0x10, // Low power timer timeout
};

extern volatile uint32_t PendingInterrupts;
extern void InterruptMSG(enum InterruptDevice irqid);
extern uint32_t readclrPendingInterrupts(void);
extern uint32_t readPendingInterrupts(void);

extern BufferedSerial *ser;
#ifdef FEATURE_USBSERIAL
extern USBSerialBuffered *usb;
#endif
extern bool _useDprintf;
extern void InitSerial(int timeout, DigitalOut *led, InterruptIn *intr);
extern void RunStartup(void);
extern size_t MemoryAvailable(bool print);

extern void dump(const char *title, const void *data, int len, bool dwords = false);
extern const char *BatterySource(void);

extern void dprintf(const char *format, ...) __attribute__((format(printf,1,2)));
extern void rprintf(const char *format, ...) __attribute__((format(printf,1,2)));
extern void VAprintf(bool timstamp, bool newline, bool printEnabled, const char *format, va_list arg);
extern char *ConsoleReadline(char *buf, int buflen, bool echo, int timeout_ms = 0);
extern void NVPropertyEditor(void);
extern void MCUReset(void);
extern void RunCommands(int timeout_ms);