@@ -25,24 +25,27 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2525
2626#ifndef _BREAKOUT_CARRIER_H
2727#define _BREAKOUT_CARRIER_H
28+
2829#include " Arduino.h"
30+ #include " pins_arduino.h"
2931#include " mbed.h"
30- #define PK_7_pox LEDB
32+
33+ #define LAST_ARDUINO_PIN_NUMBER LEDB + 1
3134typedef enum {
3235 SPI0_CS = -1 ,
3336 SPI0_CK = -1 ,
3437 SPI0_MISO = -1 ,
3538 SPI0_MOSI = -1 ,
36- SPI1_CS = PK_7_pox + 129 ,
37- SPI1_CK = PK_7_pox + 130 ,
38- SPI1_MISO = PK_7_pox + 35 ,
39- SPI1_MOSI = PK_7_pox + 36 ,
40- UART2_TX = PK_7_pox + 111 ,
41- UART2_RX = PK_7_pox+ 106 ,
39+ SPI1_CS = LAST_ARDUINO_PIN_NUMBER + PI_0 ,
40+ SPI1_CK = LAST_ARDUINO_PIN_NUMBER + PI_1 ,
41+ SPI1_MISO = LAST_ARDUINO_PIN_NUMBER + PC_2 ,
42+ SPI1_MOSI = LAST_ARDUINO_PIN_NUMBER + PC_3 ,
43+ UART2_TX = LAST_ARDUINO_PIN_NUMBER + PG_14 ,
44+ UART2_RX = LAST_ARDUINO_PIN_NUMBER + PG_9 ,
4245 UART2_RTS = -1 ,
4346 UART2_CTS = -1 ,
44- UART3_TX = PK_7_pox + 153 ,
45- UART3_RX = PK_7_pox + 154 ,
47+ UART3_TX = LAST_ARDUINO_PIN_NUMBER + PJ_8 ,
48+ UART3_RX = LAST_ARDUINO_PIN_NUMBER + PJ_9 ,
4649 UART3_RTS = -1 ,
4750 UART3_CTS = -1 ,
4851 PCIE_TXN = -1 ,
@@ -51,44 +54,44 @@ typedef enum {
5154 PCIE_RXP = -1 ,
5255 PCIE_CKN = -1 ,
5356 PCIE_CKP = -1 ,
54- I2S_SDO = PK_7_pox + 132 ,
55- I2S_SDI = PK_7_pox + 131 ,
56- I2S_WS = PK_7_pox + 26 ,
57- I2S_CK = PK_7_pox + 52 ,
57+ I2S_SDO = LAST_ARDUINO_PIN_NUMBER + PI_3 ,
58+ I2S_SDI = LAST_ARDUINO_PIN_NUMBER + PI_2 ,
59+ I2S_WS = LAST_ARDUINO_PIN_NUMBER + PB_9 ,
60+ I2S_CK = LAST_ARDUINO_PIN_NUMBER + PD_3 ,
5861 SAI_D1 = -1 ,
59- SAI_D0 = PK_7_pox + 135 ,
60- SAI_FS = PK_7_pox + 136 ,
61- SAI_SCK = PK_7_pox + 134 ,
62- CAMERA_D0P = PK_7_pox + 123 ,
63- CAMERA_D0N = PK_7_pox + 122 ,
64- CAMERA_D1P = PK_7_pox + 125 ,
65- CAMERA_D1N = PK_7_pox + 124 ,
66- CAMERA_D2P = PK_7_pox + 133 ,
67- CAMERA_D2N = PK_7_pox + 127 ,
68- CAMERA_D3P = PK_7_pox + 136 ,
69- CAMERA_D3N = PK_7_pox + 135 ,
70- CAMERA_CKP = PK_7_pox + 134 ,
71- CAMERA_CKN = PK_7_pox + 7 ,
72- CAMERA_HS = PK_7_pox + 5 ,
62+ SAI_D0 = LAST_ARDUINO_PIN_NUMBER + PI_6 ,
63+ SAI_FS = LAST_ARDUINO_PIN_NUMBER + PI_7 ,
64+ SAI_SCK = LAST_ARDUINO_PIN_NUMBER + PI_5 ,
65+ CAMERA_D0P = LAST_ARDUINO_PIN_NUMBER + PH_10 ,
66+ CAMERA_D0N = LAST_ARDUINO_PIN_NUMBER + PH_9 ,
67+ CAMERA_D1P = LAST_ARDUINO_PIN_NUMBER + PH_12 ,
68+ CAMERA_D1N = LAST_ARDUINO_PIN_NUMBER + PH_11 ,
69+ CAMERA_D2P = LAST_ARDUINO_PIN_NUMBER + PI_4 ,
70+ CAMERA_D2N = LAST_ARDUINO_PIN_NUMBER + PH_14 ,
71+ CAMERA_D3P = LAST_ARDUINO_PIN_NUMBER + PI_7 ,
72+ CAMERA_D3N = LAST_ARDUINO_PIN_NUMBER + PI_6 ,
73+ CAMERA_CKP = LAST_ARDUINO_PIN_NUMBER + PI_5 ,
74+ CAMERA_CKN = LAST_ARDUINO_PIN_NUMBER + PA_6 ,
75+ CAMERA_HS = LAST_ARDUINO_PIN_NUMBER + PA_4 ,
7376 PDM_D1 = -1 ,
74- PDM_D0 = PK_7_pox + 19 ,
75- PDM_CK = PK_7_pox + 67 ,
77+ PDM_D0 = LAST_ARDUINO_PIN_NUMBER + PB_2 ,
78+ PDM_CK = LAST_ARDUINO_PIN_NUMBER + PE_2 ,
7679 SPDIF_RX = -1 ,
7780 SPDIF_TX= -1 ,
78- USBHS_ID = PK_7_pox + 151 ,
81+ USBHS_ID = LAST_ARDUINO_PIN_NUMBER + PJ_6 ,
7982 USBHS_DN = -1 ,
8083 USBHS_DP = -1 ,
8184 USBFS_ID = -1 ,
82- USBFS_DN = PK_7_pox + 13 ,
83- USBFS_DP = PK_7_pox + 12 ,
85+ USBFS_DN = LAST_ARDUINO_PIN_NUMBER + PA_12 ,
86+ USBFS_DP = LAST_ARDUINO_PIN_NUMBER + PA_11 ,
8487 SD_WP = -1 ,
8588 SD_CD = -1 ,
86- SD_D0 = PK_7_pox + 31 ,
87- SD_D3 = PK_7_pox + 21 ,
88- SD_CMD = PK_7_pox + 56 ,
89- SD_D2 = PK_7_pox + 20 ,
90- SD_CLK = PK_7_pox + 55 ,
91- SD_D1 = PK_7_pox + 32 ,
89+ SD_D0 = LAST_ARDUINO_PIN_NUMBER + PB_14 ,
90+ SD_D3 = LAST_ARDUINO_PIN_NUMBER + PB_4 ,
91+ SD_CMD = LAST_ARDUINO_PIN_NUMBER + PD_7 ,
92+ SD_D2 = LAST_ARDUINO_PIN_NUMBER + PB_3 ,
93+ SD_CLK = LAST_ARDUINO_PIN_NUMBER + PD_6 ,
94+ SD_D1 = LAST_ARDUINO_PIN_NUMBER + PB_15 ,
9295 SD_VSD = -1 ,
9396 ETHERNET_DP = -1 ,
9497 ETHERNET_DN = -1 ,
@@ -100,14 +103,14 @@ typedef enum {
100103 ETHERNET_AP = -1 ,
101104 ETHERNET_L2 = -1 ,
102105 ETHERNET_L1 = -1 ,
103- UART0_TX = PK_7_pox + 1 ,
104- UART0_RX = PK_7_pox + 138 ,
105- UART0_RTS = PK_7_pox + 139 ,
106- UART0_CTS = PK_7_pox + 142 ,
107- UART1_TX = PK_7_pox + 10 ,
108- UART1_RX = PK_7_pox + 11 ,
109- UART1_RTS = PK_7_pox + 143 ,
110- UART1_CTS = PK_7_pox + 144 ,
106+ UART0_TX = LAST_ARDUINO_PIN_NUMBER + PA_0 ,
107+ UART0_RX = LAST_ARDUINO_PIN_NUMBER + PI_9 ,
108+ UART0_RTS = LAST_ARDUINO_PIN_NUMBER + PI_10 ,
109+ UART0_CTS = LAST_ARDUINO_PIN_NUMBER + PI_13 ,
110+ UART1_TX = LAST_ARDUINO_PIN_NUMBER + PA_9 ,
111+ UART1_RX = LAST_ARDUINO_PIN_NUMBER + PA_10 ,
112+ UART1_RTS = LAST_ARDUINO_PIN_NUMBER + PI_14 ,
113+ UART1_CTS = LAST_ARDUINO_PIN_NUMBER + PI_15 ,
111114 DISPLAY_D3P = -1 ,
112115 DISPLAY_D3N = -1 ,
113116 DISPLAY_D2P = -1 ,
@@ -120,75 +123,68 @@ typedef enum {
120123 DISPLAY_CLK_N = -1 ,
121124 CAN0_TX = -1 ,
122125 CAN0_RX = -1 ,
123- CAN1_TX = PK_7_pox + 126 ,
124- CAN1_RX = PK_7_pox + 25 ,
125- I2C_SDA_1 = PK_7_pox + 24 ,
126- I2C_SCL_1 = PK_7_pox + 23 ,
127- I2C_SDA_0 = PK_7_pox + 121 ,
128- I2C_SCL_0 = PK_7_pox + 120 ,
129- I2C_SDA_2 = PK_7_pox + 125 ,
130- I2C_SCL_2 = PK_7_pox + 124 ,
131- GPIO_0 = PK_7_pox + 46 ,
132- GPIO_1 = PK_7_pox + 48 ,
133- GPIO_2 = PK_7_pox + 53 ,
134- GPIO_3 = PK_7_pox + 54 ,
135- GPIO_4 = PK_7_pox + 68 ,
136- GPIO_5 = PK_7_pox + 100 ,
137- GPIO_6 = PK_7_pox + 107 ,
126+ CAN1_TX = LAST_ARDUINO_PIN_NUMBER + PH_13 ,
127+ CAN1_RX = LAST_ARDUINO_PIN_NUMBER + PB_8 ,
128+ I2C_SDA_1 = LAST_ARDUINO_PIN_NUMBER + PB_7 ,
129+ I2C_SCL_1 = LAST_ARDUINO_PIN_NUMBER + PB_6 ,
130+ I2C_SDA_0 = LAST_ARDUINO_PIN_NUMBER + PH_8 ,
131+ I2C_SCL_0 = LAST_ARDUINO_PIN_NUMBER + PH_7 ,
132+ I2C_SDA_2 = LAST_ARDUINO_PIN_NUMBER + PH_12 ,
133+ I2C_SCL_2 = LAST_ARDUINO_PIN_NUMBER + PH_11 ,
134+ GPIO_0 = LAST_ARDUINO_PIN_NUMBER + PC_13 ,
135+ GPIO_1 = LAST_ARDUINO_PIN_NUMBER + PC_15 ,
136+ GPIO_2 = LAST_ARDUINO_PIN_NUMBER + PD_4 ,
137+ GPIO_3 = LAST_ARDUINO_PIN_NUMBER + PD_5 ,
138+ GPIO_4 = LAST_ARDUINO_PIN_NUMBER + PE_3 ,
139+ GPIO_5 = LAST_ARDUINO_PIN_NUMBER + PG_3 ,
140+ GPIO_6 = LAST_ARDUINO_PIN_NUMBER + PG_10 ,
138141 ANALOG_REFN = -1 ,
139142 ANALOG_REFP = -1 ,
140- ANALOG_A7 = PK_7_pox + 7 ,
141- ANALOG_A6 = PK_7_pox + 5 ,
142- ANALOG_A5 = PK_7_pox + 36 ,
143- ANALOG_A4 = PK_7_pox + 35 ,
144- ANALOG_A3 = PK_7_pox + 36 ,
145- ANALOG_A2 = PK_7_pox + 35 ,
146- ANALOG_A1 = PK_7_pox + 2 ,
147- ANALOG_A0 = PK_7_pox + 1 ,
148- PWM9 = PK_7_pox + 119 ,
149- PWM8 = PK_7_pox + 155 ,
150- PWM7 = PK_7_pox + 152 ,
151- PWM6 = PK_7_pox + 128 ,
152- PWM5 = PK_7_pox + 162 ,
153- PWM4 = PK_7_pox + 156 ,
154- PWM3 = PK_7_pox + 104 ,
155- PWM2 = PK_7_pox + 39 ,
156- PWM1 = PK_7_pox + 38 ,
157- PWM0 = PK_7_pox + 9 ,
143+ ANALOG_A7 = LAST_ARDUINO_PIN_NUMBER + PA_6 ,
144+ ANALOG_A6 = LAST_ARDUINO_PIN_NUMBER + PA_4 ,
145+ ANALOG_A5 = LAST_ARDUINO_PIN_NUMBER + PC_3 ,
146+ ANALOG_A4 = LAST_ARDUINO_PIN_NUMBER + PC_2 ,
147+ ANALOG_A3 = LAST_ARDUINO_PIN_NUMBER + PC_3 ,
148+ ANALOG_A2 = LAST_ARDUINO_PIN_NUMBER + PC_2 ,
149+ ANALOG_A1 = LAST_ARDUINO_PIN_NUMBER + PA_1 ,
150+ ANALOG_A0 = LAST_ARDUINO_PIN_NUMBER + PA_0 ,
151+ PWM9 = LAST_ARDUINO_PIN_NUMBER + PH_6 ,
152+ PWM8 = LAST_ARDUINO_PIN_NUMBER + PJ_10 ,
153+ PWM7 = LAST_ARDUINO_PIN_NUMBER + PJ_7 ,
154+ PWM6 = LAST_ARDUINO_PIN_NUMBER + PH_15 ,
155+ PWM5 = LAST_ARDUINO_PIN_NUMBER + PK_1 ,
156+ PWM4 = LAST_ARDUINO_PIN_NUMBER + PJ_11 ,
157+ PWM3 = LAST_ARDUINO_PIN_NUMBER + PG_7 ,
158+ PWM2 = LAST_ARDUINO_PIN_NUMBER + PC_7 ,
159+ PWM1 = LAST_ARDUINO_PIN_NUMBER + PC_6 ,
160+ PWM0 = LAST_ARDUINO_PIN_NUMBER + PA_8 ,
158161 TRST = -1 ,
159- TRACEDATA_0 = PK_7_pox + 68 ,
160- TRACEDATA_1 = PK_7_pox + 111 ,
161- TRACEDATA_CLK = PK_7_pox + 67 ,
162+ TRACEDATA_0 = LAST_ARDUINO_PIN_NUMBER + PE_3 ,
163+ TRACEDATA_1 = LAST_ARDUINO_PIN_NUMBER + PG_14 ,
164+ TRACEDATA_CLK = LAST_ARDUINO_PIN_NUMBER + PE_2 ,
162165 USB_FLAG = -1 ,
163166 USB_EN = -1
164- };
167+ } breakoutPin ;
165168
166169class BreakoutCarrierClass {
167170public:
168- pin_size_t getPin (int pin) {
169- if (pin > -1 ) {
170- return digitalPinToPinName (pin);
171- }
172- return 0 ;
173- }
174-
175- int setPinMode (int pin, PinMode mode) {
171+ int pinMode (breakoutPin pin, PinMode mode) {
176172 if (pin > -1 ) {
177- pinMode (digitalPinToPinName (pin) , mode);
173+ :: pinMode (( int )pin , mode);
178174 return 1 ;
179175 }
180176 return -1 ;
181177 }
182- int GPIOWrite ( int pin, PinStatus status) {
178+ int digitalWrite (breakoutPin pin, PinStatus status) {
183179 if (pin > -1 ) {
184- digitalWrite (digitalPinToPinName (pin) , status);
180+ :: digitalWrite (( int )pin , status);
185181 return 1 ;
186182 }
187183 return -1 ;
188184 }
189- bool GPIORead ( int pin){
190- if (pin > -1 ) {
191- return digitalRead (digitalPinToPinName (pin) );
185+ bool digitalRead (breakoutPin pin){
186+ if (pin > -1 ) {
187+ return :: digitalRead (( int )pin );
192188 }
193189 return -1 ;
194190 }
0 commit comments