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
board/board.h@27:1753a44fa9ec, 2017-08-24 (annotated)
- Committer:
- Shaun Nelson
- Date:
- Thu Aug 24 17:56:53 2017 -0400
- Branch:
- develop
- Revision:
- 27:1753a44fa9ec
- Child:
- 28:4fd8a894a403
Reimplement for mbed 5
Move bsp to board files
UDK implemented
EVB in progress
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Shaun Nelson |
27:1753a44fa9ec | 1 | /*** |
Shaun Nelson |
27:1753a44fa9ec | 2 | * _____ _ |
Shaun Nelson |
27:1753a44fa9ec | 3 | * / ____| | | |
Shaun Nelson |
27:1753a44fa9ec | 4 | * | (___ ___ _ __ ___ | |_ |
Shaun Nelson |
27:1753a44fa9ec | 5 | * \___ \ / _ \ | '_ \ / _ \ | __| |
Shaun Nelson |
27:1753a44fa9ec | 6 | * ____) | | __/ | | | | | __/ | |_ |
Shaun Nelson |
27:1753a44fa9ec | 7 | * |_____/ \___| |_| |_| \___| \__| |
Shaun Nelson |
27:1753a44fa9ec | 8 | * (C) Senet, Inc |
Shaun Nelson |
27:1753a44fa9ec | 9 | * |
Shaun Nelson |
27:1753a44fa9ec | 10 | */ |
Shaun Nelson |
27:1753a44fa9ec | 11 | #ifndef BOARD_BOARD_H_ |
Shaun Nelson |
27:1753a44fa9ec | 12 | #define BOARD_BOARD_H_ |
Shaun Nelson |
27:1753a44fa9ec | 13 | |
Shaun Nelson |
27:1753a44fa9ec | 14 | #include "mbed.h" |
Shaun Nelson |
27:1753a44fa9ec | 15 | #include "mdot.h" |
Shaun Nelson |
27:1753a44fa9ec | 16 | |
Shaun Nelson |
27:1753a44fa9ec | 17 | extern Serial debugUART; |
Shaun Nelson |
27:1753a44fa9ec | 18 | extern mDot *mDotPtr; |
Shaun Nelson |
27:1753a44fa9ec | 19 | extern DigitalOut appLED; |
Shaun Nelson |
27:1753a44fa9ec | 20 | |
Shaun Nelson |
27:1753a44fa9ec | 21 | enum EBoardState |
Shaun Nelson |
27:1753a44fa9ec | 22 | { |
Shaun Nelson |
27:1753a44fa9ec | 23 | Board_init, |
Shaun Nelson |
27:1753a44fa9ec | 24 | Board_start, |
Shaun Nelson |
27:1753a44fa9ec | 25 | Board_stop, |
Shaun Nelson |
27:1753a44fa9ec | 26 | }; |
Shaun Nelson |
27:1753a44fa9ec | 27 | |
Shaun Nelson |
27:1753a44fa9ec | 28 | struct BoardOrientation |
Shaun Nelson |
27:1753a44fa9ec | 29 | { |
Shaun Nelson |
27:1753a44fa9ec | 30 | bool horizontal; |
Shaun Nelson |
27:1753a44fa9ec | 31 | bool up; |
Shaun Nelson |
27:1753a44fa9ec | 32 | bool down; |
Shaun Nelson |
27:1753a44fa9ec | 33 | bool right; |
Shaun Nelson |
27:1753a44fa9ec | 34 | bool left; |
Shaun Nelson |
27:1753a44fa9ec | 35 | |
Shaun Nelson |
27:1753a44fa9ec | 36 | void init() |
Shaun Nelson |
27:1753a44fa9ec | 37 | { |
Shaun Nelson |
27:1753a44fa9ec | 38 | horizontal = false; |
Shaun Nelson |
27:1753a44fa9ec | 39 | up = false; |
Shaun Nelson |
27:1753a44fa9ec | 40 | down = false; |
Shaun Nelson |
27:1753a44fa9ec | 41 | right = false; |
Shaun Nelson |
27:1753a44fa9ec | 42 | left = false; |
Shaun Nelson |
27:1753a44fa9ec | 43 | } |
Shaun Nelson |
27:1753a44fa9ec | 44 | |
Shaun Nelson |
27:1753a44fa9ec | 45 | BoardOrientation() { init(); } |
Shaun Nelson |
27:1753a44fa9ec | 46 | }; |
Shaun Nelson |
27:1753a44fa9ec | 47 | |
Shaun Nelson |
27:1753a44fa9ec | 48 | /* |
Shaun Nelson |
27:1753a44fa9ec | 49 | * Board sensor data |
Shaun Nelson |
27:1753a44fa9ec | 50 | */ |
Shaun Nelson |
27:1753a44fa9ec | 51 | struct BoardSensorData |
Shaun Nelson |
27:1753a44fa9ec | 52 | { |
Shaun Nelson |
27:1753a44fa9ec | 53 | float temperature; |
Shaun Nelson |
27:1753a44fa9ec | 54 | float pressure; |
Shaun Nelson |
27:1753a44fa9ec | 55 | int32_t accel_x; |
Shaun Nelson |
27:1753a44fa9ec | 56 | int32_t accel_y; |
Shaun Nelson |
27:1753a44fa9ec | 57 | int32_t accel_z; |
Shaun Nelson |
27:1753a44fa9ec | 58 | BoardOrientation orientation; |
Shaun Nelson |
27:1753a44fa9ec | 59 | |
Shaun Nelson |
27:1753a44fa9ec | 60 | inline void init() |
Shaun Nelson |
27:1753a44fa9ec | 61 | { |
Shaun Nelson |
27:1753a44fa9ec | 62 | temperature= 0; |
Shaun Nelson |
27:1753a44fa9ec | 63 | pressure = 0; |
Shaun Nelson |
27:1753a44fa9ec | 64 | accel_x = 0; |
Shaun Nelson |
27:1753a44fa9ec | 65 | accel_y = 0; |
Shaun Nelson |
27:1753a44fa9ec | 66 | accel_z = 0; |
Shaun Nelson |
27:1753a44fa9ec | 67 | orientation.init(); |
Shaun Nelson |
27:1753a44fa9ec | 68 | } |
Shaun Nelson |
27:1753a44fa9ec | 69 | |
Shaun Nelson |
27:1753a44fa9ec | 70 | BoardSensorData() { init(); } |
Shaun Nelson |
27:1753a44fa9ec | 71 | }; |
Shaun Nelson |
27:1753a44fa9ec | 72 | |
Shaun Nelson |
27:1753a44fa9ec | 73 | |
Shaun Nelson |
27:1753a44fa9ec | 74 | extern void BoardSetState( EBoardState state ); |
Shaun Nelson |
27:1753a44fa9ec | 75 | extern bool BoardCheckForExit( bool exit ); |
Shaun Nelson |
27:1753a44fa9ec | 76 | extern void BoardReadSensors( BoardSensorData &sensorData); |
Shaun Nelson |
27:1753a44fa9ec | 77 | |
Shaun Nelson |
27:1753a44fa9ec | 78 | |
Shaun Nelson |
27:1753a44fa9ec | 79 | #endif /* BOARD_BOARD_H_ */ |