mdot UDK & STMicro MEMS Shield Sensor packet example

Dependencies:   libmDot-mbed5 DOGS102 ISL29011 MMA845x MPL3115A2 NCP5623B X_NUCLEO_IKS01A1 Senet_Packet

Fork of MTDOT-UDKDemo_Senet by canuck lehead

board/board.h

Committer:
Shaun Nelson
Date:
2017-08-24
Branch:
develop
Revision:
27:1753a44fa9ec
Child:
28:4fd8a894a403

File content as of revision 27:1753a44fa9ec:

/***
 *       _____                         _   
 *      / ____|                       | |  
 *     | (___     ___   _ __     ___  | |_ 
 *      \___ \   / _ \ | '_ \   / _ \ | __|
 *      ____) | |  __/ | | | | |  __/ | |_ 
 *     |_____/   \___| |_| |_|  \___|  \__|
 *         (C) Senet, Inc                                
 *                                         
 */
#ifndef BOARD_BOARD_H_
#define BOARD_BOARD_H_

#include "mbed.h"
#include "mdot.h"

extern Serial     debugUART;
extern mDot      *mDotPtr;
extern DigitalOut appLED;

enum EBoardState
{
	Board_init,
	Board_start,
	Board_stop,
};

struct BoardOrientation
{
	bool horizontal;
	bool up;
	bool down;
	bool right;
	bool left;

	void init()
	{
		horizontal = false;
		up         = false;
		down       = false;
		right      = false;
		left       = false;
	}

	BoardOrientation() { init(); }
};

/*
 * Board sensor data
 */
struct BoardSensorData
{
    float temperature;
    float pressure;
    int32_t accel_x;
    int32_t accel_y;
    int32_t accel_z;
    BoardOrientation orientation;

    inline void init()
    {
        temperature= 0;
        pressure = 0;
        accel_x = 0;
        accel_y = 0;
        accel_z = 0;
        orientation.init();
    }

    BoardSensorData() { init(); }
};


extern void BoardSetState( EBoardState state );
extern bool BoardCheckForExit( bool exit );
extern void BoardReadSensors( BoardSensorData &sensorData);


#endif /* BOARD_BOARD_H_ */