Skip to content

Commit 18a4226

Browse files
committed
chore: Enable Cygnet Voltage Detection
1 parent 0ea09d8 commit 18a4226

File tree

2 files changed

+45
-44
lines changed

2 files changed

+45
-44
lines changed

variants/STM32L4xx/L433C(B-C)(T-U)_L443CC(T-U)/variant_CYGNET.cpp

+7-6
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,13 @@ const PinName digitalPin[] = {
5656

5757
// Analog (Ax) to digital pin number array
5858
const uint32_t analogInputPin[] = {
59-
0, // A0, PA0
60-
1, // A1, PA1
61-
2, // A2, PA2
62-
3, // A3, PA3
63-
4, // A4, PB1
64-
16 // A5, PA7
59+
0, // PA0, A0
60+
1, // PA1, A1
61+
2, // PA2, A2
62+
3, // PA3, A3
63+
4, // PB1, A4
64+
16, // PA7, A5
65+
7 // PA4, BAT_VOLTAGE
6566
};
6667

6768
// ----------------------------------------------------------------------------

variants/STM32L4xx/L433C(B-C)(T-U)_L443CC(T-U)/variant_CYGNET.h

+38-38
Original file line numberDiff line numberDiff line change
@@ -18,45 +18,45 @@
1818
* function I can see is to reference a pin in a sketch in something
1919
* like digitalWrite() and have it index into digitalPin[] to find the
2020
* actual pin. On the other hand, PIN_A* are numbers offset by PNUM_ANALOG_BASE,
21-
* which serves to say that this IS an analog pin and which tells analogWrite
21+
* which serves to say that this IS an analog pin and which tells analogWrite
2222
* to index into the digitalPin[] array to find the actual pin.
2323
*----------------------------------------------------------------------------*/
24-
#define PA0 PIN_A0 // A0/D0
25-
#define PA1 PIN_A1 // A1/D1
26-
#define PA2 PIN_A2 // A2/D2
27-
#define PA3 PIN_A3 // A3/D3
28-
#define PB1 PIN_A4 // A4/D4
29-
#define PB8 5 // D5
30-
#define PB9 6 // D6
31-
#define PA4 7 // BAT_VOLTAGE
32-
#define PA8 8 // LED_BUILTIN
33-
#define PB14 9 // D9
34-
#define PB13 10 // D10
35-
#define PB0 11 // D11
36-
#define PB15 12 // D12
37-
#define PB4 13 // D13
38-
#define PA5 14 // CK
39-
#define PA6 15 // MI
40-
#define PA7 PIN_A5 // A5
41-
#define PA9 17 // TX
42-
#define PA10 18 // RX
43-
#define PA11 19 // USB_DM
44-
#define PA12 20 // USB_DP
45-
#define PA13 21 // SWDIO
46-
#define PA14 22 // SWCLK
47-
#define PA15 23 // CHARGE_DETECT
48-
#define PB3 24 // USER_BTN
49-
#define PB5 25 // MO
50-
#define PB6 26 // SCL
51-
#define PB7 27 // SDA
52-
#define PB10 28 // LPUART1_VCP_RX
53-
#define PB11 29 // LPUART1_VCP_TX
54-
#define PC13 30 // USB_DETECT
55-
#define PC14 31 // OSC32_IN
56-
#define PC15 32 // OSC32_OUT
57-
#define PH0 33 // ENABLE_3V3
58-
#define PH1 34 // DISCHARGE_3V3
59-
#define PH3 35 // B
24+
#define PA0 PIN_A0 // A0/D0
25+
#define PA1 PIN_A1 // A1/D1
26+
#define PA2 PIN_A2 // A2/D2
27+
#define PA3 PIN_A3 // A3/D3
28+
#define PB1 PIN_A4 // A4/D4
29+
#define PB8 5 // D5
30+
#define PB9 6 // D6
31+
#define PA4 PIN_A6 // BAT_VOLTAGE
32+
#define PA8 8 // LED_BUILTIN
33+
#define PB14 9 // D9
34+
#define PB13 10 // D10
35+
#define PB0 11 // D11
36+
#define PB15 12 // D12
37+
#define PB4 13 // D13
38+
#define PA5 14 // CK
39+
#define PA6 15 // MI
40+
#define PA7 PIN_A5 // A5
41+
#define PA9 17 // TX
42+
#define PA10 18 // RX
43+
#define PA11 19 // USB_DM
44+
#define PA12 20 // USB_DP
45+
#define PA13 21 // SWDIO
46+
#define PA14 22 // SWCLK
47+
#define PA15 23 // CHARGE_DETECT
48+
#define PB3 24 // USER_BTN
49+
#define PB5 25 // MO
50+
#define PB6 26 // SCL
51+
#define PB7 27 // SDA
52+
#define PB10 28 // LPUART1_VCP_RX
53+
#define PB11 29 // LPUART1_VCP_TX
54+
#define PC13 30 // USB_DETECT
55+
#define PC14 31 // OSC32_IN
56+
#define PC15 32 // OSC32_OUT
57+
#define PH0 33 // ENABLE_3V3
58+
#define PH1 34 // DISCHARGE_3V3
59+
#define PH3 35 // B
6060

6161
// Alternate pins number
6262
#define PA1_ALT1 (PA1 | ALT1)
@@ -74,7 +74,7 @@
7474
#define PB15_ALT1 (PB15 | ALT1)
7575

7676
#define NUM_DIGITAL_PINS 36
77-
#define NUM_ANALOG_INPUTS 6
77+
#define NUM_ANALOG_INPUTS 7
7878

7979
// On-board LED pin number
8080
#ifndef LED_BUILTIN

0 commit comments

Comments
 (0)