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.
Dependencies: ADXL345_I2C Chainable_RGB_LED EEAB-P1 MMA8652FC Sht31 TinyGPS mbed
Fork of ina-hack-test by
Diff: EEAB-P1/Eeabp1.h
- Revision:
- 0:97a57be77fbb
- Child:
- 1:195da8230785
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/EEAB-P1/Eeabp1.h Sat Jun 24 03:45:00 2017 +0000
@@ -0,0 +1,46 @@
+#if !defined(EEAPP1_H)
+#define EEAPP1_H
+#include "mbed.h"
+#include "types.h"
+
+enum EeabLedState {
+ LED_OFF,
+ LED_ON,
+ LED_BLINK_FAST,
+ LED_BLINK_MID,
+ LED_BLINK_SLOW,
+};
+
+class Eeabp1
+{
+public:
+ Eeabp1();
+ int setLedState(EeabLedState state);
+ void loop(void);
+ int debug(const char * format, ...);
+ int setLoRaPower(bool on);
+ int sendLoRaString(const char * format, ...);
+ void setGrovePower(bool on);
+
+private:
+ DigitalOut pwr_en;
+ /* state LED */
+ DigitalOut led;
+ EeabLedState led_state;
+ /* LoRa */
+ RawSerial *serial;
+ DigitalOut lora_power;
+ DigitalOut lora_reset;
+ bool lora_enabled;
+ /* Grove */
+ DigitalOut grove_power;
+ bool grove_enabled;
+
+ void flushSerial();
+ int chkSerialChar(const char,uint16_t);
+ int waitSerialChar(const char,uint16_t);
+ int chkSerialCharOk();
+ int chkSerialCharRes(char);
+};
+
+#endif /* !defined(EEAPP1_H) */
\ No newline at end of file
