Hugo Pristauz / Mbed 2 deprecated S16_Blue_ToF

Dependencies:   BLE_API X_NUCLEO_6180XA1 X_NUCLEO_IDB0XA1 mbed

Fork of BLE_HeartRate_IDB0XA1 by ST

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers xn6180.h Source File

xn6180.h

00001 // xn6180.h - X-NUCLEO 6180XA1 expansion board functionality
00002 //
00003 // Example 1:
00004 //
00005 //    DisplayShield *pShield = new DisplayShield;
00006 //    pShield->init("INIT",1000)                    // display "INIT" @ 1000 ms
00007 //
00008 #ifndef _XN6180_H_
00009 #define _XN6180_H_
00010 
00011 #include "x_nucleo_6180xa1.h"
00012 
00013 #define InterruptTOF   range_continuous_interrupt   // just an alias
00014 #define InterruptALS   als_continuous_interrupt     // just an alias
00015 #define PollTOF        range_continuous_poll        // just an alias
00016 #define PollALS        als_continuous_poll          // just an alias
00017 
00018    enum OpModeIntPoll_t { PollMeasure, IntMeasure };  // red slider position
00019 
00020    typedef OperatingMode OpMode;       // a short hand for Operating Mode
00021    
00022    class DisplayShield
00023    {
00024        public:
00025           DevI2C *pDevice;
00026           X_NUCLEO_6180XA1 *pBoard;
00027           MeasureData_t data;
00028           bool flagService;            // data read service request flag
00029        
00030        public:
00031           OperatingMode curMode;      // board's current operating mode
00032           OperatingMode prvMode;      // board's previous operating mode
00033 
00034        public:  // construction
00035           DisplayShield(const char *msg = 0, int msec = 1000);   // constructor
00036           void init(const char *msg = 0, int msec = 1000);  // initialize shield
00037           
00038        public:  // public methods
00039           void set();                  // set stop request
00040           void clear();                // clear stop request
00041           bool request();              // stop requested?
00042           void disable();              // disable interrupt
00043           void ready();                // set data ready status 
00044           int handle();                // handle IRQ
00045           int start(void (*pCb)(void));// start measurement
00046 //        int start();                 // start measurement
00047           int stop();                  // stop current measurement
00048 
00049           void display(const char * msg);
00050           void display(const char * msg, int msec);  // display & wait
00051           void refresh(OpMode mode);
00052           void refresh();              // refresh display in current mode
00053           
00054        public:
00055           bool red();                  // red switch on or off?
00056           bool slider(enum OpModeIntPoll_t OpMode);  // did slider change?
00057           bool setup(OpMode mode);     // setup the operation mode
00058 
00059           void startMessage(OpMode mode);
00060           void startMessage();
00061           void stopMessage(OpMode mode);
00062           void stopMessage();
00063    };
00064 
00065 
00066 #endif // _XN6180_H_