1- #pragma once
2- #include <macros.h>
3- #include "PeripheralPins.h"
4-
5- #ifndef __PINS_ARDUINO__
6- #define __PINS_ARDUINO__
7-
8- #ifdef __cplusplus
9- extern "C" unsigned int PINCOUNT_fn ();
10- extern "C" bool isBetaBoard ();
1+ #if defined(PORTENTA_H7_PINS )
2+ #include "../PORTENTA_H7_M7/pins_arduino.h"
3+ #elif defined(OPTA_PINS )
4+ #include "../OPTA/pins_arduino.h"
5+ #elif defined(NVISION_PINS )
6+ #include "../NICLA_VSION/pins_arduino.h"
7+ #elif defined(GIGA_PINS )
8+ #include "../GIGA/pins_arduino.h"
119#endif
12- #define PINS_COUNT (PINCOUNT_fn())
13- #define NUM_DIGITAL_PINS (22u)
14- #define NUM_ANALOG_INPUTS (7u)
15- #define NUM_ANALOG_OUTPUTS (1u)
16-
17- extern PinName digitalPinToPinName (pin_size_t P );
18-
19- // LEDs
20- // ----
21- #define PIN_LED (24u)
22- #define LED_BUILTIN PIN_LED
23- #define LEDR (23u)
24- #define LEDG (24u)
25- #define LEDB (25u)
26-
27- // Analog pins
28- // -----------
29- #define PIN_A0 (15u)
30- #define PIN_A1 (16u)
31- #define PIN_A2 (17u)
32- #define PIN_A3 (18u)
33- #define PIN_A4 (19u)
34- #define PIN_A5 (20u)
35- #define PIN_A6 (21u)
36- #define PIN_A7 (22u)
37-
38- static const uint8_t A0 = PIN_A0 ;
39- static const uint8_t A1 = PIN_A1 ;
40- static const uint8_t A2 = PIN_A2 ;
41- static const uint8_t A3 = PIN_A3 ;
42- static const uint8_t A4 = PIN_A4 ;
43- static const uint8_t A5 = PIN_A5 ;
44- static const uint8_t A6 = PIN_A6 ;
45- static const uint8_t A7 = PIN_A7 ;
46- #define ADC_RESOLUTION 12
47-
48- // Digital pins
49- // -----------
50- #define D0 (0u)
51- #define D1 (1u)
52- #define D2 (2u)
53- #define D3 (3u)
54- #define D4 (4u)
55- #define D5 (5u)
56- #define D6 (6u)
57- #define D7 (7u)
58- #define D8 (8u)
59- #define D9 (9u)
60- #define D10 (10u)
61- #define D11 (11u)
62- #define D12 (12u)
63- #define D13 (13u)
64- #define D14 (14u)
65- #define D15 (15u)
66- #define D16 (u16)
67- #define D17 (u17)
68- #define D18 (u18)
69- #define D19 (u19)
70- #define D20 (u20)
71- #define D21 (u21)
72-
73- //DACs
74- #define DAC A6
75-
76- // Serial
77- #define PIN_SERIAL_RX (13ul)
78- #define PIN_SERIAL_TX (14ul)
79-
80- // SPI
81- #define PIN_SPI_MISO (10u)
82- #define PIN_SPI_MOSI (8u)
83- #define PIN_SPI_SCK (9u)
84- #define PIN_SPI_SS (7u)
85-
86- static const uint8_t SS = PIN_SPI_SS ; // SPI Slave SS not used. Set here only for reference.
87- static const uint8_t MOSI = PIN_SPI_MOSI ;
88- static const uint8_t MISO = PIN_SPI_MISO ;
89- static const uint8_t SCK = PIN_SPI_SCK ;
90-
91- // Wire
92- #define PIN_WIRE_SDA (11u)
93- #define PIN_WIRE_SCL (12u)
94-
95- #define SerialHCI UART2
96-
97- #define SERIAL_HOWMANY 2
98-
99- #define SERIAL2_TX PA_15
100- #define SERIAL2_RX PF_6
101- #define SERIAL2_RTS PF_8
102- #define SERIAL2_CTS PF_9
103-
104- #define SERIAL1_TX (digitalPinToPinName(PIN_SERIAL_TX))
105- #define SERIAL1_RX (digitalPinToPinName(PIN_SERIAL_RX))
106-
107- //#define SERIAL_CDC 1
108- #define HAS_UNIQUE_ISERIAL_DESCRIPTOR
109- #define BOARD_VENDORID 0x2341
110- #define BOARD_PRODUCTID 0x025b
111- #define BOARD_NAME "Envie M4"
112-
113- #define DFU_MAGIC_SERIAL_ONLY_RESET 0xb0
114-
115- uint8_t getUniqueSerialNumber (uint8_t * name );
116- void _ontouch1200bps_ ();
117-
118- #define WIRE_HOWMANY 3
119-
120- #define I2C_SDA (digitalPinToPinName(PIN_WIRE_SDA))
121- #define I2C_SCL (digitalPinToPinName(PIN_WIRE_SCL))
122-
123- #define I2C_SDA_INTERNAL (PB_7)
124- #define I2C_SCL_INTERNAL (PB_6)
125- #define I2C_SDA1 I2C_SDA_INTERNAL
126- #define I2C_SCL1 I2C_SCL_INTERNAL
127- #define I2C_SDA2 (PH_12)
128- #define I2C_SCL2 (PH_11)
129-
130- #define SPI_HOWMANY 1
131-
132- #define SPI_MISO (digitalPinToPinName(PIN_SPI_MISO))
133- #define SPI_MOSI (digitalPinToPinName(PIN_SPI_MOSI))
134- #define SPI_SCK (digitalPinToPinName(PIN_SPI_SCK))
135-
136- #define digitalPinToPort (P ) (digitalPinToPinName(P)/16)
137-
138- #define SERIAL_PORT_USBVIRTUAL Serial
139- #define SERIAL_PORT_MONITOR Serial
140- #define SERIAL_PORT_HARDWARE Serial
141- #define SERIAL_PORT_HARDWARE_OPEN Serial1
142-
143- #define CRYPTO_WIRE Wire1
14410
145- #endif //__PINS_ARDUINO__
11+ #undef SERIAL_CDC
0 commit comments