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.cpp@39:022b327d6bf0, 2017-08-29 (annotated)
- Committer:
- Shaun Nelson
- Date:
- Tue Aug 29 18:05:34 2017 -0400
- Branch:
- develop
- Revision:
- 39:022b327d6bf0
- Parent:
- 32:5873d0638277
- Child:
- 41:208af6be1869
- Add Set/Toggle LED to board API
- Turn LED on/off based on backend state (on = out-of-sync, off = in sync)
Who changed what in which revision?
User | Revision | Line number | New 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 |
28:4fd8a894a403 | 15 | CBoard* CBoard::boardPtr = 0; |
Shaun Nelson |
28:4fd8a894a403 | 16 | mDot *mDotPtr = 0; |
Shaun Nelson |
39:022b327d6bf0 | 17 | |
Shaun Nelson |
39:022b327d6bf0 | 18 | EBoardStatus BoardInit() |
Shaun Nelson |
39:022b327d6bf0 | 19 | { |
Shaun Nelson |
39:022b327d6bf0 | 20 | #ifdef MTDOT_UDK |
Shaun Nelson |
39:022b327d6bf0 | 21 | new CBoardUDK(); |
Shaun Nelson |
39:022b327d6bf0 | 22 | #elif MTDOT_EVB |
Shaun Nelson |
39:022b327d6bf0 | 23 | new CBoardEVB(); |
Shaun Nelson |
39:022b327d6bf0 | 24 | #else |
Shaun Nelson |
39:022b327d6bf0 | 25 | #error Need to define board type ( MTDOT_UDK or MTDOT_EVB) |
Shaun Nelson |
39:022b327d6bf0 | 26 | #endif |
Shaun Nelson |
39:022b327d6bf0 | 27 | |
Shaun Nelson |
39:022b327d6bf0 | 28 | return ( ( CBoard::boardPtr != 0 ) ? CBoard::boardPtr->init() : Board_Fail); |
Shaun Nelson |
39:022b327d6bf0 | 29 | } |
Shaun Nelson |
28:4fd8a894a403 | 30 | |
Shaun Nelson |
28:4fd8a894a403 | 31 | |
Shaun Nelson |
28:4fd8a894a403 | 32 | EBoardStatus CBoard::init() |
Shaun Nelson |
28:4fd8a894a403 | 33 | { |
Shaun Nelson |
28:4fd8a894a403 | 34 | lora::ChannelPlan* plan = new lora::ChannelPlan_US915(); |
Shaun Nelson |
28:4fd8a894a403 | 35 | assert(plan); |
Shaun Nelson |
28:4fd8a894a403 | 36 | |
Shaun Nelson |
28:4fd8a894a403 | 37 | mDotPtr = mDot::getInstance(plan); |
Shaun Nelson |
28:4fd8a894a403 | 38 | assert(mDotPtr); |
Shaun Nelson |
28:4fd8a894a403 | 39 | |
Shaun Nelson |
28:4fd8a894a403 | 40 | debugUART.baud(115200); |
Shaun Nelson |
28:4fd8a894a403 | 41 | |
Shaun Nelson |
28:4fd8a894a403 | 42 | return Board_Ok; |
Shaun Nelson |
28:4fd8a894a403 | 43 | } |