Skip to content

Commit 1598983

Browse files
committed
skr3: refine pins definitions
Former-commit-id: bbee287
1 parent 7ba2b79 commit 1598983

File tree

2 files changed

+36
-37
lines changed

2 files changed

+36
-37
lines changed

variants/MUXTO/pins_arduino.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ extern "C" unsigned int SCI_COUNT_fn();
1515
#define PINS_COUNT (PINCOUNT_fn())
1616
#define NUM_DIGITAL_PINS (22u)
1717
#define NUM_ANALOG_INPUTS (6u)
18-
#define NUM_ANALOG_OUTPUTS (1u)
18+
#define NUM_ANALOG_OUTPUTS (2u)
1919

2020
#define I2C_COUNT (I2C_COUNT_fn())
2121
#define SPI_COUNT (SPI_COUNT_fn())
@@ -126,13 +126,13 @@ static const uint8_t A6 = PIN_A6;
126126
#define UART2_RX_PIN 1
127127

128128
#define USB_VID (0x2341)
129-
#define USB_PID (0x0058)
129+
#define USB_PID (0x006C)
130130
#define USB_NAME "SCIENCE R3"
131131

132132
#define NO_1200_BPS_RESET 1
133133

134-
#define GPT_HOWMANY 7
135-
#define GTP32_HOWMANY 2
134+
#define GPT_HOWMANY 6
135+
#define GTP32_HOWMANY 1
136136
#define AGT_HOWMANY 2
137137

138138
/****** WIRE CORE DEFINES ******/
@@ -144,6 +144,8 @@ static const uint8_t A6 = PIN_A6;
144144
#define DAC (25u)
145145
#define DAC1 (26u)
146146

147+
#define IS_DAC_8(x) ((x == DAC) ? true : false)
148+
147149
// TODO: removeme
148150
#ifdef __cplusplus
149151
extern "C"

variants/MUXTO/variant.cpp

Lines changed: 30 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -70,39 +70,36 @@ std::array<uint16_t, 3> getPinCfgs(const pin_size_t pin, PinCfgReq_t req) {
7070
}
7171

