![](/media/cache/profiles/ce7206100d5cf8e7bb691376c7d73526.jpg.50x50_q85.jpg)
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@22:9cca40fcb25e, 2019-02-06 (annotated)
- Committer:
- Helmut Tschemernjak
- Date:
- Wed Feb 06 15:52:20 2019 +0100
- Revision:
- 22:9cca40fcb25e
- Parent:
- 18:d2f227e0a8bf
- Child:
- 37:77fa81e4ad79
Added a ConsoleReadline timeout feature
Added a little cmd line option for main
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Helmut64 | 0:3b6c2ce051a6 | 1 | /* |
Helmut Tschemernjak | 3:b5052f3fa638 | 2 | * Copyright (c) 2019 Helmut Tschemernjak |
Helmut64 | 0:3b6c2ce051a6 | 3 | * 30826 Garbsen (Hannover) Germany |
Helmut Tschemernjak | 3:b5052f3fa638 | 4 | * Licensed under the Apache License, Version 2.0); |
Helmut Tschemernjak | 3:b5052f3fa638 | 5 | */ |
Helmut64 | 0:3b6c2ce051a6 | 6 | |
Helmut64 | 0:3b6c2ce051a6 | 7 | #include "mbed.h" |
Helmut64 | 0:3b6c2ce051a6 | 8 | #include "PinMap.h" |
Helmut64 | 0:3b6c2ce051a6 | 9 | #include "BufferedSerial.h" |
Helmut64 | 0:3b6c2ce051a6 | 10 | #ifdef FEATURE_USBSERIAL |
Helmut64 | 0:3b6c2ce051a6 | 11 | #include "USBSerialBuffered.h" |
Helmut64 | 0:3b6c2ce051a6 | 12 | #endif |
Helmut Tschemernjak | 3:b5052f3fa638 | 13 | #include "arch.h" |
Helmut Tschemernjak | 3:b5052f3fa638 | 14 | #include "mbed-util.h" |
Helmut Tschemernjak | 3:b5052f3fa638 | 15 | |
Helmut64 | 0:3b6c2ce051a6 | 16 | |
Helmut Tschemernjak | 3:b5052f3fa638 | 17 | enum InterrruptDevice { |
Helmut Tschemernjak | 3:b5052f3fa638 | 18 | INT_BUTTON1 = 0x01, // user button |
Helmut Tschemernjak | 3:b5052f3fa638 | 19 | INT_UNUSED1 = 0x02, |
Helmut Tschemernjak | 3:b5052f3fa638 | 20 | INT_UNUSED2 = 0x04, |
Helmut Tschemernjak | 3:b5052f3fa638 | 21 | INT_LORA = 0x08, // LoRa needs to stay on 0x08 |
Helmut Tschemernjak | 3:b5052f3fa638 | 22 | INT_TIMEOUT = 0x10, // Low power timer timeout |
Helmut Tschemernjak | 3:b5052f3fa638 | 23 | }; |
Helmut Tschemernjak | 3:b5052f3fa638 | 24 | |
Helmut Tschemernjak | 3:b5052f3fa638 | 25 | extern volatile uint32_t PendingInterrupts; |
Helmut Tschemernjak | 3:b5052f3fa638 | 26 | extern void InterrruptMSG(enum InterrruptDevice irqid); |
Helmut Tschemernjak | 3:b5052f3fa638 | 27 | extern uint32_t readclrPendingInterrupts(void); |
Helmut Tschemernjak | 3:b5052f3fa638 | 28 | extern uint32_t readPendingInterrupts(void); |
Helmut64 | 0:3b6c2ce051a6 | 29 | |
Helmut64 | 0:3b6c2ce051a6 | 30 | extern BufferedSerial *ser; |
Helmut64 | 0:3b6c2ce051a6 | 31 | #ifdef FEATURE_USBSERIAL |
Helmut64 | 0:3b6c2ce051a6 | 32 | extern USBSerialBuffered *usb; |
Helmut64 | 0:3b6c2ce051a6 | 33 | #endif |
Helmut64 | 0:3b6c2ce051a6 | 34 | extern bool _useDprintf; |
Helmut64 | 0:3b6c2ce051a6 | 35 | extern void InitSerial(int timeout, DigitalOut *led); |
Helmut64 | 0:3b6c2ce051a6 | 36 | extern void dump(const char *title, const void *data, int len, bool dwords = false); |
Helmut Tschemernjak | 3:b5052f3fa638 | 37 | extern const char *BatterySource(void); |
Helmut64 | 0:3b6c2ce051a6 | 38 | |
Helmut64 | 0:3b6c2ce051a6 | 39 | extern void dprintf(const char *format, ...) __attribute__((format(printf,1,2))); |
Helmut64 | 0:3b6c2ce051a6 | 40 | extern void rprintf(const char *format, ...) __attribute__((format(printf,1,2))); |
Helmut Tschemernjak | 3:b5052f3fa638 | 41 | extern void VAprintf(bool timstamp, bool newline, bool printEnabled, const char *format, va_list arg); |
Helmut Tschemernjak | 22:9cca40fcb25e | 42 | extern char *ConsoleReadline(char *buf, int buflen, bool echo, int timeout_ms = 0); |
Helmut Tschemernjak | 18:d2f227e0a8bf | 43 | extern void NVPropertyEditor(void); |
Helmut Tschemernjak | 22:9cca40fcb25e | 44 | extern void MCUReset(void); |
Helmut Tschemernjak | 18:d2f227e0a8bf | 45 |