Skip to content

Commit 3f848f3

Browse files
committed
New board definitions
1 parent 76daf6c commit 3f848f3

File tree

298 files changed

+9351
-6610
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

298 files changed

+9351
-6610
lines changed

DigitalIO/DigitalPin.h

Lines changed: 0 additions & 597 deletions
This file was deleted.

DigitalIO/attic/ADS7818.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#ifndef ADS7818_h
2-
#define ADS7871_h
2+
#define ADS7818_h
33
//------------------------------------------------------------------------------
44
/** nop to tune soft SPI timing */
55
#define nop asm volatile ("nop\n\t")

DigitalIO/attic/MCP320X.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#ifndef MCP320X_h
22
#define MCP320X_h
3-
#include <DigitalIO.h>
3+
#include "DigitalIO.h"
44
//==============================================================================
55
template<uint8_t CsPin, uint8_t ClkPin, uint8_t DoutPin, uint8_t UsecDelay = 0>
66
class MCP3201 {

DigitalIO/attic/MCP355X.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#ifndef MCP355X_h
22
#define MCP355X_h
3-
#include <DigitalIO.h>
3+
#include "DigitalIO.h"
44
// Overflow values.
55
const int32_t MCP355X_OVH = 2097152L;
66
const int32_t MCP355X_OVL = -2097153L;

DigitalIO/examples/DigitalPinBlink/DigitalPinBlink.ino

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
#include <DigitalIO.h>
21
// Create object for pin 13 in output mode and demo toggle().
3-
DigitalPin<13> pin13(OUTPUT);
2+
#include "DigitalIO.h"
43

5-
void setup() {}
4+
DigitalPin<13> pin13;
5+
6+
void setup() {
7+
pin13.mode(OUTPUT);
8+
}
69

710
void loop() {
811
// toggle is a two byte instruction that executes

DigitalIO/examples/DigitalPinConfigToggle/DigitalPinConfigToggle.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Demo of config() and fast toggle() function.
2-
#include <DigitalIO.h>
2+
#include "DigitalIO.h"
33

44
// Class with compile time pin number.
55
DigitalPin<13> pin13;

DigitalIO/examples/DigitalPinReadWrite/DigitalPinReadWrite.ino

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
// Read pin 12 and write value to pin 13.
2-
#include <DigitalIO.h>
2+
#include "DigitalIO.h"
33

4-
DigitalPin<12> pin12(INPUT);
5-
DigitalPin<13> pin13(OUTPUT);
4+
DigitalPin<12> pin12;
5+
DigitalPin<13> pin13;
66

7-
void setup() {}
7+
void setup() {
8+
pin12.mode(INPUT);
9+
pin13.mode(OUTPUT);
10+
}
811

912
void loop() {
1013
pin13 = pin12;

DigitalIO/examples/DigitalPinShiftOut/DigitalPinShiftOut.ino

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
// Scope test for fast shiftOut function.
2-
#include <DigitalIO.h>
3-
4-
// Create clockPin in output mode with inital level LOW.
5-
DigitalPin<12> clockPin(OUTPUT, LOW);
6-
7-
// Create dataPin in output mode with inital level HIGH.
8-
DigitalPin<13> dataPin(OUTPUT, HIGH);
2+
#include "DigitalIO.h"
93

4+
DigitalPin<12> clockPin;
5+
DigitalPin<13> dataPin;
106
//------------------------------------------------------------------------------
117
// Time to send one bit is ten cycles or 625 ns for 16 MHz CPU.
128
inline __attribute__((always_inline))
@@ -30,7 +26,11 @@ void shiftOut(uint8_t bits) {
3026
}
3127
//------------------------------------------------------------------------------
3228
void setup() {
33-
// Not used.
29+
// clockPin in output mode with inital level LOW.
30+
clockPin.config(OUTPUT, LOW);
31+
32+
// dataPin in output mode with inital level HIGH.
33+
dataPin.config(OUTPUT, HIGH);
3434
}
3535
//------------------------------------------------------------------------------
3636
void loop() {
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Create content of a GpioPinMap file.
2+
void setup() {
3+
Serial.begin(9600);
4+
while(!Serial);
5+
Serial.println(
6+
"#ifndef BoardGpioPinMap_h\r\n"
7+
"#define BoardGpioPinMap_h\r\n"
8+
"static const GpioPinMap_t GpioPinMap[] = {");
9+
10+
for (int i = 0; i < NUM_DIGITAL_PINS; i++) {
11+
Serial.print(" GPIO_PIN(");
12+
Serial.print((char)('A' - 1 + digitalPinToPort(i)));
13+
Serial.write(", ");
14+
15+
int m = digitalPinToBitMask(i);
16+
int b = 0;
17+
for (b = 0; (1 << b) != m; b++) {}
18+
Serial.print(b);
19+
if (i < (NUM_DIGITAL_PINS - 1)) {
20+
Serial.print("),");
21+
} else {
22+
Serial.print(") ");
23+
}
24+
Serial.print(" // D");
25+
Serial.println(i);
26+
}
27+
Serial.println(
28+
"};\r\n"
29+
"#endif // BoardGpioPinMap_h");
30+
}
31+
32+
void loop() {
33+
}

DigitalIO/examples/PinIOBegin/PinIOBegin.ino

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Use begin to assign pin numbers.
22
// Read pin 12 and write the value to pin 13.
3-
#include <DigitalIO.h>
3+
#ifdef __AVR__
4+
#include "DigitalIO.h"
45

56
// Declare the PinIO instances.
67
PinIO readPin;
@@ -21,4 +22,7 @@ void setup() {
2122
void loop() {
2223
// Copy the value read from readPin to writePin.
2324
writePin.write(readPin.read());
24-
}
25+
}
26+
#else // _AVR__
27+
#error AVR only example
28+
#endif // __AVR__

0 commit comments

Comments
 (0)