|
| 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 PA10 0 |
| 19 | +#define PA9 1 |
| 20 | +#define PA6 A6 |
| 21 | +#define PA7 A7 |
| 22 | +#define PA8 4 |
| 23 | +#define PC6 5 |
| 24 | +#define PA11 A10 |
| 25 | +#define PA12 A11 |
| 26 | +#define PB2 A12 |
| 27 | +#define PB1 A9 |
| 28 | +#define PB0 A8 |
| 29 | +#define PB5 11 |
| 30 | +#define PB4 12 |
| 31 | +#define PB3 13 // LED |
| 32 | +#define PB7 A13 |
| 33 | +#define PB6 15 |
| 34 | +#define PB9 16 |
| 35 | +#define PB8 17 |
| 36 | +#define PA15 18 |
| 37 | +#define PA14 A14 // SWD / BOOT0 |
| 38 | +#define PA13 A15 // SWD |
| 39 | +#define PA0 A0 |
| 40 | +#define PA1 A1 |
| 41 | +#define PA2 A2 |
| 42 | +#define PA3 A3 |
| 43 | +#define PA4 A4 |
| 44 | +#define PA5 A5 |
| 45 | +#define PA9_R 27 |
| 46 | +#define PA10_R 28 |
| 47 | +// #define PC14 29 // OSC32IN |
| 48 | +// #define PC15 30 // OSC32OUT |
| 49 | + |
| 50 | +// Alternate pins number |
| 51 | +#define PA6_ALT1 (PA6 | ALT1) |
| 52 | +#define PA7_ALT1 (PA7 | ALT1) |
| 53 | +#define PA7_ALT2 (PA7 | ALT2) |
| 54 | +#define PA7_ALT3 (PA7 | ALT3) |
| 55 | +#define PB0_ALT1 (PB0 | ALT1) |
| 56 | +#define PB1_ALT1 (PB1 | ALT1) |
| 57 | +#define PB1_ALT2 (PB1 | ALT2) |
| 58 | +#define PB6_ALT1 (PB6 | ALT1) |
| 59 | + |
| 60 | +#define NUM_DIGITAL_PINS 29 |
| 61 | +#define NUM_REMAP_PINS 2 |
| 62 | +#define NUM_ANALOG_INPUTS 16 |
| 63 | + |
| 64 | +// On-board LED pin number |
| 65 | +#ifndef LED_BUILTIN |
| 66 | + #define LED_BUILTIN PB3 |
| 67 | +#endif |
| 68 | +#define LED_GREEN LED_BUILTIN |
| 69 | + |
| 70 | +// On-board user button |
| 71 | +#ifndef USER_BTN |
| 72 | + #define USER_BTN PA8 |
| 73 | +#endif |
| 74 | + |
| 75 | +// Timer Definitions |
| 76 | +// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin |
| 77 | +#ifndef TIMER_TONE |
| 78 | + #define TIMER_TONE TIM14 |
| 79 | +#endif |
| 80 | +#ifndef TIMER_SERVO |
| 81 | + #define TIMER_SERVO TIM16 |
| 82 | +#endif |
| 83 | + |
| 84 | +// UART Definitions |
| 85 | +#ifndef SERIAL_UART_INSTANCE |
| 86 | + #define SERIAL_UART_INSTANCE 2 //Connected to Aurora Connect Lite |
| 87 | +#endif |
| 88 | + |
| 89 | +// Default pin used for 'Serial' instance (ex: ST-Link) |
| 90 | +// Mandatory for Firmata |
| 91 | +#ifndef PIN_SERIAL_RX |
| 92 | + #define PIN_SERIAL_RX PA10 |
| 93 | +#endif |
| 94 | +#ifndef PIN_SERIAL_TX |
| 95 | + #define PIN_SERIAL_TX PA9 |
| 96 | +#endif |
| 97 | + |
| 98 | +/*---------------------------------------------------------------------------- |
| 99 | + * Arduino objects - C++ only |
| 100 | + *----------------------------------------------------------------------------*/ |
| 101 | + |
| 102 | +#ifdef __cplusplus |
| 103 | + // These serial port names are intended to allow libraries and architecture-neutral |
| 104 | + // sketches to automatically default to the correct port name for a particular type |
| 105 | + // of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, |
| 106 | + // the first hardware serial port whose RX/TX pins are not dedicated to another use. |
| 107 | + // |
| 108 | + // SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor |
| 109 | + // |
| 110 | + // SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial |
| 111 | + // |
| 112 | + // SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library |
| 113 | + // |
| 114 | + // SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. |
| 115 | + // |
| 116 | + // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX |
| 117 | + // pins are NOT connected to anything by default. |
| 118 | + #define SERIAL_PORT_MONITOR Serial |
| 119 | + #define SERIAL_PORT_HARDWARE Serial2 |
| 120 | +#endif |
0 commit comments