Skip to content

Commit 3b4ab19

Browse files
Fixed up wrong file copy
1 parent 81d77a9 commit 3b4ab19

File tree

144 files changed

+568
-42073
lines changed

Some content is hidden

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

144 files changed

+568
-42073
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ Documentation for how to integrate with a Arduino core (which is necessary if yo
8585
* [ArduinoCore-mbed](https://github.com/arduino/ArduinoCore-mbed#clone-the-repository-in-sketchbookhardwarearduino-git)
8686
* [ArduinoCore-samd](https://github.com/arduino/ArduinoCore-samd/#developing)
8787

88-
## Donations
88+
## Support the project
8989

90-
This open source code is maintained by Arduino with the help of the community. We invest a considerable amount of time in testing code, optimizing it and introducing new features. Please consider [donating](https://www.arduino.cc/en/donate/) or [sponsoring](https://github.com/sponsors/arduino) to support our work, as well as [buying original Arduino boards](https://store.arduino.cc) which is the best way to make sure our effort can continue in the long term.
90+
This open source code is maintained by Arduino with the help of the community. We invest a considerable amount of time in testing code, optimizing it and introducing new features. Please consider [buying original Arduino boards](https://store.arduino.cc) to support our work on the project.
9191

9292
## License and credits
9393

api/ArduinoAPI.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
#ifndef ARDUINO_API_H
2121
#define ARDUINO_API_H
2222

23-
// version 1.5.1
24-
#define ARDUINO_API_VERSION 10501
23+
// version 1.5.2
24+
#define ARDUINO_API_VERSION 10502
2525

2626
#include "Binary.h"
2727

api/Common.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@ typedef enum {
4141
INPUT_PULLUP = 0x2,
4242
INPUT_PULLDOWN = 0x3,
4343
OUTPUT_OPENDRAIN = 0x4,
44-
45-
OUTPUT_2MA = 0x5,
46-
OUTPUT_4MA = 0x6,
47-
OUTPUT_8MA = 0x7,
48-
OUTPUT_12MA = 0x8,
4944
} PinMode;
5045

5146
typedef enum {

api/HardwareSPI.h

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,33 +34,42 @@ typedef enum {
3434
SPI_MODE3 = 3,
3535
} SPIMode;
3636

37+
// Platforms should define SPI_HAS_PERIPHERAL_MODE if SPI peripheral
38+
// mode is supported, to allow applications to check whether peripheral
39+
// mode is available or not.
40+
typedef enum {
41+
SPI_CONTROLLER = 0,
42+
SPI_PERIPHERAL = 1,
43+
} SPIBusMode;
44+
3745

3846
class SPISettings {
3947
public:
40-
SPISettings(uint32_t clock, BitOrder bitOrder, SPIMode dataMode) {
48+
SPISettings(uint32_t clock, BitOrder bitOrder, SPIMode dataMode, SPIBusMode busMode = SPI_CONTROLLER) {
4149
if (__builtin_constant_p(clock)) {
42-
init_AlwaysInline(clock, bitOrder, dataMode);
50+
init_AlwaysInline(clock, bitOrder, dataMode, busMode);
4351
} else {
44-
init_MightInline(clock, bitOrder, dataMode);
52+
init_MightInline(clock, bitOrder, dataMode, busMode);
4553
}
4654
}
4755

48-
SPISettings(uint32_t clock, BitOrder bitOrder, int dataMode) {
56+
SPISettings(uint32_t clock, BitOrder bitOrder, int dataMode, SPIBusMode busMode = SPI_CONTROLLER) {
4957
if (__builtin_constant_p(clock)) {
50-
init_AlwaysInline(clock, bitOrder, (SPIMode)dataMode);
58+
init_AlwaysInline(clock, bitOrder, static_cast<SPIMode>(dataMode), busMode);
5159
} else {
52-
init_MightInline(clock, bitOrder, (SPIMode)dataMode);
60+
init_MightInline(clock, bitOrder, static_cast<SPIMode>(dataMode), busMode);
5361
}
5462
}
5563

5664
// Default speed set to 4MHz, SPI mode set to MODE 0 and Bit order set to MSB first.
57-
SPISettings() { init_AlwaysInline(4000000, MSBFIRST, SPI_MODE0); }
65+
SPISettings() { init_AlwaysInline(4000000, MSBFIRST, SPI_MODE0, SPI_CONTROLLER); }
5866

5967
bool operator==(const SPISettings& rhs) const
6068
{
6169
if ((this->clockFreq == rhs.clockFreq) &&
6270
(this->bitOrder == rhs.bitOrder) &&
63-
(this->dataMode == rhs.dataMode)) {
71+
(this->dataMode == rhs.dataMode) &&
72+
(this->busMode == rhs.busMode)) {
6473
return true;
6574
}
6675
return false;
@@ -80,22 +89,27 @@ class SPISettings {
8089
BitOrder getBitOrder() const {
8190
return (bitOrder);
8291
}
92+
SPIBusMode getBusMode() const {
93+
return busMode;
94+
}
8395

8496
private:
85-
void init_MightInline(uint32_t clock, BitOrder bitOrder, SPIMode dataMode) {
86-
init_AlwaysInline(clock, bitOrder, dataMode);
97+
void init_MightInline(uint32_t clock, BitOrder bitOrder, SPIMode dataMode, SPIBusMode busMode) {
98+
init_AlwaysInline(clock, bitOrder, dataMode, busMode);
8799
}
88100

89101
// Core developer MUST use an helper function in beginTransaction() to use this data
90-
void init_AlwaysInline(uint32_t clock, BitOrder bitOrder, SPIMode dataMode) __attribute__((__always_inline__)) {
102+
void init_AlwaysInline(uint32_t clock, BitOrder bitOrder, SPIMode dataMode, SPIBusMode busMode) __attribute__((__always_inline__)) {
91103
this->clockFreq = clock;
92104
this->dataMode = dataMode;
93105
this->bitOrder = bitOrder;
106+
this->busMode = busMode;
94107
}
95108

96109
uint32_t clockFreq;
97110
SPIMode dataMode;
98111
BitOrder bitOrder;
112+
SPIBusMode busMode;
99113

100114
friend class HardwareSPI;
101115
};
@@ -111,9 +125,6 @@ class HardwareSPI
111125
virtual uint16_t transfer16(uint16_t data) = 0;
112126
virtual void transfer(void *buf, size_t count) = 0;
113127

114-
// EFP3 - Additional block-based versions we implement
115-
virtual void transfer(const void *txbuf, void *rxbuf, size_t count) = 0;
116-
117128
// Transaction Functions
118129
virtual void usingInterrupt(int interruptNumber) = 0;
119130
virtual void notUsingInterrupt(int interruptNumber) = 0;

api/HardwareSerial.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,4 @@ class HardwareSerial : public Stream
103103
// XXX: Are we keeping the serialEvent API?
104104
extern void serialEventRun(void) __attribute__((weak));
105105

106-
}
107-
108-
using arduino::HardwareSerial;
106+
}

0 commit comments

Comments
 (0)