Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdb1e676

Browse files
committed
Update version varian.h
1 parent403db0f commitdb1e676

File tree

1 file changed

+27
-19
lines changed

1 file changed

+27
-19
lines changed

‎variants/RAK811/variant.h‎

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@
3434
/*----------------------------------------------------------------------------
3535
* Headers
3636
*----------------------------------------------------------------------------*/
37-
38-
#include"pins_arduino.h"
37+
#include"PeripheralPins.h"
3938

4039
#ifdef__cplusplus
4140
extern"C"{
@@ -88,18 +87,27 @@ enum {
8887
PC13,//DIO4
8988
PEND
9089
};
91-
// Enum defining Arduino style alias for analog pin number --> Ax
90+
91+
// This must be a literal with the same value as PEND
92+
// It is used with preprocessor tests (e.g. #if NUM_DIGITAL_PINS > 3)
93+
// so an enum will not work.
94+
#defineNUM_DIGITAL_PINS 28
95+
96+
// Allow to define Arduino style alias for analog input pin number --> Ax
97+
// All pins are digital, analog inputs are a subset of digital pins
98+
// and must be contiguous to be able to loop on each value
99+
// This must be a literal with a value less than or equal to MAX_ANALOG_INPUTS
100+
// defined in pin_arduino.h
101+
// It is used with preprocessor tests (e.g. #if NUM_ANALOG_INPUTS > 3)
102+
// so an enum will not work.
92103
// !!!
93104
// !!! It must be aligned with the number of analog PinName
94105
// !!! defined in digitalPin[] array in variant.cpp
95106
// !!!
96-
enum {
97-
A_START_AFTER=D20,// pin number preceding A0
98-
A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,
99-
A10,A11,A12,A13,A14,A15,A16,A17,
100-
AEND
101-
};
102-
107+
#defineNUM_ANALOG_INPUTS 3
108+
// Define digital pin number of the first analog input (i.e. which digital pin is A0)
109+
// First analog pin value (A0) must be greater than or equal to NUM_ANALOG_INPUTS
110+
#defineNUM_ANALOG_FIRST 0
103111

104112
// Below ADC, DAC and PWM definitions already done in the core
105113
// Could be redefined here if needed
@@ -117,15 +125,15 @@ enum {
117125
#defineLED_GREEN LED_BUILTIN
118126

119127
// On-board user button
120-
//#define USER_BTNDx
128+
//#define USER_BTNx
121129

122130
// Below SPI and I2C definitions already done in the core
123-
// Could be redefined here ifneeded
131+
// Could be redefined here ifdiffers from the default one
124132
// SPI Definitions
125-
//#defineSS PB0 // Default for Arduino connector compatibility
126-
//#defineMOSI PA7 // Default for Arduino connector compatibility
127-
//#defineMISO PA6 // Default for Arduino connector compatibility
128-
//#defineSCK PA5 // Default for Arduino connector compatibility
133+
//#definePIN_SPI_SS10 // Default for Arduino connector compatibility
134+
//#definePIN_SPI_MOSI11 // Default for Arduino connector compatibility
135+
//#definePIN_SPI_MISO12 // Default for Arduino connector compatibility
136+
//#definePIN_SPI_SCK13 // Default for Arduino connector compatibility
129137

130138
// LORA
131139
#defineRADIO_RESET_PORT PB13
@@ -141,8 +149,8 @@ enum {
141149
//#define RADIO_DIO_5_PORT PA4
142150

143151
// I2C Definitions
144-
#defineSDA 14 // Default for Arduino connector compatibility
145-
#defineSCL 15 // Default for Arduino connector compatibility
152+
#definePIN_WIRE_SDAPB9 // Default for Arduino connector compatibility
153+
#definePIN_WIRE_SCLPB8 // Default for Arduino connector compatibility
146154

147155
// Timer Definitions
148156
//Do not use timer used by PWM pins when possible. See PinMap_PWM in PeripheralPins.c
@@ -198,4 +206,4 @@ enum {
198206
#defineSERIAL_PORT_HARDWARE Serial
199207
#endif
200208

201-
#endif/* _VARIANT_ARDUINO_STM32_ */
209+
#endif/* _VARIANT_ARDUINO_STM32_ */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp