-
-
Notifications
You must be signed in to change notification settings - Fork 212
/
Copy pathpins_arduino.h
101 lines (77 loc) · 2.28 KB
/
pins_arduino.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#pragma once
#include <macros.h>
#include <stdint.h>
#ifndef __PINS_ARDUINO__
#define __PINS_ARDUINO__
#ifdef __cplusplus
extern "C" unsigned int PINCOUNT_fn();
#endif
// Pin count
// ----
#define PINS_COUNT (PINCOUNT_fn())
#define NUM_DIGITAL_PINS (30u)
#define NUM_ANALOG_INPUTS (4u)
#define NUM_ANALOG_OUTPUTS (0u)
extern PinName digitalPinToPinName(pin_size_t P);
// LEDs
// ----
#define PIN_LED (25u)
#define LED_BUILTIN PIN_LED
// Analog pins
// -----------
#define PIN_A0 (26u)
#define PIN_A1 (27u)
#define PIN_A2 (28u)
#define PIN_A3 (29u)
static const uint8_t A0 = PIN_A0;
static const uint8_t A1 = PIN_A1;
static const uint8_t A2 = PIN_A2;
static const uint8_t A3 = PIN_A3;
#define ADC_RESOLUTION 12
// Serial
#define PIN_SERIAL_TX (0ul)
#define PIN_SERIAL_RX (1ul)
// SPI
#ifndef PIN_SPI_MISO
#define PIN_SPI_MISO (16u)
#endif
#ifndef PIN_SPI_MOSI
#define PIN_SPI_MOSI (19u)
#endif
#ifndef PIN_SPI_SCK
#define PIN_SPI_SCK (18u)
#endif
#ifndef PIN_SPI_SS
#define PIN_SPI_SS (17u)
#endif
static const uint8_t SS = PIN_SPI_SS; // SPI Slave SS not used. Set here only for reference.
static const uint8_t MOSI = PIN_SPI_MOSI;
static const uint8_t MISO = PIN_SPI_MISO;
static const uint8_t SCK = PIN_SPI_SCK;
// Wire
#define PIN_WIRE_SDA (4u)
#define PIN_WIRE_SCL (5u)
#define SERIAL_HOWMANY 1
#define SERIAL1_TX (digitalPinToPinName(PIN_SERIAL_TX))
#define SERIAL1_RX (digitalPinToPinName(PIN_SERIAL_RX))
#define SERIAL_CDC 1
#define HAS_UNIQUE_ISERIAL_DESCRIPTOR
#define BOARD_VENDORID 0x2e8a
#define BOARD_PRODUCTID 0x00c0
#define BOARD_NAME "RaspberryPi Pico"
uint8_t getUniqueSerialNumber(uint8_t* name);
void _ontouch1200bps_();
#define SPI_HOWMANY (1)
#define SPI_MISO (digitalPinToPinName(PIN_SPI_MISO))
#define SPI_MOSI (digitalPinToPinName(PIN_SPI_MOSI))
#define SPI_SCK (digitalPinToPinName(PIN_SPI_SCK))
#define WIRE_HOWMANY (1)
#define I2C_SDA (digitalPinToPinName(PIN_WIRE_SDA))
#define I2C_SCL (digitalPinToPinName(PIN_WIRE_SCL))
#define digitalPinToPort(P) (digitalPinToPinName(P)/32)
#define SERIAL_PORT_USBVIRTUAL SerialUSB
#define SERIAL_PORT_MONITOR SerialUSB
#define SERIAL_PORT_HARDWARE Serial1
#define SERIAL_PORT_HARDWARE_OPEN Serial1
#define USB_MAX_POWER (500)
#endif //__PINS_ARDUINO__