7272
extern "C" const PinMuxCfg_t g_pin_cfg[] = {
73-
74-
{ BSP_IO_PORT_03_PIN_01, P301 }, /* (0) D0 ------------------------- DIGITAL */
75-
{ BSP_IO_PORT_03_PIN_02, P302 }, /* (1) D1 */
76-
{ BSP_IO_PORT_01_PIN_00, P100 }, /* (2) D2 */
77-
{ BSP_IO_PORT_00_PIN_00, P000 }, /* (3) D3~ */
78-
{ BSP_IO_PORT_00_PIN_14, P014 }, /* (4) D4 */
79-
{ BSP_IO_PORT_00_PIN_15, P015 }, /* (5) D5~ */
80-
{ BSP_IO_PORT_04_PIN_00, P400 }, /* (6) D6~ */
81-
{ BSP_IO_PORT_05_PIN_01, P501 }, /* (7) D8 */
82-
{ BSP_IO_PORT_04_PIN_01, P401 }, /* (8) D7 */
83-
{ BSP_IO_PORT_05_PIN_02, P502 }, /* (9) D9~ */
84-
{ BSP_IO_PORT_02_PIN_14, P214 }, /* (10) D11~ */
85-
{ BSP_IO_PORT_02_PIN_15, P215 }, /* (11) D10~ */
86-
{ BSP_IO_PORT_02_PIN_13, P213 }, /* (12) D12 */
87-
{ BSP_IO_PORT_02_PIN_12, P212 }, /* (13) D13 */
88-
{ BSP_IO_PORT_01_PIN_08, P108 }, /* (14) D14 */
89-
{ BSP_IO_PORT_03_PIN_00, P300 }, /* (15) D15 */
90-
{ BSP_IO_PORT_01_PIN_01, P101 }, /* (16) A0 D16 -------------------------- ANALOG */
91-
{ BSP_IO_PORT_01_PIN_02, P102 }, /* (17) A1 D17 */
92-
{ BSP_IO_PORT_01_PIN_03, P103 }, /* (18) A2 D18 */
93-
{ BSP_IO_PORT_01_PIN_04, P104 }, /* (19) A3 D19 */
94-
{ BSP_IO_PORT_04_PIN_08, P408 }, /* (20) A4 D20 */
95-
{ BSP_IO_PORT_04_PIN_09, P409 }, /* (21) A5 D21 */
96-
{ BSP_IO_PORT_01_PIN_05, P105 }, /* (22) A6 D22 */
97-
98-
{ BSP_IO_PORT_01_PIN_09, P109 }, /* (23) D23 ------------------------- TX */
99-
{ BSP_IO_PORT_01_PIN_10, P110 }, /* (24) D24 ------------------------- RX */
100-
{ BSP_IO_PORT_00_PIN_13, P013 }, /* (25) D25 ------------------------- DAC1 */
101-
{ BSP_IO_PORT_05_PIN_00, P500 }, /* (26) D26 ------------------------- DAC2 */
102-
{ BSP_IO_PORT_02_PIN_06, P206 }, /* (27) D27 */
103-
104-
105-
73+
74+
{ BSP_IO_PORT_03_PIN_01, P301 }, /* (0) D0 ------------------------- DIGITAL */
75+
{ BSP_IO_PORT_03_PIN_02, P302 }, /* (1) D1 */
76+
{ BSP_IO_PORT_01_PIN_00, P100 }, /* (2) D2 */
77+
{ BSP_IO_PORT_00_PIN_00, P000 }, /* (3) D3~ */
78+
{ BSP_IO_PORT_00_PIN_14, P014 }, /* (4) D4 */
79+
{ BSP_IO_PORT_00_PIN_15, P015 }, /* (5) D5~ */
80+
{ BSP_IO_PORT_04_PIN_00, P400 }, /* (6) D6~ */
81+
{ BSP_IO_PORT_05_PIN_01, P501 }, /* (7) D8 */
82+
{ BSP_IO_PORT_04_PIN_01, P401 }, /* (8) D7 */
83+
{ BSP_IO_PORT_05_PIN_02, P502 }, /* (9) D9~ */
84+
{ BSP_IO_PORT_02_PIN_14, P214 }, /* (10) D11~ */
85+
{ BSP_IO_PORT_02_PIN_15, P215 }, /* (11) D10~ */
86+
{ BSP_IO_PORT_02_PIN_13, P213 }, /* (12) D12 */
87+
{ BSP_IO_PORT_02_PIN_12, P212 }, /* (13) D13 */
88+
{ BSP_IO_PORT_01_PIN_08, P108 }, /* (14) D14 */
89+
{ BSP_IO_PORT_03_PIN_00, P300 }, /* (15) D15 */
90+
{ BSP_IO_PORT_01_PIN_01, P101 }, /* (16) A0 D16 -------------------------- ANALOG */
91+
{ BSP_IO_PORT_01_PIN_02, P102 }, /* (17) A1 D17 */
92+
{ BSP_IO_PORT_01_PIN_03, P103 }, /* (18) A2 D18 */
93+
{ BSP_IO_PORT_01_PIN_04, P104 }, /* (19) A3 D19 */
94+
{ BSP_IO_PORT_04_PIN_08, P408 }, /* (20) A4 D20 SDA */
95+
{ BSP_IO_PORT_04_PIN_09, P409 }, /* (21) A5 D21 SCL */
96+
{ BSP_IO_PORT_01_PIN_05, P105 }, /* (22) A6 D22 */
97+
98+
{ BSP_IO_PORT_01_PIN_09, P109 }, /* (23) D23 ------------------------- TX */
99+
{ BSP_IO_PORT_01_PIN_10, P110 }, /* (24) D24 ------------------------- RX */
100+
{ BSP_IO_PORT_00_PIN_13, P013 }, /* (25) D25 ------------------------- DAC8 */
101+
{ BSP_IO_PORT_05_PIN_00, P500 }, /* (26) D26 ------------------------- DAC12 */
102+
{ BSP_IO_PORT_02_PIN_06, P206 }, /* (27) D27 */
106103
};
107104

108105
extern "C" const size_t g_pin_cfg_size = sizeof(g_pin_cfg);

0 commit comments

Comments
 (0)