Changed all remaining boards to have HW serial definitions in board.cpp so that every board can configure which Arduino Serial instance maps to which hardware serial device
This commit is contained in:
parent
29f7cc74b4
commit
58df3f36b4
|
@ -32,6 +32,11 @@
|
||||||
|
|
||||||
#include <board/board.h> // For this board's header file
|
#include <board/board.h> // For this board's header file
|
||||||
|
|
||||||
|
|
||||||
|
/* Roger Clark. Added next to includes for changes to Serial */
|
||||||
|
#include <libmaple/usart.h>
|
||||||
|
#include <HardwareSerial.h>
|
||||||
|
|
||||||
#include <wirish_types.h> // For stm32_pin_info and its contents
|
#include <wirish_types.h> // For stm32_pin_info and its contents
|
||||||
// (these go into PIN_MAP).
|
// (these go into PIN_MAP).
|
||||||
|
|
||||||
|
@ -148,3 +153,19 @@ extern const uint8 boardUsedPins[BOARD_NR_USED_PINS] __FLASH__ = {
|
||||||
BOARD_JTMS_SWDIO_PIN,
|
BOARD_JTMS_SWDIO_PIN,
|
||||||
BOARD_JTCK_SWCLK_PIN, BOARD_JTDI_PIN, BOARD_JTDO_PIN, BOARD_NJTRST_PIN
|
BOARD_JTCK_SWCLK_PIN, BOARD_JTDI_PIN, BOARD_JTDO_PIN, BOARD_NJTRST_PIN
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef SERIAL_USB
|
||||||
|
DEFINE_HWSERIAL(Serial1, 1);
|
||||||
|
DEFINE_HWSERIAL(Serial2, 2);
|
||||||
|
DEFINE_HWSERIAL(Serial3, 3);
|
||||||
|
DEFINE_HWSERIAL_UART(Serial4, 4);
|
||||||
|
DEFINE_HWSERIAL_UART(Serial5, 5);
|
||||||
|
#else
|
||||||
|
DEFINE_HWSERIAL(Serial, 1);
|
||||||
|
DEFINE_HWSERIAL(Serial1, 2);
|
||||||
|
DEFINE_HWSERIAL(Serial2, 3);
|
||||||
|
DEFINE_HWSERIAL_UART(Serial3, 4);
|
||||||
|
DEFINE_HWSERIAL_UART(Serial4, 5);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,10 @@
|
||||||
|
|
||||||
#include <board/board.h> // For this board's header file
|
#include <board/board.h> // For this board's header file
|
||||||
|
|
||||||
|
/* Roger Clark. Added next to includes for changes to Serial */
|
||||||
|
#include <libmaple/usart.h>
|
||||||
|
#include <HardwareSerial.h>
|
||||||
|
|
||||||
#include <wirish_types.h> // For stm32_pin_info and its contents
|
#include <wirish_types.h> // For stm32_pin_info and its contents
|
||||||
// (these go into PIN_MAP).
|
// (these go into PIN_MAP).
|
||||||
|
|
||||||
|
@ -178,3 +182,18 @@ extern const uint8 boardUsedPins[BOARD_NR_USED_PINS] __FLASH__ = {
|
||||||
BOARD_LED_PIN, BOARD_BUTTON_PIN, BOARD_JTMS_SWDIO_PIN,
|
BOARD_LED_PIN, BOARD_BUTTON_PIN, BOARD_JTMS_SWDIO_PIN,
|
||||||
BOARD_JTCK_SWCLK_PIN, BOARD_JTDI_PIN, BOARD_JTDO_PIN, BOARD_NJTRST_PIN
|
BOARD_JTCK_SWCLK_PIN, BOARD_JTDI_PIN, BOARD_JTDO_PIN, BOARD_NJTRST_PIN
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef SERIAL_USB
|
||||||
|
DEFINE_HWSERIAL(Serial1, 1);
|
||||||
|
DEFINE_HWSERIAL(Serial2, 2);
|
||||||
|
DEFINE_HWSERIAL(Serial3, 3);
|
||||||
|
DEFINE_HWSERIAL_UART(Serial4, 4);
|
||||||
|
DEFINE_HWSERIAL_UART(Serial5, 5);
|
||||||
|
#else
|
||||||
|
DEFINE_HWSERIAL(Serial, 1);
|
||||||
|
DEFINE_HWSERIAL(Serial1, 2);
|
||||||
|
DEFINE_HWSERIAL(Serial2, 3);
|
||||||
|
DEFINE_HWSERIAL_UART(Serial3, 4);
|
||||||
|
DEFINE_HWSERIAL_UART(Serial4, 5);
|
||||||
|
#endif
|
|
@ -46,20 +46,22 @@
|
||||||
#define BOARD_LED_PIN PE5
|
#define BOARD_LED_PIN PE5
|
||||||
#define BOARD_LED_PIN2 PE6
|
#define BOARD_LED_PIN2 PE6
|
||||||
|
|
||||||
/* Note: UART4 and UART5 have pins which aren't broken out :( */
|
// USARTS
|
||||||
#define BOARD_NR_USARTS 3
|
#define BOARD_NR_USARTS 5
|
||||||
#define BOARD_USART1_TX_PIN PA9
|
#define BOARD_USART1_TX_PIN PA9
|
||||||
#define BOARD_USART1_RX_PIN PA10
|
#define BOARD_USART1_RX_PIN PA10
|
||||||
|
|
||||||
#define BOARD_USART2_TX_PIN PA2
|
#define BOARD_USART2_TX_PIN PA2
|
||||||
#define BOARD_USART2_RX_PIN PA3
|
#define BOARD_USART2_RX_PIN PA3
|
||||||
|
|
||||||
#define BOARD_USART3_TX_PIN PB10
|
#define BOARD_USART3_TX_PIN PB10
|
||||||
#define BOARD_USART3_RX_PIN PB11
|
#define BOARD_USART3_RX_PIN PB11
|
||||||
/*
|
|
||||||
#define BOARD_USART4_TX_PIN PC10
|
#define BOARD_USART4_TX_PIN PC10
|
||||||
#define BOARD_USART4_RX_PIN PC11
|
#define BOARD_USART4_RX_PIN PC11
|
||||||
|
|
||||||
#define BOARD_USART5_TX_PIN PC12
|
#define BOARD_USART5_TX_PIN PC12
|
||||||
#define BOARD_USART5_RX_PIN PD2
|
#define BOARD_USART5_RX_PIN PD2
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,10 @@
|
||||||
|
|
||||||
#include <board/board.h> // For this board's header file
|
#include <board/board.h> // For this board's header file
|
||||||
|
|
||||||
|
/* Roger Clark. Added next to includes for changes to Serial */
|
||||||
|
#include <libmaple/usart.h>
|
||||||
|
#include <HardwareSerial.h>
|
||||||
|
|
||||||
#include <wirish_types.h> // For stm32_pin_info and its contents
|
#include <wirish_types.h> // For stm32_pin_info and its contents
|
||||||
// (these go into PIN_MAP).
|
// (these go into PIN_MAP).
|
||||||
|
|
||||||
|
@ -213,3 +217,18 @@ extern const uint8 boardUsedPins[BOARD_NR_USED_PINS] __FLASH__ = {
|
||||||
BOARD_JTMS_SWDIO_PIN,
|
BOARD_JTMS_SWDIO_PIN,
|
||||||
BOARD_JTCK_SWCLK_PIN, BOARD_JTDI_PIN, BOARD_JTDO_PIN, BOARD_NJTRST_PIN
|
BOARD_JTCK_SWCLK_PIN, BOARD_JTDI_PIN, BOARD_JTDO_PIN, BOARD_NJTRST_PIN
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef SERIAL_USB
|
||||||
|
DEFINE_HWSERIAL(Serial1, 1);
|
||||||
|
DEFINE_HWSERIAL(Serial2, 2);
|
||||||
|
DEFINE_HWSERIAL(Serial3, 3);
|
||||||
|
DEFINE_HWSERIAL_UART(Serial4, 4);
|
||||||
|
DEFINE_HWSERIAL_UART(Serial5, 5);
|
||||||
|
#else
|
||||||
|
DEFINE_HWSERIAL(Serial, 1);
|
||||||
|
DEFINE_HWSERIAL(Serial1, 2);
|
||||||
|
DEFINE_HWSERIAL(Serial2, 3);
|
||||||
|
DEFINE_HWSERIAL_UART(Serial3, 4);
|
||||||
|
DEFINE_HWSERIAL_UART(Serial4, 5);
|
||||||
|
#endif
|
|
@ -32,6 +32,10 @@
|
||||||
|
|
||||||
#include <board/board.h> // For this board's header file
|
#include <board/board.h> // For this board's header file
|
||||||
|
|
||||||
|
/* Roger Clark. Added next to includes for changes to Serial */
|
||||||
|
#include <libmaple/usart.h>
|
||||||
|
#include <HardwareSerial.h>
|
||||||
|
|
||||||
#include <wirish_types.h> // For stm32_pin_info and its contents
|
#include <wirish_types.h> // For stm32_pin_info and its contents
|
||||||
// (these go into PIN_MAP).
|
// (these go into PIN_MAP).
|
||||||
|
|
||||||
|
@ -141,3 +145,19 @@ extern const uint8 boardUsedPins[] __FLASH__ = {
|
||||||
13, 33, BOARD_JTMS_SWDIO_PIN,
|
13, 33, BOARD_JTMS_SWDIO_PIN,
|
||||||
BOARD_JTCK_SWCLK_PIN, BOARD_JTDI_PIN, BOARD_JTDO_PIN, BOARD_NJTRST_PIN
|
BOARD_JTCK_SWCLK_PIN, BOARD_JTDI_PIN, BOARD_JTDO_PIN, BOARD_NJTRST_PIN
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Roger Clark
|
||||||
|
*
|
||||||
|
* 2015/05/28
|
||||||
|
*
|
||||||
|
* Moved definitions for Hardware Serial devices from HardwareSerial.cpp so that each board can define which Arduino "Serial" instance
|
||||||
|
* Maps to which hardware serial port on the microprocessor
|
||||||
|
*
|
||||||
|
* Note. Maple always has SERIAL USB, so there is no need for the #fidef for this
|
||||||
|
* As its a Medium Density device (F103RB), it only has 3 hardware serial devices.
|
||||||
|
*/
|
||||||
|
|
||||||
|
DEFINE_HWSERIAL(Serial1, 1);
|
||||||
|
DEFINE_HWSERIAL(Serial2, 2);
|
||||||
|
DEFINE_HWSERIAL(Serial3, 3);
|
||||||
|
|
|
@ -35,6 +35,10 @@
|
||||||
#include <libmaple/gpio.h>
|
#include <libmaple/gpio.h>
|
||||||
#include <libmaple/timer.h>
|
#include <libmaple/timer.h>
|
||||||
|
|
||||||
|
/* Roger Clark. Added next to includes for changes to Serial */
|
||||||
|
#include <libmaple/usart.h>
|
||||||
|
#include <HardwareSerial.h>
|
||||||
|
|
||||||
#include <wirish_debug.h>
|
#include <wirish_debug.h>
|
||||||
#include <wirish_types.h>
|
#include <wirish_types.h>
|
||||||
|
|
||||||
|
@ -103,3 +107,22 @@ extern const uint8 boardADCPins[BOARD_NR_ADC_PINS] __FLASH__ = {
|
||||||
extern const uint8 boardUsedPins[BOARD_NR_USED_PINS] __FLASH__ = {
|
extern const uint8 boardUsedPins[BOARD_NR_USED_PINS] __FLASH__ = {
|
||||||
32, 32, USB_DP, USB_DM
|
32, 32, USB_DP, USB_DM
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Roger Clark
|
||||||
|
*
|
||||||
|
* 2015/05/28
|
||||||
|
*
|
||||||
|
* Moved definitions for Hardware Serial devices from HardwareSerial.cpp so that each board can define which Arduino "Serial" instance
|
||||||
|
* Maps to which hardware serial port on the microprocessor
|
||||||
|
*
|
||||||
|
* Note. Maple mini always has SERIAL USB, so there is no need for the #fidef for this
|
||||||
|
* As its a Medium Density device, it only has 3 hardware serial devices.
|
||||||
|
*/
|
||||||
|
|
||||||
|
DEFINE_HWSERIAL(Serial1, 1);
|
||||||
|
DEFINE_HWSERIAL(Serial2, 2);
|
||||||
|
DEFINE_HWSERIAL(Serial3, 3);
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,10 @@
|
||||||
|
|
||||||
#include <board/board.h> // For this board's header file
|
#include <board/board.h> // For this board's header file
|
||||||
|
|
||||||
|
/* Roger Clark. Added next to includes for changes to Serial */
|
||||||
|
#include <libmaple/usart.h>
|
||||||
|
#include <HardwareSerial.h>
|
||||||
|
|
||||||
#include <wirish_types.h> // For stm32_pin_info and its contents
|
#include <wirish_types.h> // For stm32_pin_info and its contents
|
||||||
// (these go into PIN_MAP).
|
// (these go into PIN_MAP).
|
||||||
|
|
||||||
|
@ -155,3 +159,20 @@ extern const uint8 boardUsedPins[BOARD_NR_USED_PINS] __FLASH__ = {
|
||||||
BOARD_JTMS_SWDIO_PIN,
|
BOARD_JTMS_SWDIO_PIN,
|
||||||
BOARD_JTCK_SWCLK_PIN, BOARD_JTDI_PIN, BOARD_JTDO_PIN, BOARD_NJTRST_PIN
|
BOARD_JTCK_SWCLK_PIN, BOARD_JTDI_PIN, BOARD_JTDO_PIN, BOARD_NJTRST_PIN
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Roger Clark
|
||||||
|
*
|
||||||
|
* 2015/05/28
|
||||||
|
*
|
||||||
|
* Moved definitions for Hardware Serial devices from HardwareSerial.cpp so that each board can define which Arduino "Serial" instance
|
||||||
|
* Maps to which hardware serial port on the microprocessor
|
||||||
|
*
|
||||||
|
* Note. Maple Ret always has SERIAL USB, so there is no need for the #fidef for this
|
||||||
|
* As its a High Density device (F103RE), it has 6 hardware serial devices.
|
||||||
|
*/
|
||||||
|
DEFINE_HWSERIAL(Serial1, 1);
|
||||||
|
DEFINE_HWSERIAL(Serial2, 2);
|
||||||
|
DEFINE_HWSERIAL(Serial3, 3);
|
||||||
|
DEFINE_HWSERIAL_UART(Serial4, 4);
|
||||||
|
DEFINE_HWSERIAL_UART(Serial5, 5);
|
|
@ -33,6 +33,10 @@
|
||||||
|
|
||||||
#include <board/board.h>
|
#include <board/board.h>
|
||||||
|
|
||||||
|
/* Roger Clark. Added next to includes for changes to Serial */
|
||||||
|
#include <libmaple/usart.h>
|
||||||
|
#include <HardwareSerial.h>
|
||||||
|
|
||||||
#include <libmaple/gpio.h>
|
#include <libmaple/gpio.h>
|
||||||
#include <libmaple/timer.h>
|
#include <libmaple/timer.h>
|
||||||
|
|
||||||
|
@ -95,3 +99,19 @@ extern const uint8 boardADCPins[BOARD_NR_ADC_PINS] __FLASH__ = {
|
||||||
extern const uint8 boardUsedPins[BOARD_NR_USED_PINS] __FLASH__ = {
|
extern const uint8 boardUsedPins[BOARD_NR_USED_PINS] __FLASH__ = {
|
||||||
4, 24, USB_DP, USB_DM
|
4, 24, USB_DP, USB_DM
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Roger Clark
|
||||||
|
*
|
||||||
|
* 2015/05/28
|
||||||
|
*
|
||||||
|
* Moved definitions for Hardware Serial devices from HardwareSerial.cpp so that each board can define which Arduino "Serial" instance
|
||||||
|
* Maps to which hardware serial port on the microprocessor
|
||||||
|
*
|
||||||
|
* Note. I think a microduino is a Maple mini clone in another form factor,
|
||||||
|
*/
|
||||||
|
|
||||||
|
DEFINE_HWSERIAL(Serial1, 1);
|
||||||
|
DEFINE_HWSERIAL(Serial2, 2);
|
||||||
|
DEFINE_HWSERIAL(Serial3, 3);
|
||||||
|
|
|
@ -249,15 +249,11 @@ MOSI alternate functions on the GPIO ports.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef SERIAL_USB
|
#ifdef SERIAL_USB
|
||||||
DEFINE_HWSERIAL(Serial1, 2);
|
DEFINE_HWSERIAL(Serial1, 1);
|
||||||
|
DEFINE_HWSERIAL(Serial2, 2);
|
||||||
DEFINE_HWSERIAL(Serial2, 1);
|
DEFINE_HWSERIAL(Serial3, 3);
|
||||||
|
|
||||||
DEFINE_HWSERIAL(Serial3, 3);
|
|
||||||
#else
|
#else
|
||||||
DEFINE_HWSERIAL(Serial, 2);// Use HW Serial 2 as "Serial"
|
DEFINE_HWSERIAL(Serial, 3);// Use HW Serial 2 as "Serial"
|
||||||
|
DEFINE_HWSERIAL(Serial1, 2);
|
||||||
DEFINE_HWSERIAL(Serial1, 1);
|
DEFINE_HWSERIAL(Serial2, 1);
|
||||||
|
|
||||||
DEFINE_HWSERIAL(Serial2, 3);
|
|
||||||
#endif
|
#endif
|
Loading…
Reference in New Issue