You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Commented out because we don't know which pins should be used on the Artemis module
91
-
//
92
-
// Uart Serial(0, 23, 22); // Declares a Uart object called Serial using instance 0 of Apollo3 UART peripherals with RX on variant pin 23 and TX on pin 24 (note, you specify *pins* not Apollo3 pads. This uses the variant's pin map to determine the Apollo3 pad)
93
-
// Uart Serial1(1, 0, 1); // Declares a Uart object called Serial1 using instance 1 of Apollo3 UART peripherals with RX on pin 0 and TX on pin 1 (note, you specify *pins* not Apollo3 pads. This uses the variant's pin map to determine the Apollo3 pad)
94
-
89
+
//We default Serial to 22/23 but can be moved to any TX0/RX0 pin
90
+
Uart Serial(0, 23, 22); // Declares a Uart object called Serial using instance 0 of Apollo3 UART peripherals with RX on variant pin 23 and TX on pin 24 (note, you specify *pins* not Apollo3 pads. This uses the variant's pin map to determine the Apollo3 pad)
91
+
// Uart Serial1(1, 0, 1); // Declares a Uart object called Serial1 using instance 1 of Apollo3 UART peripherals with RX on pin 0 and TX on pin 1 (note, you specify *pins* not Apollo3 pads. This uses the variant's pin map to determine the Apollo3 pad)
// - "HardwareSerial" is the class that is built into Arduino to allow "Serial.print()"
70
-
// and related functions to work.
69
+
// and related functions to work.
71
70
// - The "Uart" class inherits from HardwareSerial and contains Apollo3-specific code
72
71
// - Declaring your Uart objects here makes them available in any Arduino code and you
73
72
// can give them extra descriptive names
74
-
// - The maximum number of Uarts is 2 (instances 0 and 1)
73
+
// - The maximum number of Uarts is 2 (instances 0 and 1)
75
74
//
76
75
// In this case the declarations are commented out because we don't know which pins of
77
76
// the Artemis module you would like to use
78
77
classUart; // Forward declaration of Uart class
79
-
//extern Uart Serial;
78
+
extern Uart Serial;
80
79
// extern Uart Serial1;
81
80
82
81
// A note about IOMaster peripherals:
83
82
// - IOMaster peripherals are used to provide either SPI or I2C communications. The pads
84
83
// of the Apollo3 that a given IOMaster [0,5] use are not configurable
85
84
86
85
// Wire defines
87
-
// - Wire is the I2C class for Arduino.
88
-
// - Wire is handled differently than HardwareSerial/Uart because Wire is a library that
86
+
// - Wire is the I2C class for Arduino.
87
+
// - Wire is handled differently than HardwareSerial/Uart because Wire is a library that
89
88
// you have to include manually (saves space if you won't be using I2C)
90
89
// - In this case we rely on communication between the variant.h file and the Wire library
91
90
// through the use of #define statements
@@ -107,7 +106,7 @@ class Uart; // Forward declaration of Uart class
107
106
#defineAP3_Wire5_IOM5// Secify that Wire5 uses IOMaster instance 5
108
107
// This is also a convenient location to provide some aliased names for certain Wire objects
109
108
// For example: (examples commented out because they aren't real)
110
-
//
109
+
//
111
110
// #define WireQwiic Wire // Giving Wire an alias of "WireQwiic" to indicat that it is the I2C controller for the Qwiic bus
112
111
// #define WireAccel Wire1 // Useful if the variant has an onboard accelerometer connected to the Wire1 bus
113
112
@@ -121,19 +120,18 @@ class Uart; // Forward declaration of Uart class
121
120
// you need to specify two settings:
122
121
// - - AP3_SPI_IOM - which IOMaster peripher the SPI object will use
123
122
// - - AP3_SPI_DUP - which duplex mode the SPI object will use (full duplex is the most common, ap3_spi_tx_only and ap3_spi_rx_only are the other options )
124
-
#defineAP3_SPI_IOM0
125
-
#defineAP3_SPI_DUP ap3_spi_full_duplex
126
-
#defineAP3_SPI1_IOM1
127
-
#defineAP3_SPI1_DUP ap3_spi_full_duplex
128
-
#defineAP3_SPI2_IOM2
129
-
#defineAP3_SPI2_DUP ap3_spi_full_duplex
130
-
#defineAP3_SPI3_IOM3
131
-
#defineAP3_SPI3_DUP ap3_spi_full_duplex
132
-
#defineAP3_SPI4_IOM4
133
-
#defineAP3_SPI4_DUP ap3_spi_full_duplex
134
-
#defineAP3_SPI5_IOM5
135
-
#defineAP3_SPI5_DUP ap3_spi_full_duplex
136
-
123
+
#defineAP3_SPI_IOM0
124
+
#defineAP3_SPI_DUP ap3_spi_full_duplex
125
+
#defineAP3_SPI1_IOM1
126
+
#defineAP3_SPI1_DUP ap3_spi_full_duplex
127
+
#defineAP3_SPI2_IOM2
128
+
#defineAP3_SPI2_DUP ap3_spi_full_duplex
129
+
#defineAP3_SPI3_IOM3
130
+
#defineAP3_SPI3_DUP ap3_spi_full_duplex
131
+
#defineAP3_SPI4_IOM4
132
+
#defineAP3_SPI4_DUP ap3_spi_full_duplex
133
+
#defineAP3_SPI5_IOM5
134
+
#defineAP3_SPI5_DUP ap3_spi_full_duplex
137
135
138
136
// Additional Pin Aliasing
139
137
// - It is required that every pin is accessible by a number between 0 and (AP3_VARIANT_NUM_PINS - 1)
0 commit comments