Skip to content

Commit c7123de

Browse files
committed
Allow access to the 8 analog inputs (VS 6 previously).
1 parent f1abf97 commit c7123de

File tree

2 files changed

+22
-19
lines changed

2 files changed

+22
-19
lines changed

variants/nRF52DK/variant.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,21 @@ const uint32_t g_ADigitalPinMap[] = {
3838
24,
3939
25,
4040

41-
// A0 - A5
41+
// A0 - A7
4242
3,
4343
4,
4444
28,
4545
29,
4646
30,
4747
31,
48+
5, // AIN3 (P0.05)
49+
2, // AIN0 (P0.02) / AREF
4850

4951
// SDA, SCL
5052
26,
5153
27,
5254

5355
// RX, TX
5456
8,
55-
6,
56-
57-
// AREF
58-
2
57+
6
5958
};

variants/nRF52DK/variant.h

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ extern "C"
3232
#endif // __cplusplus
3333

3434
// Number of pins defined in PinDescription array
35-
#define PINS_COUNT (25u)
35+
#define PINS_COUNT (26u)
3636
#define NUM_DIGITAL_PINS (20u)
37-
#define NUM_ANALOG_INPUTS (6u)
37+
#define NUM_ANALOG_INPUTS (8u)
3838
#define NUM_ANALOG_OUTPUTS (0u)
3939

4040
// LEDs
@@ -59,25 +59,29 @@ extern "C"
5959
#define PIN_A3 (17)
6060
#define PIN_A4 (18)
6161
#define PIN_A5 (19)
62-
63-
static const uint8_t A0 = PIN_A0 ;
64-
static const uint8_t A1 = PIN_A1 ;
65-
static const uint8_t A2 = PIN_A2 ;
66-
static const uint8_t A3 = PIN_A3 ;
67-
static const uint8_t A4 = PIN_A4 ;
68-
static const uint8_t A5 = PIN_A5 ;
62+
#define PIN_A6 (20) /* AIN3 (P0.05) */
63+
#define PIN_A7 (21) /* AIN0 (P0.02) / AREF */
64+
65+
static const uint8_t A0 = PIN_A0 ; // AIN1
66+
static const uint8_t A1 = PIN_A1 ; // AIN2
67+
static const uint8_t A2 = PIN_A2 ; // AIN4
68+
static const uint8_t A3 = PIN_A3 ; // AIN5
69+
static const uint8_t A4 = PIN_A4 ; // AIN6
70+
static const uint8_t A5 = PIN_A5 ; // AIN7
71+
static const uint8_t A6 = PIN_A6 ; // AIN3 (P0.05)
72+
static const uint8_t A7 = PIN_A7 ; // AIN0 (P0.02) / AREF
6973
#define ADC_RESOLUTION 14
7074

7175
// Other pins
72-
#define PIN_AREF (24)
76+
#define PIN_AREF (21)
7377
static const uint8_t AREF = PIN_AREF;
7478

7579
/*
7680
* Serial interfaces
7781
*/
7882
// Serial
79-
#define PIN_SERIAL_RX (22)
80-
#define PIN_SERIAL_TX (23)
83+
#define PIN_SERIAL_RX (24)
84+
#define PIN_SERIAL_TX (25)
8185

8286
/*
8387
* SPI Interfaces
@@ -98,8 +102,8 @@ static const uint8_t SCK = PIN_SPI_SCK ;
98102
*/
99103
#define WIRE_INTERFACES_COUNT 1
100104

101-
#define PIN_WIRE_SDA (20u)
102-
#define PIN_WIRE_SCL (21u)
105+
#define PIN_WIRE_SDA (22u)
106+
#define PIN_WIRE_SCL (23u)
103107

104108
#ifdef __cplusplus
105109
}

0 commit comments

Comments
 (0)