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

Committer:
Shaun Nelson
Date:
Wed Aug 30 12:30:05 2017 -0400
Revision:
41:208af6be1869
Parent:
39:022b327d6bf0
Added button press callback

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Shaun Nelson 28:4fd8a894a403 1 /***
Shaun Nelson 28:4fd8a894a403 2 * _____ _
Shaun Nelson 28:4fd8a894a403 3 * / ____| | |
Shaun Nelson 28:4fd8a894a403 4 * | (___ ___ _ __ ___ | |_
Shaun Nelson 28:4fd8a894a403 5 * \___ \ / _ \ | '_ \ / _ \ | __|
Shaun Nelson 28:4fd8a894a403 6 * ____) | | __/ | | | | | __/ | |_
Shaun Nelson 28:4fd8a894a403 7 * |_____/ \___| |_| |_| \___| \__|
Shaun Nelson 28:4fd8a894a403 8 * (C) 2016 Senet, Inc
Shaun Nelson 28:4fd8a894a403 9 *
Shaun Nelson 28:4fd8a894a403 10 */
Shaun Nelson 28:4fd8a894a403 11 #include "board_udk.h"
Shaun Nelson 28:4fd8a894a403 12 #include "board_evb.h"
Shaun Nelson 28:4fd8a894a403 13 #include "ChannelPlans.h"
Shaun Nelson 28:4fd8a894a403 14
Shaun Nelson 41:208af6be1869 15 CBoard* CBoard::boardPtr = 0;
Shaun Nelson 41:208af6be1869 16 PB_FUNC CBoard::buttonCallback = 0;;
Shaun Nelson 41:208af6be1869 17 mDot *mDotPtr = 0;
Shaun Nelson 39:022b327d6bf0 18
Shaun Nelson 39:022b327d6bf0 19 EBoardStatus BoardInit()
Shaun Nelson 39:022b327d6bf0 20 {
Shaun Nelson 39:022b327d6bf0 21 #ifdef MTDOT_UDK
Shaun Nelson 39:022b327d6bf0 22 new CBoardUDK();
Shaun Nelson 39:022b327d6bf0 23 #elif MTDOT_EVB
Shaun Nelson 39:022b327d6bf0 24 new CBoardEVB();
Shaun Nelson 39:022b327d6bf0 25 #else
Shaun Nelson 39:022b327d6bf0 26 #error Need to define board type ( MTDOT_UDK or MTDOT_EVB)
Shaun Nelson 39:022b327d6bf0 27 #endif
Shaun Nelson 39:022b327d6bf0 28
Shaun Nelson 39:022b327d6bf0 29 return ( ( CBoard::boardPtr != 0 ) ? CBoard::boardPtr->init() : Board_Fail);
Shaun Nelson 39:022b327d6bf0 30 }
Shaun Nelson 28:4fd8a894a403 31
Shaun Nelson 28:4fd8a894a403 32
Shaun Nelson 28:4fd8a894a403 33 EBoardStatus CBoard::init()
Shaun Nelson 28:4fd8a894a403 34 {
Shaun Nelson 28:4fd8a894a403 35 lora::ChannelPlan* plan = new lora::ChannelPlan_US915();
Shaun Nelson 28:4fd8a894a403 36 assert(plan);
Shaun Nelson 28:4fd8a894a403 37
Shaun Nelson 28:4fd8a894a403 38 mDotPtr = mDot::getInstance(plan);
Shaun Nelson 28:4fd8a894a403 39 assert(mDotPtr);
Shaun Nelson 28:4fd8a894a403 40
Shaun Nelson 28:4fd8a894a403 41 debugUART.baud(115200);
Shaun Nelson 28:4fd8a894a403 42
Shaun Nelson 28:4fd8a894a403 43 return Board_Ok;
Shaun Nelson 28:4fd8a894a403 44 }