Hugo Pristauz / Mbed 2 deprecated S13_TOF_GAP

Dependencies:   BLE_API X_NUCLEO_6180XA1 mbed

Fork of BLE_HeartRate_IDB0XA1 by ST

Committer:
hux
Date:
Mon Aug 20 16:41:36 2018 +0000
Revision:
28:86a594313434
GAP based TOF Sensor

Who changed what in which revision?

UserRevisionLine numberNew contents of line
hux 28:86a594313434 1 // blink.h - blinking sequences for LED1
hux 28:86a594313434 2 #ifndef _BLINK_H_
hux 28:86a594313434 3 #define _BLINK_H_
hux 28:86a594313434 4
hux 28:86a594313434 5 #include <mbed.h>
hux 28:86a594313434 6 #include "bricks/o.h"
hux 28:86a594313434 7
hux 28:86a594313434 8 # define BLINK_SEQUENCE_IDLE "x "
hux 28:86a594313434 9 # define BLINK_SEQUENCE_ADVERTISE "x xxx "
hux 28:86a594313434 10 # define BLINK_SEQUENCE_CONNECTED " xxx "
hux 28:86a594313434 11 # define BLINK_SEQUENCE_ACTION "x x x x x "
hux 28:86a594313434 12 # define BLINK_SEQUENCE_ERROR "x x x x xxx "
hux 28:86a594313434 13 # define BLINK_SEQUENCE_TRANSITION "x x x "
hux 28:86a594313434 14
hux 28:86a594313434 15 void morse(O&o,const char *pattern, double periode = 0.2);
hux 28:86a594313434 16 void blink(O&o,const char *pattern, const char* next, double interval = 0.2);
hux 28:86a594313434 17 void blink(O&o,const char *pattern, double periode = 0.2);
hux 28:86a594313434 18
hux 28:86a594313434 19 inline void blinkIdle(O&o, const char *action = BLINK_SEQUENCE_IDLE)
hux 28:86a594313434 20 {
hux 28:86a594313434 21 blink(o,action,BLINK_SEQUENCE_IDLE);
hux 28:86a594313434 22 }
hux 28:86a594313434 23
hux 28:86a594313434 24 inline void blinkAdvertise(O&o,const char *action = BLINK_SEQUENCE_ADVERTISE)
hux 28:86a594313434 25 {
hux 28:86a594313434 26 blink(o,action,BLINK_SEQUENCE_ADVERTISE);
hux 28:86a594313434 27 }
hux 28:86a594313434 28
hux 28:86a594313434 29 inline void blinkConnected(O&o, const char *action = BLINK_SEQUENCE_ACTION)
hux 28:86a594313434 30 {
hux 28:86a594313434 31 blink(o,action, BLINK_SEQUENCE_CONNECTED);
hux 28:86a594313434 32 }
hux 28:86a594313434 33
hux 28:86a594313434 34 inline void blinkAction(O&o) // 'action' blink sequence
hux 28:86a594313434 35 {
hux 28:86a594313434 36 blink(o,BLINK_SEQUENCE_ACTION, BLINK_SEQUENCE_IDLE);
hux 28:86a594313434 37 }
hux 28:86a594313434 38
hux 28:86a594313434 39 inline void blinkError(O&o, const char *action = BLINK_SEQUENCE_ERROR)
hux 28:86a594313434 40 {
hux 28:86a594313434 41 blink(o,action,BLINK_SEQUENCE_ERROR);
hux 28:86a594313434 42 }
hux 28:86a594313434 43
hux 28:86a594313434 44 inline void blink(O&o) // stop blinking
hux 28:86a594313434 45 {
hux 28:86a594313434 46 blink(o,""); // empty blinking pattern
hux 28:86a594313434 47 }
hux 28:86a594313434 48
hux 28:86a594313434 49 #endif // _BLINK_H_