-
-
Notifications
You must be signed in to change notification settings - Fork 281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Raytac MDBT40 module #297
Open
nhnifong
wants to merge
3
commits into
sandeepmistry:master
Choose a base branch
from
nhnifong:raytac_mdbt40_issue280
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+250
−0
Open
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
Copyright (c) 2014-2015 Arduino LLC. All right reserved. | ||
This library is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 2.1 of the License, or (at your option) any later version. | ||
This library is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
See the GNU Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public | ||
License along with this library; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
*/ | ||
|
||
// API compatibility | ||
#include "variant.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/* | ||
Copyright (c) 2014-2015 Arduino LLC. All right reserved. | ||
Copyright (c) 2016 Sandeep Mistry All right reserved. | ||
|
||
This library is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 2.1 of the License, or (at your option) any later version. | ||
|
||
This library is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
See the GNU Lesser General Public License for more details. | ||
|
||
You should have received a copy of the GNU Lesser General Public | ||
License along with this library; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
*/ | ||
|
||
#include "variant.h" | ||
|
||
|
||
// Pin map from 0-indexed pin number on the MDBT40 chip to the | ||
// digital P0.XX pin numbering scheme | ||
// taken from https://www.tinyosshop.com/datasheet/MDBT40%20spec-Version%20A4.pdf | ||
// Lines without comments are P0.XX pins. | ||
const uint32_t g_ADigitalPinMap[] = { | ||
// 0 - 1 | ||
(uint32_t)-1, // GND | ||
(uint32_t)-1, // GND | ||
|
||
// 2 - 11 | ||
(uint32_t)-1, // AVDD | ||
21, | ||
22, | ||
23, | ||
24, | ||
25, | ||
(uint32_t)-1, // XL2 - crystal | ||
(uint32_t)-1, // XL1 - crystal | ||
28, | ||
29, | ||
|
||
// 12 - 24 | ||
(uint32_t)-1, // GND | ||
(uint32_t)-1, // VDD | ||
(uint32_t)-1, // DCC | ||
30, | ||
0, | ||
1, | ||
2, | ||
3, | ||
4, | ||
5, | ||
6, | ||
7, | ||
(uint32_t)-1, // GND | ||
|
||
// 25 - 33 | ||
8, | ||
9, | ||
10, | ||
11, | ||
12, | ||
13, | ||
14, | ||
15, | ||
16, | ||
|
||
// 34 - 35 | ||
(uint32_t)-1, // SWDIO | ||
(uint32_t)-1, // SWCLK, | ||
|
||
// 36 - 41 | ||
17, | ||
18, | ||
19, | ||
20, | ||
(uint32_t)-1, // DEC2 | ||
(uint32_t)-1, // GND | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
/* | ||
Copyright (c) 2014-2015 Arduino LLC. All right reserved. | ||
Copyright (c) 2016 Sandeep Mistry All right reserved. | ||
This library is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 2.1 of the License, or (at your option) any later version. | ||
This library is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
See the GNU Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public | ||
License along with this library; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
*/ | ||
|
||
#ifndef _VARIANT_GENERIC_ | ||
#define _VARIANT_GENERIC_ | ||
|
||
/** Master clock frequency */ | ||
#ifdef NRF52 | ||
#define VARIANT_MCK (64000000ul) | ||
#else | ||
#define VARIANT_MCK (16000000ul) | ||
#endif | ||
|
||
/*---------------------------------------------------------------------------- | ||
* Headers | ||
*----------------------------------------------------------------------------*/ | ||
|
||
#include "WVariant.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" | ||
{ | ||
#endif // __cplusplus | ||
|
||
// Number of pins defined in PinDescription array | ||
#define PINS_COUNT (42u) | ||
#define NUM_DIGITAL_PINS (31u) | ||
#define NUM_ANALOG_INPUTS (0u) | ||
#define NUM_ANALOG_OUTPUTS (0u) | ||
|
||
// LEDs | ||
#define PIN_LED (0) | ||
#define LED_BUILTIN PIN_LED | ||
|
||
/* | ||
* Analog pins | ||
*/ | ||
#define PIN_A0 (0) | ||
#define PIN_A1 (0) | ||
#define PIN_A2 (0) | ||
#define PIN_A3 (0) | ||
#define PIN_A4 (0) | ||
#define PIN_A5 (0) | ||
|
||
static const uint8_t A0 = PIN_A0 ; | ||
static const uint8_t A1 = PIN_A1 ; | ||
static const uint8_t A2 = PIN_A2 ; | ||
static const uint8_t A3 = PIN_A3 ; | ||
static const uint8_t A4 = PIN_A4 ; | ||
static const uint8_t A5 = PIN_A5 ; | ||
#define ADC_RESOLUTION 10 | ||
|
||
/* | ||
* Serial interfaces | ||
*/ | ||
// Serial | ||
#define PIN_SERIAL_RX (4) // P0.22 | ||
#define PIN_SERIAL_TX (3) // P0.21 | ||
|
||
/* | ||
* SPI Interfaces | ||
*/ | ||
#define SPI_INTERFACES_COUNT 0 | ||
|
||
#define PIN_SPI_MISO (0) | ||
#define PIN_SPI_MOSI (0) | ||
#define PIN_SPI_SCK (0) | ||
|
||
static const uint8_t SS = 2 ; | ||
static const uint8_t MOSI = PIN_SPI_MOSI ; | ||
static const uint8_t MISO = PIN_SPI_MISO ; | ||
static const uint8_t SCK = PIN_SPI_SCK ; | ||
|
||
/* | ||
* Wire Interfaces | ||
*/ | ||
#define WIRE_INTERFACES_COUNT 0 | ||
|
||
#define PIN_WIRE_SDA (0u) | ||
#define PIN_WIRE_SCL (0u) | ||
|
||
static const uint8_t SDA = PIN_WIRE_SDA; | ||
static const uint8_t SCL = PIN_WIRE_SCL; | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The above too lines need to be updated.