From 848df066c4a11a81d544b7aa8df0c4f4952992e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Sun, 19 Jun 2022 23:42:40 +0200 Subject: [PATCH] [boards] Add WB2L variant definition --- boards/wb2l/pins_arduino.h | 1 + boards/wb2l/variant.cpp | 38 +++++++++++++++++++++++++++++++++++++ boards/wb2l/variant.h | 39 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 boards/wb2l/pins_arduino.h create mode 100644 boards/wb2l/variant.cpp create mode 100644 boards/wb2l/variant.h diff --git a/boards/wb2l/pins_arduino.h b/boards/wb2l/pins_arduino.h new file mode 100644 index 0000000..1de3ade --- /dev/null +++ b/boards/wb2l/pins_arduino.h @@ -0,0 +1 @@ +#include "variant.h" diff --git a/boards/wb2l/variant.cpp b/boards/wb2l/variant.cpp new file mode 100644 index 0000000..534343b --- /dev/null +++ b/boards/wb2l/variant.cpp @@ -0,0 +1,38 @@ +/* This file was auto-generated from wb2l.json using boardgen */ + +#include + +extern "C" { + +// clang-format off +PinInfo pinTable[PINS_COUNT] = { + // D0: P8, PWM2 + {GPIO8, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D1: P7, PWM1 + {GPIO7, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D2: P6, PWM0 + {GPIO6, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D3: P26, PWM5, IRDA + {GPIO26, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D4: P24, PWM4 + {GPIO24, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D5: P10, UART1_RX + {GPIO10, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D6: P11, UART1_TX + {GPIO11, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D7: P1, UART2_RX, I2C2_SDA + {GPIO1, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D8: P0, UART2_TX, I2C2_SCL + {GPIO0, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D9: P20, I2C1_SCL, TCK, FSCK + {GPIO20, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_JTAG, PIN_NONE, 0}, + // D10: P21, I2C1_SDA, TMS, MCLK, ^FCS + {GPIO21, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_JTAG, PIN_NONE, 0}, + // D11: P23, ADC3, TDO, FSO + {GPIO23, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_JTAG, PIN_NONE, 0}, + // D12: P22, TDI, FSI + {GPIO22, PIN_GPIO | PIN_IRQ | PIN_JTAG, PIN_NONE, 0}, +}; +// clang-format on + +} // extern "C" diff --git a/boards/wb2l/variant.h b/boards/wb2l/variant.h new file mode 100644 index 0000000..1135870 --- /dev/null +++ b/boards/wb2l/variant.h @@ -0,0 +1,39 @@ +/* This file was auto-generated from wb2l.json using boardgen */ + +#pragma once + +#include + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 13 +#define NUM_DIGITAL_PINS 13 +#define NUM_ANALOG_INPUTS 1 +#define NUM_ANALOG_OUTPUTS 0 + +// Analog pins +// ----------- +#define PIN_A0 11u // GPIO23 +#define A0 PIN_A0 + +// SPI Interfaces +// -------------- +#define SPI_INTERFACES_COUNT 0 + +// Wire Interfaces +// --------------- +#define WIRE_INTERFACES_COUNT 2 +#define PIN_WIRE1_SCL 9u // GPIO20 +#define PIN_WIRE1_SDA 10u // GPIO21 +#define PIN_WIRE2_SCL 8u // GPIO0 +#define PIN_WIRE2_SDA 7u // GPIO1 + +// Serial ports +// ------------ +#define SERIAL_INTERFACES_COUNT 2 +#define PIN_SERIAL1_RX 5u // GPIO10 +#define PIN_SERIAL1_TX 6u // GPIO11 +#define PIN_SERIAL2_RX 7u // GPIO1 +#define PIN_SERIAL2_TX 8u // GPIO0