|
| 1 | +/* |
| 2 | + ******************************************************************************* |
| 3 | + * Copyright (c) 2021, STMicroelectronics |
| 4 | + * All rights reserved. |
| 5 | + * |
| 6 | + * This software component is licensed by ST under BSD 3-Clause license, |
| 7 | + * the "License"; You may not use this file except in compliance with the |
| 8 | + * License. You may obtain a copy of the License at: |
| 9 | + * opensource.org/licenses/BSD-3-Clause |
| 10 | + * |
| 11 | + ******************************************************************************* |
| 12 | + */ |
| 13 | +#pragma once |
| 14 | + |
| 15 | +/*---------------------------------------------------------------------------- |
| 16 | + * STM32 pins number |
| 17 | + *----------------------------------------------------------------------------*/ |
| 18 | +#define PC5 PIN_A10 |
| 19 | +#define PC4 PIN_A11 |
| 20 | +#define PA10 2 |
| 21 | +#define PB3 3 |
| 22 | +#define PB5 4 |
| 23 | +#define PB4 5 |
| 24 | +#define PB14 6 |
| 25 | +#define PA8 7 |
| 26 | +#define PA9 8 |
| 27 | +#define PC7 9 |
| 28 | +#define PB0 PIN_A12 |
| 29 | +#define PA7 PIN_A6 |
| 30 | +#define PA6 PIN_A7 |
| 31 | +#define PA5 PIN_A13 // LED |
| 32 | +#define PB9 14 |
| 33 | +#define PB8 15 |
| 34 | +// ST Morpho |
| 35 | +// CN7 Left Side |
| 36 | +#define PC10 16 |
| 37 | +#define PC12 17 |
| 38 | +#define PA14 18 // SWD |
| 39 | +#define PD0 19 |
| 40 | +#define PD3 20 |
| 41 | +#define PA13 21 // SWD |
| 42 | +#define PD4 22 |
| 43 | +#define PA15 23 |
| 44 | +#define PB7 24 |
| 45 | +#define PC13 25 |
| 46 | +#define PC14 26 |
| 47 | +#define PC15 27 |
| 48 | +#define PF0 28 |
| 49 | +#define PF1 29 |
| 50 | +#define PC2 30 |
| 51 | +#define PC3 31 |
| 52 | +// CN7 Right Side |
| 53 | +#define PC11 32 |
| 54 | +#define PD2 33 |
| 55 | +#define PD1 34 |
| 56 | +#define PD5 35 |
| 57 | +// CN10 Left Side |
| 58 | +#define PC9 36 |
| 59 | +// CN10 Right side |
| 60 | +#define PC8 37 |
| 61 | +#define PC6 38 |
| 62 | +#define PA3 PIN_A14 |
| 63 | +#define PD6 40 |
| 64 | +#define PA12 41 |
| 65 | +#define PA11 42 |
| 66 | +#define PC1 43 |
| 67 | +#define PC0 44 |
| 68 | +#define PB2 PIN_A8 |
| 69 | +#define PB6 46 |
| 70 | +#define PB15 47 |
| 71 | +#define PB10 PIN_A9 |
| 72 | +#define PB13 49 |
| 73 | +#define PA2 PIN_A15 |
| 74 | +#define PD8 51 |
| 75 | +#define PD9 52 |
| 76 | +#define PA0 PIN_A0 |
| 77 | +#define PA1 PIN_A1 |
| 78 | +#define PA4 PIN_A2 |
| 79 | +#define PB1 PIN_A3 |
| 80 | +#define PB11 PIN_A4 |
| 81 | +#define PB12 PIN_A5 |
| 82 | +#define PF2 59 |
| 83 | +#define PA9_R 60 |
| 84 | +#define PA10_R 61 |
| 85 | + |
| 86 | +// Alternate pins number |
| 87 | +#define PA1_ALT1 (PA1 | ALT1) |
| 88 | +#define PA2_ALT1 (PA2 | ALT1) |
| 89 | +#define PA3_ALT1 (PA3 | ALT1) |
| 90 | +#define PA4_ALT1 (PA4 | ALT1) |
| 91 | +#define PA6_ALT1 (PA6 | ALT1) |
| 92 | +#define PA6_ALT2 (PA6 | ALT2) |
| 93 | +#define PA7_ALT1 (PA7 | ALT1) |
| 94 | +#define PA7_ALT2 (PA7 | ALT2) |
| 95 | +#define PA7_ALT3 (PA7 | ALT3) |
| 96 | +#define PA9_ALT1 (PA9 | ALT1) |
| 97 | +#define PA9_R_ALT1 (PA9_R | ALT1) |
| 98 | +#define PA10_ALT1 (PA10 | ALT1) |
| 99 | +#define PA10_R_ALT1 (PA10_R | ALT1) |
| 100 | +#define PA14_ALT1 (PA14 | ALT1) |
| 101 | +#define PA15_ALT1 (PA15 | ALT1) |
| 102 | +#define PB0_ALT1 (PB0 | ALT1) |
| 103 | +#define PB1_ALT1 (PB1 | ALT1) |
| 104 | +#define PB1_ALT2 (PB1 | ALT2) |
| 105 | +#define PB3_ALT1 (PB3 | ALT1) |
| 106 | +#define PB4_ALT1 (PB4 | ALT1) |
| 107 | +#define PB5_ALT1 (PB5 | ALT1) |
| 108 | +#define PB6_ALT1 (PB6 | ALT1) |
| 109 | +#define PB6_ALT2 (PB6 | ALT2) |
| 110 | +#define PB7_ALT1 (PB7 | ALT1) |
| 111 | +#define PB8_ALT1 (PB8 | ALT1) |
| 112 | +#define PB9_ALT1 (PB9 | ALT1) |
| 113 | +#define PB13_ALT1 (PB13 | ALT1) |
| 114 | +#define PB14_ALT1 (PB14 | ALT1) |
| 115 | +#define PB15_ALT1 (PB15 | ALT1) |
| 116 | +#define PB15_ALT2 (PB15 | ALT2) |
| 117 | +#define PC0_ALT1 (PC0 | ALT1) |
| 118 | +#define PC1_ALT1 (PC1 | ALT1) |
| 119 | +#define PC4_ALT1 (PC4 | ALT1) |
| 120 | +#define PC5_ALT1 (PC5 | ALT1) |
| 121 | +#define PC6_ALT1 (PC6 | ALT1) |
| 122 | +#define PC7_ALT1 (PC7 | ALT1) |
| 123 | +#define PC8_ALT1 (PC8 | ALT1) |
| 124 | +#define PC9_ALT1 (PC9 | ALT1) |
| 125 | +#define PC10_ALT1 (PC10 | ALT1) |
| 126 | +#define PC11_ALT1 (PC11 | ALT1) |
| 127 | +#define PD4_ALT1 (PD4 | ALT1) |
| 128 | + |
| 129 | +#define NUM_DIGITAL_PINS 62 |
| 130 | +#define NUM_REMAP_PINS 2 |
| 131 | +#define NUM_ANALOG_INPUTS 16 |
| 132 | + |
| 133 | +// On-board LED pin number |
| 134 | +#ifndef LED_BUILTIN |
| 135 | + #define LED_BUILTIN PA5 |
| 136 | +#endif |
| 137 | +#define LED_GREEN LED_BUILTIN |
| 138 | + |
| 139 | +// On-board user button |
| 140 | +#ifndef USER_BTN |
| 141 | + #define USER_BTN PC13 |
| 142 | +#endif |
| 143 | + |
| 144 | +// Timer Definitions |
| 145 | +// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin |
| 146 | +#ifndef TIMER_TONE |
| 147 | + #define TIMER_TONE TIM6 |
| 148 | +#endif |
| 149 | +#ifndef TIMER_SERVO |
| 150 | + #define TIMER_SERVO TIM7 |
| 151 | +#endif |
| 152 | + |
| 153 | +// UART Definitions |
| 154 | +#ifndef SERIAL_UART_INSTANCE |
| 155 | + #define SERIAL_UART_INSTANCE 101 //Connected to ST-Link |
| 156 | +#endif |
| 157 | + |
| 158 | +// Default pin used for 'Serial' instance (ex: ST-Link) |
| 159 | +// Mandatory for Firmata |
| 160 | +#ifndef PIN_SERIAL_RX |
| 161 | + #define PIN_SERIAL_RX PA3 |
| 162 | +#endif |
| 163 | +#ifndef PIN_SERIAL_TX |
| 164 | + #define PIN_SERIAL_TX PA2 |
| 165 | +#endif |
| 166 | + |
| 167 | +// Extra HAL modules |
| 168 | +#if !defined(HAL_DAC_MODULE_DISABLED) |
| 169 | + #define HAL_DAC_MODULE_ENABLED |
| 170 | +#endif |
| 171 | + |
| 172 | +/*---------------------------------------------------------------------------- |
| 173 | + * Arduino objects - C++ only |
| 174 | + *----------------------------------------------------------------------------*/ |
| 175 | + |
| 176 | +#ifdef __cplusplus |
| 177 | + // These serial port names are intended to allow libraries and architecture-neutral |
| 178 | + // sketches to automatically default to the correct port name for a particular type |
| 179 | + // of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, |
| 180 | + // the first hardware serial port whose RX/TX pins are not dedicated to another use. |
| 181 | + // |
| 182 | + // SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor |
| 183 | + // |
| 184 | + // SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial |
| 185 | + // |
| 186 | + // SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library |
| 187 | + // |
| 188 | + // SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. |
| 189 | + // |
| 190 | + // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX |
| 191 | + // pins are NOT connected to anything by default. |
| 192 | + #define SERIAL_PORT_MONITOR Serial |
| 193 | + #define SERIAL_PORT_HARDWARE Serial2 |
| 194 | +#endif |
0 commit comments