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-02-06
Revision:
22:9cca40fcb25e
Parent:
18:d2f227e0a8bf
Child:
37:77fa81e4ad79

File content as of revision 22:9cca40fcb25e:

/*
 * 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 InterrruptDevice {
    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 InterrruptMSG(enum InterrruptDevice 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);  
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);