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@28:4fd8a894a403, 2017-08-25 (annotated)
- Committer:
- Shaun Nelson
- Date:
- Fri Aug 25 09:29:01 2017 -0400
- Branch:
- develop
- Revision:
- 28:4fd8a894a403
- Child:
- 32:5873d0638277
Create board api class and implement for EVB and UDK mDot boards.
UDK platform is working
Do not try EVB, not sure it even compiles
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 |
28:4fd8a894a403 | 17 | DigitalOut appLED(PA_0); |
Shaun Nelson |
28:4fd8a894a403 | 18 | |
Shaun Nelson |
28:4fd8a894a403 | 19 | |
Shaun Nelson |
28:4fd8a894a403 | 20 | EBoardStatus CBoard::init() |
Shaun Nelson |
28:4fd8a894a403 | 21 | { |
Shaun Nelson |
28:4fd8a894a403 | 22 | lora::ChannelPlan* plan = new lora::ChannelPlan_US915(); |
Shaun Nelson |
28:4fd8a894a403 | 23 | assert(plan); |
Shaun Nelson |
28:4fd8a894a403 | 24 | |
Shaun Nelson |
28:4fd8a894a403 | 25 | mDotPtr = mDot::getInstance(plan); |
Shaun Nelson |
28:4fd8a894a403 | 26 | assert(mDotPtr); |
Shaun Nelson |
28:4fd8a894a403 | 27 | |
Shaun Nelson |
28:4fd8a894a403 | 28 | debugUART.baud(115200); |
Shaun Nelson |
28:4fd8a894a403 | 29 | |
Shaun Nelson |
28:4fd8a894a403 | 30 | return Board_Ok; |
Shaun Nelson |
28:4fd8a894a403 | 31 | } |
Shaun Nelson |
28:4fd8a894a403 | 32 | |
Shaun Nelson |
28:4fd8a894a403 | 33 | |
Shaun Nelson |
28:4fd8a894a403 | 34 | EBoardStatus BoardInit() |
Shaun Nelson |
28:4fd8a894a403 | 35 | { |
Shaun Nelson |
28:4fd8a894a403 | 36 | EBoardStatus status = Board_Fail; |
Shaun Nelson |
28:4fd8a894a403 | 37 | |
Shaun Nelson |
28:4fd8a894a403 | 38 | #ifdef MTDOT_UDK |
Shaun Nelson |
28:4fd8a894a403 | 39 | new CBoardUDK(); |
Shaun Nelson |
28:4fd8a894a403 | 40 | #elif MTDOT_EVB |
Shaun Nelson |
28:4fd8a894a403 | 41 | new CBoardEVB(); |
Shaun Nelson |
28:4fd8a894a403 | 42 | #else |
Shaun Nelson |
28:4fd8a894a403 | 43 | #error Need to define board type ( MTDOT_UDK or MTDOT_EVB) |
Shaun Nelson |
28:4fd8a894a403 | 44 | #endif |
Shaun Nelson |
28:4fd8a894a403 | 45 | |
Shaun Nelson |
28:4fd8a894a403 | 46 | // CBoard::boardPtr = board; |
Shaun Nelson |
28:4fd8a894a403 | 47 | |
Shaun Nelson |
28:4fd8a894a403 | 48 | return ( CBoard::boardPtr->init() ); |
Shaun Nelson |
28:4fd8a894a403 | 49 | } |