|
| 1 | +/* |
| 2 | + ******************************************************************************* |
| 3 | + * Copyright (c) 2022, 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 PA3 0 |
| 19 | +#define PA2 1 |
| 20 | +#define PC6 2 |
| 21 | +#define PC7 3 |
| 22 | +#define PA0 4 |
| 23 | +#define PD0 5 |
| 24 | +#define PD1 6 |
| 25 | +#define PD2 7 |
| 26 | +#define PD3 8 |
| 27 | +#define PA8 9 |
| 28 | +#define PB0 10 |
| 29 | +#define PA7 11 |
| 30 | +#define PA6 12 |
| 31 | +#define PA1 13 |
| 32 | +#define PB10 A5 |
| 33 | +#define PB11 A4 |
| 34 | +#define PA4 A0 // Joystick |
| 35 | +#define PA5 A1 // LED BLUE |
| 36 | +#define PA10 A2 // SDA // No ADC capability, despite analog "A2" Silk mark on board |
| 37 | +#define PA9 A3 // SCL // No ADC capability, despite analog "A3" Silk mark on board |
| 38 | +#define PB6 20 // STM32_TX1 |
| 39 | +#define PB7 21 // STM32_RX1 |
| 40 | + |
| 41 | + |
| 42 | +#define NUM_DIGITAL_PINS 22 |
| 43 | +#define NUM_ANALOG_INPUTS 6 |
| 44 | + |
| 45 | +// On-board LED pin number |
| 46 | +#define LED_GREEN PA5 |
| 47 | +#ifndef LED_BUILTIN |
| 48 | + #define LED_BUILTIN LED_GREEN |
| 49 | +#endif |
| 50 | + |
| 51 | +// On-board user button |
| 52 | +#ifndef USER_BTN |
| 53 | + #define USER_BTN PA4 |
| 54 | +#endif |
| 55 | + |
| 56 | +// I2C Definitions |
| 57 | +#ifndef PIN_WIRE_SDA |
| 58 | + #define PIN_WIRE_SDA PA10 |
| 59 | +#endif |
| 60 | +#ifndef PIN_WIRE_SCL |
| 61 | + #define PIN_WIRE_SCL PA9 |
| 62 | +#endif |
| 63 | + |
| 64 | +// Timer Definitions |
| 65 | +#ifndef TIMER_TONE |
| 66 | + #define TIMER_TONE TIM16 |
| 67 | +#endif |
| 68 | +#ifndef TIMER_SERVO |
| 69 | + #define TIMER_SERVO TIM17 |
| 70 | +#endif |
| 71 | + |
| 72 | +// UART Definitions |
| 73 | +#ifndef SERIAL_UART_INSTANCE |
| 74 | + #define SERIAL_UART_INSTANCE 1 |
| 75 | +#endif |
| 76 | + |
| 77 | +// Default pin used for generic 'Serial' instance |
| 78 | +// Mandatory for Firmata |
| 79 | +#ifndef PIN_SERIAL_RX |
| 80 | + #define PIN_SERIAL_RX PB7 |
| 81 | +#endif |
| 82 | +#ifndef PIN_SERIAL_TX |
| 83 | + #define PIN_SERIAL_TX PB6 |
| 84 | +#endif |
| 85 | + |
| 86 | + |
| 87 | +/*---------------------------------------------------------------------------- |
| 88 | + * Arduino objects - C++ only |
| 89 | + *----------------------------------------------------------------------------*/ |
| 90 | + |
| 91 | +#ifdef __cplusplus |
| 92 | + // These serial port names are intended to allow libraries and architecture-neutral |
| 93 | + // sketches to automatically default to the correct port name for a particular type |
| 94 | + // of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, |
| 95 | + // the first hardware serial port whose RX/TX pins are not dedicated to another use. |
| 96 | + // |
| 97 | + // SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor |
| 98 | + // |
| 99 | + // SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial |
| 100 | + // |
| 101 | + // SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library |
| 102 | + // |
| 103 | + // SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. |
| 104 | + // |
| 105 | + // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX |
| 106 | + // pins are NOT connected to anything by default. |
| 107 | + #ifndef SERIAL_PORT_MONITOR |
| 108 | + #define SERIAL_PORT_MONITOR Serial |
| 109 | + #endif |
| 110 | + #ifndef SERIAL_PORT_HARDWARE |
| 111 | + #define SERIAL_PORT_HARDWARE Serial |
| 112 | + #endif |
| 113 | +#endif |
0 commit comments