Senet / Mbed OS MTDOT-UDKDemo

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:
Thu Aug 24 17:56:53 2017 -0400
Branch:
develop
Revision:
27:1753a44fa9ec
Reimplement for mbed 5
Move bsp to board files
UDK implemented
EVB in progress

Who changed what in which revision?

UserRevisionLine numberNew 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) 2016 Senet, Inc
Shaun Nelson 27:1753a44fa9ec 9 *
Shaun Nelson 27:1753a44fa9ec 10 */
Shaun Nelson 27:1753a44fa9ec 11 #include "board.h"
Shaun Nelson 27:1753a44fa9ec 12 #include "ChannelPlans.h"
Shaun Nelson 27:1753a44fa9ec 13
Shaun Nelson 27:1753a44fa9ec 14 mDot *mDotPtr = NULL;
Shaun Nelson 27:1753a44fa9ec 15 DigitalOut appLED(PA_0);
Shaun Nelson 27:1753a44fa9ec 16
Shaun Nelson 27:1753a44fa9ec 17 // To be implemented by the target
Shaun Nelson 27:1753a44fa9ec 18 extern void BoardInit();
Shaun Nelson 27:1753a44fa9ec 19 extern void BoardStart();
Shaun Nelson 27:1753a44fa9ec 20 extern void BoardStop();
Shaun Nelson 27:1753a44fa9ec 21
Shaun Nelson 27:1753a44fa9ec 22 void BoardCommonInit()
Shaun Nelson 27:1753a44fa9ec 23 {
Shaun Nelson 27:1753a44fa9ec 24 if(mDotPtr == NULL)
Shaun Nelson 27:1753a44fa9ec 25 {
Shaun Nelson 27:1753a44fa9ec 26 lora::ChannelPlan* plan = new lora::ChannelPlan_US915();
Shaun Nelson 27:1753a44fa9ec 27 assert(plan);
Shaun Nelson 27:1753a44fa9ec 28
Shaun Nelson 27:1753a44fa9ec 29 mDotPtr = mDot::getInstance(plan);
Shaun Nelson 27:1753a44fa9ec 30 assert(mDotPtr);
Shaun Nelson 27:1753a44fa9ec 31 }
Shaun Nelson 27:1753a44fa9ec 32
Shaun Nelson 27:1753a44fa9ec 33 debugUART.baud(115200);
Shaun Nelson 27:1753a44fa9ec 34 }
Shaun Nelson 27:1753a44fa9ec 35
Shaun Nelson 27:1753a44fa9ec 36 void BoardSetState( EBoardState state )
Shaun Nelson 27:1753a44fa9ec 37 {
Shaun Nelson 27:1753a44fa9ec 38 switch (state)
Shaun Nelson 27:1753a44fa9ec 39 {
Shaun Nelson 27:1753a44fa9ec 40 case Board_init:
Shaun Nelson 27:1753a44fa9ec 41 BoardCommonInit();
Shaun Nelson 27:1753a44fa9ec 42 BoardInit();
Shaun Nelson 27:1753a44fa9ec 43 break;
Shaun Nelson 27:1753a44fa9ec 44 case Board_start:
Shaun Nelson 27:1753a44fa9ec 45 BoardStart();
Shaun Nelson 27:1753a44fa9ec 46 break;
Shaun Nelson 27:1753a44fa9ec 47 case Board_stop:
Shaun Nelson 27:1753a44fa9ec 48 BoardStop();
Shaun Nelson 27:1753a44fa9ec 49 default:
Shaun Nelson 27:1753a44fa9ec 50 break;
Shaun Nelson 27:1753a44fa9ec 51 }
Shaun Nelson 27:1753a44fa9ec 52 }